You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by na...@locus.apache.org on 2000/05/13 22:29:50 UTC

cvs commit: jakarta-taglibs/xsl/src/org/apache/taglibs/xsl ClearResponse.java InsertWithXSL.java Return.java ShowSource.java XSLProcessor.java XSLProcessorFactory.java XalanXSLProcessor.java

nacho       00/05/13 13:29:49

  Modified:    .        build.xml
  Added:       xsl      build.bat build.sh build.xml
               xsl/conf taglib.tld
               xsl/doc/conf web.xml
               xsl/doc/web index.html
               xsl/examples/conf web.xml
               xsl/examples/web index.html
               xsl/examples/web/images code.gif execute.gif return.gif
               xsl/examples/web/jsp ShowSource.jsp XslExample.jsp
               xsl/examples/web/xml foo.xml foo.xsl
               xsl/lib  xalan.jar xerces.jar
               xsl/src/org/apache/taglibs/xsl ClearResponse.java
                        InsertWithXSL.java Return.java ShowSource.java
                        XSLProcessor.java XSLProcessorFactory.java
                        XalanXSLProcessor.java
  Log:
  * Changed the directory for xsl tags to "xsl"
  * Some minor typos in XSL tags library.
  * Changed package to org.apache.taglibs.xsl for be minimalistic.
  * Included xsl tags in the global build.xml
  
  Revision  Changes    Path
  1.3       +7 -3      jakarta-taglibs/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/build.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- build.xml	2000/05/10 13:17:41	1.2
  +++ build.xml	2000/05/13 20:29:46	1.3
  @@ -1,5 +1,5 @@
   <!-- ANT Build Script for the JAKARTA-TAGLIBS Project -->
  -<!-- $Id: build.xml,v 1.2 2000/05/10 13:17:41 nacho Exp $ -->
  +<!-- $Id: build.xml,v 1.3 2000/05/13 20:29:46 nacho Exp $ -->
   <project name="jakarta-taglibs" default="dist" basedir=".">
   
   
  @@ -39,8 +39,8 @@
   
       <property name="build.dir"      value="../build/taglibs"/>
       <property name="dist.dir"       value="../dist/taglibs"/>
  +	
   
  -
     <!-- ********************** Destination Preparation ********************* -->
   
     <!-- Create the destination directories -->
  @@ -81,9 +81,13 @@
       <ant dir="./sql" target="dist"/>
     </target>
   
  +  <target name="xsl">
  +    <ant dir="./xsl" target="dist"/>
  +  </target>
  +
   
     <!-- *********************** Overall Build Command ********************** -->
   
  -  <target name="dist" depends="prepare,static,jspspec,sql"/>
  +  <target name="dist" depends="prepare,static,jspspec,sql,xsl"/>
   
   </project>
  
  
  
  1.1                  jakarta-taglibs/xsl/build.bat
  
  Index: build.bat
  ===================================================================
  @echo off
  
  if "%SERVLET_JAR%" == "" goto noservletjar
  
  set _ANTHOME=%ANT_HOME%
  if "%ANT_HOME%" == "" set ANT_HOME=..\..\jakarta-ant
  
  if "%CLASSPATH%" == "" goto noclasspath
  
  rem try guessing for xerces & xalan
  
  
  set _CLASSPATH=%CLASSPATH%
  set CLASSPATH=%CLASSPATH%;%ANT_HOME%\lib\ant.jar;%ANT_HOME%\lib\xml.jar;%JAVA_HOME\lib\tools.jar
  goto next
  
  :noclasspath
  
  set _CLASSPATH=
  set CLASSPATH=%ANT_HOME%\lib\ant.jar;%ANT_HOME%\lib\xml.jar;%JAVA_HOME%\lib\tools.jar
  goto next
  
  :next
  
  java org.apache.tools.ant.Main -Dant.home=%ANT_HOME% -Dservlet.jar=%SERVLET_JAR% %1 %2 %3 %4 %5 %6 %7 %8 %9
  
  :clean
  set CLASSPATH=%_CLASSPATH%
  set _CLASSPATH=
  set ANT_HOME=%_ANTHOME%
  set _ANTHOME=
  set ARGS=%_ARGS%
  set _ARGS=
  goto done
  
  :noservletjar
  echo You must set SERVLET_JAR to that pathname of your servlet.jar file
  
  :done
  
  
  
  
  1.1                  jakarta-taglibs/xsl/build.sh
  
  Index: build.sh
  ===================================================================
  #! /bin/sh
  
  if [ "$ANT_HOME" = "" ] ; then
    ANT_HOME=../../jakarta-ant
  fi
  
  args=""
  if [ "$SERVLET_JAR" != "" ] ; then
    args="$args -Dservlet.jar=$SERVLET_JAR"
  fi
  args="$args -Dant.home=$ANT_HOME"
  
  cp=$ANT_HOME/lib/ant.jar:$ANT_HOME/lib/xml.jar:$JAVA_HOME/lib/tools.jar:examples/lib/xalan.jar:examples/lib/xerces.jar
  
  java -classpath $cp:$CLASSPATH org.apache.tools.ant.Main $args "$@"
  
  
  
  1.1                  jakarta-taglibs/xsl/build.xml
  
  Index: build.xml
  ===================================================================
  <!-- ANT Build Script for the "xsl" Custom Tag Library -->
  <!-- $Id: build.xml,v 1.1 2000/05/13 20:29:46 nacho Exp $ -->
  <project name="xsl" default="main" basedir=".">
  
      <!-- ******************** Adjustable Properties *********************** -->
  
      <!--
  
          The following property values should be examined and customized
  	for each custom tag library subproject.
  
  	ant.home                    Home directory for the ANT build tool
  	                            This is normally defaulted from the
  				    ANT_HOME environment variable in the
  				    build script.
  
  	servlet.jar                 Pathname of the servlet API classes
  	                            you are using to compile, such as the
  				    one that comes with Tomcat.  This is
  				    normally defaulted from the SERVLET_JAR
  				    environment variable in the build script.
  
          taglib.name		    Base name of this tag library subproject.
  
      -->
  
      <property name="taglib.name"    value="xsl"/>
      <property name="ant.home"    value="../../jakarta-ant"/>
      <property name="servlet.jar"    value="../../jakarta-tools/servlet-2.2.0.jar"/>
      <property name="xsl.jar"       value="lib/xerces.jar;lib/xalan.jar"/>
  
  
      <!-- ****************** Project Standard Properties ******************* -->
  
      <!--
  
          The following property values reflect the standard directory
  	organization for the jakarta-taglibs project, and should not
  	be changed or overridden.
  
  	build.dir                   Base directory for build targets
  	dist.dir                    Base directory for distribution targets
  
      -->
  
      <property name="build.dir"      value="../../build/taglibs"/>
      <property name="dist.dir"       value="../../dist/taglibs"/>
  
      <!-- *********************** Default Properties ********************** -->
  
      <!--
  
          The following property values reflect the recommended directory
  	structure for each custom tag library subproject.  You should only
  	need to adjust or override them if you use a different organization.
  
  	conf.src                    Library configuration source directory
          doc.src                     Documentation app source directory
          examples.src                Examples app source directory
          library.src                 Library Java source directory
  
      -->
  
      <property name="conf.src"       value="conf"/>
      <property name="doc.src"        value="doc"/>
      <property name="examples.src"   value="examples"/>
      <property name="library.src"    value="src"/>
      <property name="lib.src"        value="lib"/>
  
  
      <!-- ********************* Derived Properties ************************* -->
  
      <!--
  
          These property values are derived from the previously defined values,
  	and should not normally be overridden from the command line.
  
          build.doc                   Target directory for documentation app
          build.examples		    Target directory for examples app
          build.library               Target directory for tag library
  	dist.doc                    Destination WAR for documentation app
  	dist.examples		    Destination WAR for examples app
  	dist.library                Destination JAR for tag library
  	dist.tld                    Destination TLD file for tag library
  
      -->
  
      <property name="build.doc"      value="${build.dir}/${taglib.name}-doc"/>
      <property name="build.examples" value="${build.dir}/${taglib.name}-examples"/>
      <property name="build.library"  value="${build.dir}/${taglib.name}"/>
      <property name="dist.doc"       value="${dist.dir}/${taglib.name}/${taglib.name}-doc.war"/>
      <property name="dist.examples"  value="${dist.dir}/${taglib.name}/${taglib.name}-examples.war"/>
      <property name="dist.library"   value="${dist.dir}/${taglib.name}/${taglib.name}.jar"/>
      <property name="dist.tld"       value="${dist.dir}/${taglib.name}/${taglib.name}.tld"/>
  
  
    <!-- ********************** Destination Preparation ********************* -->
  
    <target name="prepare">
      <!-- Set up build directories -->
      <mkdir dir="${build.dir}"/>
      <mkdir dir="${build.doc}"/>
      <mkdir dir="${build.doc}/WEB-INF"/>
      <mkdir dir="${build.doc}/WEB-INF/classes"/>
      <mkdir dir="${build.doc}/WEB-INF/lib"/>
      <mkdir dir="${build.examples}"/>
      <mkdir dir="${build.examples}/WEB-INF"/>
      <mkdir dir="${build.examples}/WEB-INF/classes"/>
      <mkdir dir="${build.examples}/WEB-INF/lib"/>
      <mkdir dir="${build.library}"/>
      <mkdir dir="${build.library}/META-INF"/>
      <!-- Set up distribution directory -->
      <mkdir dir="${dist.dir}"/>
      <mkdir dir="${dist.dir}/${taglib.name}"/>
    </target>
  
  
    <!-- **************** Compile Tag Library Components ******************** -->
  
    <!-- Compile the documentation application -->
    <target name="documentation" depends="prepare">
      <copydir src="${doc.src}/conf"      dest="${build.doc}/WEB-INF"/>
      <copydir src="${doc.src}/web"       dest="${build.doc}"/>
  <!--
      <javac srcdir="${doc.src}/src"   destdir="${build.doc}/WEB-INF/classes"
             classpath="${servlet.jar}" debug="on"/>
  -->
    </target>
  
    <!-- Compile the examples application -->
    <target name="examples" depends="library-dist">
      <copydir src="${lib.src}" dest="${build.examples}/WEB-INF/lib"/> 
      <copydir src="${library.src}" dest="${build.examples}/WEB-INF/classes"/>
      <copydir src="${examples.src}/conf" dest="${build.examples}/WEB-INF"/>
      <copydir src="${examples.src}/web"  dest="${build.examples}"/>
      <copyfile src="${dist.tld}"
                dest="${build.examples}/WEB-INF/${taglib.name}.tld"/>
      <copyfile src="${dist.library}"
                dest="${build.examples}/WEB-INF/lib/${taglib.name}.jar"/>
  <!--
      <javac srcdir="${examples.src}/src"
             destdir="${build.examples}/WEB-INF/classes"
             classpath="${servlet.jar}" debug="on"/>
  -->
    </target>
  
    <!-- Compile the tag library itself -->
    <target name="library" depends="prepare">
      <copyfile src="${conf.src}/taglib.tld"
                dest="${build.library}/META-INF/taglib.tld"/>
      <javac srcdir="${library.src}" destdir="${build.library}"
             classpath="${servlet.jar};${xsl.jar}" debug="on"/>
    </target>
  
    <!-- Compile the library as well as the associated applications -->
    <target name="main" depends="library,documentation,examples"/>
  
  
    <!-- ******************* Create Distribution Files ********************** -->
  
    <!-- Create the documentation application WAR file -->
    <target name="documentation-dist" depends="documentation">
      <jar jarfile="${dist.doc}" basedir="${build.doc}"/>
    </target>
  
    <!-- Create the examples application WAR file -->
    <target name="examples-dist" depends="examples">
      <jar jarfile="${dist.examples}" basedir="${build.examples}"/>
    </target>
  
    <!-- Create the library distribution files -->
    <target name="library-dist" depends="library">
      <jar jarfile="${dist.library}" basedir="${build.library}"/>
      <copyfile src="${conf.src}/taglib.tld" dest="${dist.tld}"/>
    </target>
  
    <!-- Create the entire set of distribution files -->
    <target name="dist" depends="library-dist,examples-dist,documentation-dist"/>
  
  
  
    <!-- ************************ Utility Commands ************************** -->
  
    <!-- Delete output directories and files so we can build from scratch -->
    <target name="clean">
      <deltree dir="${build.doc}"/>
      <deltree dir="${build.examples}"/>
      <deltree dir="${build.library}"/>
      <deltree dir="${dist.dir}/${taglib.name}"/>
    </target>
  
  </project>
  
  
  
  1.1                  jakarta-taglibs/xsl/conf/taglib.tld
  
  Index: taglib.tld
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1" ?>
  <!DOCTYPE taglib
          PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
          "http://java.sun.com/j2ee/dtds/web-jsptaglib_1_1.dtd">
  
  <!-- a tab library descriptor -->
  
  <taglib>
    <!-- after this the default space is
  	"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"
     -->
  
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>Simple XSL Tags Library</shortname>
    <uri>http://jakarta.apache.org/taglibs/xsl-1.0</uri>
    
    <info>
    	A simple tab library for the xml data.
    </info>
  
    <!-- InsertWithXSL tag -->
    <tag>
      <name>InsertWithXSL</name>
      <tagclass>org.apache.taglibs.xsl.InsertWithXSL</tagclass>
      <info>
  	Apply a given stylesheet to a given XML document.
      </info>
      <attribute>
  	<name>url</name>
  	<required>true</required>
  	<rtexprvalue>true</rtexprvalue>
      </attribute>
      <attribute>
  	<name>xsl</name>
  	<required>true</required>
  	<rtexprvalue>true</rtexprvalue>
      </attribute>
    </tag>
  
    <!-- clearResponse tag -->
    <tag>
      <name>clearResponse</name>
      <tagclass>org.apache.taglibs.xsl.ClearResponse</tagclass>
      <bodycontent>empty</bodycontent>
      <info>
  	Clear the response stream.
      </info>
    </tag>
  
    <!-- return tag -->
    <tag>
      <name>return</name>
      <tagclass>org.apache.taglibs.xsl.Return</tagclass>
      <bodycontent>empty</bodycontent>
      <info>
  	Convenience to return stream.
      </info>
    </tag>
  
    <!-- This tag doesn't really belong here -->
    <tag>
      <name>ShowSource</name>
      <tagclass>org.apache.taglibs.xsl.ShowSource</tagclass>
      <info>
  	Convenience to return Source.
      </info>
      <attribute>
         <name>jspFile</name>
         <required>true</required>
         <rtexprvalue>true</rtexprvalue>
      </attribute>
    </tag>
  
  </taglib>
  
  
  
  1.1                  jakarta-taglibs/xsl/doc/conf/web.xml
  
  Index: web.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
      "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
  
  <web-app>
      <taglib>
          <taglib-uri>
  	   XSLTAGS
          </taglib-uri>
          <taglib-location>
             /WEB-INF/tld/xmltags.tld
          </taglib-location>
      </taglib>
  </web-app>
  
  
  
  1.1                  jakarta-taglibs/xsl/doc/web/index.html
  
  Index: index.html
  ===================================================================
  <html>
  <head>
  <title>Documentation for the JSPSPEC Tag Library</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Documentation for the JSPSPEC Tag Library</h1>
  </div>
  
  <h2>1. INTRODUCTION</h2>
  
  <p>The <i>JSPSPEC</i> custom tag library contains working examples of the tags
  described in the JavaServerPages specification, Version 1.1.  As such, the
  tags are focused more on being examples of custom tag library code techniques,
  and less on being useful in production applications.
  
  
  <h2>2. PREREQUISITE SOFTWARE</h2>
  
  <p>This custom tag library requires no software other than a servlet container
  that supports the JavaServer Pages Specification, version 1.1.
  
  
  <h2>3. CONFIGURATION INFORMATION</h2>
  
  <p>Follow these steps to configure your web application with this tag library:
  <ul>
  <li>Copy the tag library descriptor file (<code>jspspec/jspspec.tld</code>)
      to the <code>/WEB-INF</code> subdirectory of your web application.
  <li>Copy the tag library JAR file (<code>jspspec/jspspec.jar</code>) to the
      <code>/WEB-INF/lib</code> subdirectory of your web application.
  <li>Add a <code>&lt;taglib&gt;</code> element to your web application
      deployment descriptor in <code>/WEB-INF/web.xml</code> like this:
  <pre>
      &lt;taglib&gt;
          &lt;taglib-uri&gt;http://jakarta.apache.org/taglibs/jspspec-1.0&lt;/taglib-uri&gt;
  	&lt;taglib-location&gt;/WEB-INF/jspspec.tld&lt;/taglib-location&gt;
      &lt;/taglib&gt;
  </pre>
  </ul>
  
  <p>To use the tags from this library in your JSP pages, add the following
  directive at the top of each page:
  <pre>
      &lt%@ taglib uri="http://jakarta.apache.org/taglibs/jspspec-1.0" prefix="x" %&gt;
  </pre>
  where "x" is the tag name prefix you wish to use for tags from this library.
  You can change this value to any prefix you like.
  
  
  <h2>4. TAG DOCUMENTATION</h2>
  
  <p>This custom tag library includes several tags, with the following
  characteristics:
  
  
  <h3>4.1 The "foo" tag</h3>
  
  <p>This tag does nothing, but serves as an illustration of the simplest
  possible tag that can be constructed.  It is described in Section A.1.1
  of the spec.</p>
  
  <table border="1" width="100%">
  <tr>
    <th width="20%">Attribute</th>
    <th width="60%">Description</th>
    <th width="20%">Required</th>
  </tr>
  <tr>
    <td align="center">att1</td>
    <td>The first attribute for this tag.  It can take any string value.</td>
    <td align="center">Yes</td>
  </tr>
  <tr>
    <td align="center">att2</td>
    <td>The second attribute for this tag.  It can take any string value.</td>
    <td align="center">Yes</td>
  </tr>
  <tr>
    <td align="center">att3</td>
    <td>The third attribute for this tag.  It can take any string value.</td>
    <td align="center">Yes</td>
  </tr>
  </table>
  
  
  <h3>4.2 The "bar" tag</h3>
  
  <p>This tag is similar to the "foo" tag, but it also creates a new scripting
  variable, with a name specified by the <code>id</code> attribute.  In this
  case the scripting variable is a String, but in general a custom tag can
  create zero or more objects of any Java class.  This tag is described in
  Section A.1.2 of the spec.</p>
  
  <table border="1" width="100%">
  <tr>
    <th width="20%">Attribute</th>
    <th width="60%">Description</th>
    <th width="20%">Required</th>
  </tr>
  <tr>
    <td align="center">id</td>
    <td>The name of the scripting variable to be created.  This name
        must conform to the scripting language (normally Java) rules
        for variable names, and must be unique within the page.  If
        not specified, <code>mybar</code> will be the assigned name.</td>
    <td align="center">No</td>
  </tr>
  <tr>
    <td align="center">att1</td>
    <td>The first attribute for this tag.  It can take any string value.</td>
    <td align="center">Yes</td>
  </tr>
  <tr>
    <td align="center">att2</td>
    <td>The second attribute for this tag.  It can take any string value.</td>
    <td align="center">Yes</td>
  </tr>
  <tr>
    <td align="center">att3</td>
    <td>The third attribute for this tag.  It can take any string value.</td>
    <td align="center">Yes</td>
  </tr>
  </table>
  
  
  <h2>5. USAGE EXAMPLES</h2>
  
  See the example application (<code>jspspec/jspspec-examples.war</code>) for
  examples of the usage of the tags from this custom tag library.
  
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-taglibs/xsl/examples/conf/web.xml
  
  Index: web.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
      "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
  
  <web-app>
    
    <description>
    Example web application illustrating the use of tags in the
    "xsl" custom tag library, from the JAKARTA-TAGLIBS project.
    </description>
  
    <taglib>
      <taglib-uri>http://jakarta.apache.org/taglibs/xsl-1.0</taglib-uri>
      <taglib-location>/WEB-INF/xsl.tld</taglib-location>
    </taglib>
  
  </web-app>
  
  
  1.1                  jakarta-taglibs/xsl/examples/web/index.html
  
  Index: index.html
  ===================================================================
  <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
  <html>
  <head>
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     <meta name="GENERATOR" content="Mozilla/4.61 [en] (WinNT; I) [Netscape]">
     <meta name="Author" content="Anil K. Vijendran">
     <title>JSP Examples</title>
  <!--
    Copyright (c) 1999 The Apache Software Foundation.  All rights 
    reserved.
  -->
  </head>
  <body bgcolor="#FFFFFF">
  <b><font face="Arial, Helvetica, sans-serif"><font size=+2>JSP+XML
  Custom Tags Examples</font></font></b>
  <p>This is a collection of JSP custom-tags.
  <p>To navigate your way through the examples, the following icons will
  help:
  <br>&nbsp;
  <table BORDER=0 CELLSPACING=5 WIDTH="85%" >
  <tr VALIGN=TOP>
  <td WIDTH="30"><img SRC="images/execute.gif" ></td>
  
  <td>Execute the example</td>
  </tr>
  
  <tr VALIGN=TOP>
  <td WIDTH="30"><img SRC="images/code.gif" height=24 width=24></td>
  
  <td>Look at the source code for the example</td>
  </tr>
  
  <tr VALIGN=TOP>
  <td WIDTH="30"><img SRC="images/return.gif" height=24 width=24></td>
  
  <td>Return to this screen</td>
  </tr>
  </table>
  
  <br>&nbsp;
  <table BORDER=0 CELLSPACING=5 WIDTH="85%" >
  <tr VALIGN=TOP>
  <td>InsertWithXSL&nbsp;</td>
  
  <td VALIGN=TOP WIDTH="30%"><a href="/xsl-examples/jsp/XslExample.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0  align=TOP></a><a href="/xsl-examples/jsp/XslExample.jsp">Execute</a></td>
  
  <td WIDTH="30%"><a href="/xsl-examples/jsp/ShowSource.jsp?jspFile=/jsp/XslExample.jsp"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="/xsl-examples/jsp/ShowSource.jsp?jspFile=/jsp/XslExample.jsp">JSP </a></td>
  
  <td WIDTH="30%"><a href="/xsl-examples/jsp/ShowSource.jsp?jspFile=/WEB-INF/classes/org/apache/taglibs/xsl/InsertWithXSL.java"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="/xsl-examples/jsp/ShowSource.jsp?jspFile=/WEB-INF/classes/org/apache/taglibs/xsl/InsertWithXSL.java">TagHandler </a></td>
  </tr>
  
  <tr VALIGN=TOP>
  <td>ClearResponse&nbsp;</td>
  
  <td WIDTH="30%"><a href="/xsl-examples/jsp/ShowSource.jsp?jspFile=/WEB-INF/classes/org/apache/taglibs/xsl/ClearResponse.java"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="/xsl-examples/jsp/ShowSource.jsp?jspFile=/WEB-INF/classes/org/apache/taglibs/xsl/ClearResponse.java">TagHandler </a></td>
  </tr>
  
  <tr VALIGN=TOP>
  <td>Return&nbsp;</td>
  
  <td WIDTH="30%"><a href="/xsl-examples/jsp/ShowSource.jsp?jspFile=/WEB-INF/classes/org/apache/taglibs/xsl/Return.java"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="/xsl-examples/jsp/ShowSource.jsp?jspFile=/WEB-INF/classes/org/apache/taglibs/xsl/Return.java">TagHandler </a></td>
  </tr>
  
  </table>
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-taglibs/xsl/examples/web/images/code.gif
  
  	<<Binary file>>
  
  
  1.1                  jakarta-taglibs/xsl/examples/web/images/execute.gif
  
  	<<Binary file>>
  
  
  1.1                  jakarta-taglibs/xsl/examples/web/images/return.gif
  
  	<<Binary file>>
  
  
  1.1                  jakarta-taglibs/xsl/examples/web/jsp/ShowSource.jsp
  
  Index: ShowSource.jsp
  ===================================================================
  <html>
  <!--
    Copyright (c) 1999 The Apache Software Foundation.  All rights
    reserved.
  -->
  <body bgcolor=white>
  <%@ taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0" prefix="util" %>
  <p>
     <util:ShowSource jspFile="<%= request.getParameter(\"jspFile\") %>" />
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-taglibs/xsl/examples/web/jsp/XslExample.jsp
  
  Index: XslExample.jsp
  ===================================================================
  <html>
  <body bgcolor="white">
  
  <%@taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0" prefix="xsl" %>
  
  <xsl:InsertWithXSL url="/xml/foo.xml" xsl="/xml/foo.xsl" />
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-taglibs/xsl/examples/web/xml/foo.xml
  
  Index: foo.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>Hello</doc>
  
  
  1.1                  jakarta-taglibs/xsl/examples/web/xml/foo.xsl
  
  Index: foo.xsl
  ===================================================================
  <?xml version="1.0"?> 
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="doc">
      <out><xsl:value-of select="."/></out>
    </xsl:template>
  </xsl:stylesheet>
  
  
  
  1.1                  jakarta-taglibs/xsl/lib/xalan.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-taglibs/xsl/lib/xerces.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-taglibs/xsl/src/org/apache/taglibs/xsl/ClearResponse.java
  
  Index: ClearResponse.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 acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  package org.apache.taglibs.xsl;
  
  import javax.servlet.jsp.*;
  import javax.servlet.jsp.tagext.*;
  
  /**
   * Author Mandar Raje [mandar@eng.sun.com].
   */
  
  public class ClearResponse extends TagSupport {
  
      public int doStartTag() {
  	return SKIP_BODY;
      }
  
      public int doEndTag() throws JspException {
  	try {
  	    pageContext.getOut().clear();
  	} catch (Exception ex) {
  	    throw new JspException(ex.getMessage());
  	}
  	return EVAL_PAGE;
      }
  
  }
  
  
  
  1.1                  jakarta-taglibs/xsl/src/org/apache/taglibs/xsl/InsertWithXSL.java
  
  Index: InsertWithXSL.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 acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  package org.apache.taglibs.xsl;
  
  import java.io.Writer;
  import java.io.IOException;
  import javax.servlet.*;
  import javax.servlet.jsp.*;
  import javax.servlet.jsp.tagext.*;
  
  /**
   * This tag applies an XSL stylesheet
   * to the XML contents generated by a
   * specific uri.
   *
   * Author Mandar Raje [mandar@eng.sun.com].
   */
  
  public class InsertWithXSL extends TagSupport {
  
      private String xsl;
      private String url;
      ServletContext context;
  
      public void setXsl(String val) {
  	this.xsl = val;
      }
  
      public String getXsl() {
  	return context.getRealPath(this.xsl);
      }
      
      public void setUrl(String val) {
  	this.url = val;
      }
  
      public String getUrl() {
  	return context.getRealPath(this.url);
      }
  
      public int doStartTag() throws JspException {
  	this.context = (ServletContext)
  	    pageContext.findAttribute(pageContext.APPLICATION);
  	if (this.context == null)
  	    throw new JspException ("CONTEXT: not found in a custom tag");
  	return EVAL_BODY_INCLUDE;
      }
  
      public int doEndTag() throws JspException {
  	XSLProcessor xsp = XSLProcessorFactory.getXSLProcessor();
  	xsp.process(getUrl(), getXsl(), pageContext.getOut());
  	return SKIP_BODY;
      }
      
  }
  
  
  
  
  
  
  
  1.1                  jakarta-taglibs/xsl/src/org/apache/taglibs/xsl/Return.java
  
  Index: Return.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 acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  package org.apache.taglibs.xsl;
  
  import javax.servlet.jsp.*;
  import javax.servlet.jsp.tagext.*;
  
  /**
   * Author Mandar Raje [mandar@eng.sun.com].
   */
  
  public class Return extends TagSupport {
  
      public int doStartTag() {
  	return SKIP_BODY;
      }
  
      public int doEndTag() throws JspException {
  	try {
  	    pageContext.getOut().flush();
  	} catch (Exception ex) {
  	    throw new JspException(ex.getMessage());
  	}
  	return SKIP_PAGE;
      }
  
  }
  
  
  
  1.1                  jakarta-taglibs/xsl/src/org/apache/taglibs/xsl/ShowSource.java
  
  Index: ShowSource.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 acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  package org.apache.taglibs.xsl;
  
  
  import javax.servlet.*;
  import javax.servlet.jsp.*;
  import javax.servlet.jsp.tagext.*;
  
  import java.io.*;
  
  /**
   * Display the sources of the JSP file.
   *
   * Author Anil Vijendran.
   */
  
  public class ShowSource
      extends TagSupport
  {
      String jspFile;
      
      public void setJspFile(String jspFile) {
          this.jspFile = jspFile;
      }
  
      public int doEndTag() throws JspException {
          InputStream in
              = pageContext.getServletContext().getResourceAsStream(jspFile);
  
          if (in == null)
              throw new JspTagException("Unable to find JSP file: "+jspFile);
          InputStreamReader reader = new InputStreamReader(in);
          
          JspWriter out = pageContext.getOut();
  
          try {
              out.println("<body>");
              out.println("<pre>");
              for(int ch = in.read(); ch != -1; ch = in.read())
                  if (ch == '<')
                      out.print("&lt;");
                  else
                      out.print((char) ch);
              out.println("</pre>");
              out.println("</body>");
          } catch (IOException ex) {
              throw new JspTagException("IOException: "+ex.toString());
          }
          return super.doEndTag();
      }
  }
  
      
          
      
  
  
  
  1.1                  jakarta-taglibs/xsl/src/org/apache/taglibs/xsl/XSLProcessor.java
  
  Index: XSLProcessor.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 acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  package org.apache.taglibs.xsl;
  
  /**
   * This interface can be implemented by different
   * XSL processors.
   *
   * Author Mandar Raje [mandar@eng.sun.com].
   */
  
  import java.io.Writer;
  import javax.servlet.jsp.JspException;
  
  public interface XSLProcessor {
  
      /* Apply XSL stylesheet to the XML document and store the
       * result in 'out'.
       */
      public void process(String url, String xsl, Writer out)
      throws JspException;
  
      /* More XSL specific methods can be added here .. LATER */
  }
  
  
  
  1.1                  jakarta-taglibs/xsl/src/org/apache/taglibs/xsl/XSLProcessorFactory.java
  
  Index: XSLProcessorFactory.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 acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  package org.apache.taglibs.xsl;
  
  /**
   * XSL processor factory.
   *
   * Author Mandar Raje [mandar@eng.sun.com].
   */
  
  public class XSLProcessorFactory {
  
      public static XSLProcessor getXSLProcessor() {
  	
  	// Other processors can be added at convenience.
  	return new XalanXSLProcessor();
      }
  }
  
  
  
  1.1                  jakarta-taglibs/xsl/src/org/apache/taglibs/xsl/XalanXSLProcessor.java
  
  Index: XalanXSLProcessor.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 acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  package org.apache.taglibs.xsl;
  
  /**
   * Xalan XSL Processor.
   *
   * Author Mandar Raje [mandar@eng.sun.com].
   */
  
  import java.io.Writer;
  import javax.servlet.jsp.JspException;
  import org.xml.sax.SAXException;
  import org.apache.xalan.xslt.XSLTProcessorFactory;
  import org.apache.xalan.xslt.XSLTInputSource;
  import org.apache.xalan.xslt.XSLTResultTarget;
  import org.apache.xalan.xslt.XSLTProcessor;
  
  
  public class XalanXSLProcessor implements XSLProcessor {
  
      public void process(String url, String xsl, Writer out)
      throws JspException {
  
  	try {
  	    // Have the XSLTProcessorFactory obtain a interface to a
  	    // new XSLTProcessor object.
  	    XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
  	    
  	    // Have the XSLTProcessor processor object transform "foo.xml" to
  	    // System.out, using the XSLT instructions found in "foo.xsl".
  	    processor.process(new XSLTInputSource(url),
  			      new XSLTInputSource(xsl),
  			      new XSLTResultTarget(out));
  	} catch(SAXException sexp) {
  	    throw new JspException("SAXParser Exception: " + sexp.getMessage());	    
  	}
      }
  }