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 gl...@apache.org on 2002/04/06 17:32:26 UTC

cvs commit: jakarta-taglibs/xsl/examples/web/jsp Apply.jsp ShowSource.jsp

glenn       02/04/06 07:32:26

  Modified:    xsl      build.xml
               xsl/examples/web index.html
               xsl/examples/web/jsp Apply.jsp ShowSource.jsp
  Added:       xsl/xml  xsl.xml
  Log:
  The taglib docs were not in sync with the taglib.
  Converted over to the new build system and updated the docs.
  Added documentation that Xalan 1 is required and a recommendation
  to use XTAGS or Standard taglibs instead.
  
  Revision  Changes    Path
  1.1                  jakarta-taglibs/xsl/xml/xsl.xml
  
  Index: xsl.xml
  ===================================================================
  <?xml version="1.0" ?>
  
  <!-- Change all instances of page with the jakarta-taglib
       name for this tag library.
  
       Change all instances of Page with the name to use
       for things such as titles in the tag library documentation.
  
       Change all instances of {your-name} with your name for
       for things such as author name in the tag library documentation.
  
       Change <prefix>foo</prefix> below to a short prefix for this
       tag library.
       -->
  
  <document url="./xsl.xml">
  
  <!-- More properties can be added.  Good place to stick loose
       data needed elsewhere. -->
  <properties>
    <!-- The title here overrides the title generated by the
         stylesheet for the documentation HTML <title> tag
    <title>Jakarta Project: XSL JSP Tag Library</title>
         -->
    <!-- The name here is used in the HTML <meta name="author"...> tag -->
    <author>Glenn Nielsen</author>
  </properties>
  
  <!-- The following defines elements uses both to create the taglib
       documentation and the tag library descriptor .tld file.  The
       elements used are those from the JSP 1.2 TLD DTD and special
       elements used when creating the tagib documentation.  Although
       the JSP1.2 TLD DTD is used, this document can be used to
       generate both a JSP 1.1 and a JSP 1.2 TLD.
       -->
  
  <taglib>
  
    <!-- Basic library information -->
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.1</jsp-version>
    <short-name>xsl</short-name>
    <uri>http://jakarta.apache.org/taglibs/xsl-1.0</uri>
    <display-name>Simple XSL Tag Library (Beta 1)</display-name>
  
    <description>
      <p>A simple tag library for transforming XML input sources
      with XSL stylesheets</p>
      <p>This tag library uses version 1 of both the Xerces XML parser
       and the Xalan XSLT processor. For production use we recommend
       you use the XTAGS tag library or the Standard tag library.
       Both of these use TRAX API compatible XSLT processors such
       as Xalan 2 and have more features.</p>
    </description>
  
    <!-- The taglib-location is used to fill in the web.xml configuration
         information in the HTML doc. -->
    <taglib-location>/WEB-INF/xsl.tld</taglib-location>
  
    <!-- The prefix is used to fill in the taglib directive
         configuration information in the HTML doc. -->
    <prefix>xsl</prefix>
  
    <!-- This element must be straight text and is copied right into
         the "Requirements" section of the HTML doc. -->
    <requirements-info>
      <P>This custom tag library requires a servlet container that
       supports the JavaServer Pages Specification, version 1.1.
      </P>
      <p>This custom tag library also requires the Xerces 1 XML parser
        and the Xalan 1 XSLT processor.</p>
    </requirements-info>
  
    <tagtoc name="XSL Tags">
  
      <!-- Apply XSL Transformations Tag -->
      <tag>
        <name>apply</name>
        <tag-class>org.apache.taglibs.xsl.ApplyTag</tag-class>
        <body-content>JSP</body-content>
        <display-name>apply</display-name>
    
        <description>
          Apply the specified stylesheet to the specified XML input, both of
          which may be acquired in a variety of manners depending upon
          the optional attributes that are included.
        </description>
    
        <summary>Apply an XSL transformation on an XML source</summary>
        <availability>1.0</availability>                  
        <restrictions>
          Valid attribute combinations to select the XML data source are:
          <ul>
          <li>nameXml - The named bean defines the data source.</li>
          <li>nameXml and propertyXml - The named property of the named bean defines the data source.</li>
          <li>xml - The named resource is read (with getResourceAsStream()) to provide the data source.</li>
          <li>(none) - The body of this tag is interpreted as the XML data source.</li>
          </ul>
          Valid attribute combinations to select the XSL stylesheet source are:
          <ul>
          <li>nameXsl - The named bean defines the stylesheet source.</li>
          <li>nameXsl and propertyXsl - The named property of the named bean defines the data source.</li>
          <li>xsl - The named resource is read (with getResourceAsStream()) to provide the data source.</li>
          </ul>
        </restrictions>
    
        <attribute>
          <name>nameXml</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
          <description>               
            Name of a bean (in any scope) that defines the
            source of the XML data to be transformed.  This
            bean must be of one of the following Java classes:
            <ul>
            <li>String (containing the XML data itself)</li>
            <li>InputSource (SAX input source containing the data)</li>
            <li>InputStream (byte stream containing the data)</li>
            <li>Node (DOM tree containing the data</li>
            <li>Reader (character stream containing the data)</li>
            <li>XSLTInputSource (from which the data is read)</li>
            </ul>
          </description>                 
          <availability>1.0</availability>
        </attribute>
        <attribute>
          <name>nameXsl</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
          <description>
            Name of a bean (in any scope) that defines the
            source of the XSL stylesheet to be used.  This
            bean must be of one of the following Java classes:
            <ul>
            <li>String (containing the stylesheet itself)</li>
            <li>InputSource (SAX input source containing the stylesheet)</li>
            <li>InputStream (byte stream containing the stylesheet)</li>
            <li>Node (DOM tree containing the stylesheet)</li>
            <li>Reader (character stream containing the stylesheet)</li>
            <li>XSLTInputSource (from which the stylesheet is read)</li>
            </ul>
          </description>                                                  
          <availability>1.0</availability>
        </attribute>
        <attribute>
          <name>propertyXml</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
          <description>
            If specified, the bean identified by "nameXml"
            is assumed to have a property whose getter method
            is called to define the XML data source, instead
            of interpreting that bean itself.
          </description>                                                  
          <availability>1.0</availability>
        </attribute>
        <attribute>
          <name>propertyXsl</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
          <description>
            If specified, the bean identified by "nameXsl"
            is assumed to have a property whose getter method
            is called to define the XSL stylesheet source, instead
            of interpreting that bean itself
          </description>                                                     
          <availability>1.0</availability>
        </attribute>
        <attribute>
          <name>xml</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
          <description>
            If specified, the context-relative path to an
            application resource containing the XML data.
          </description>                                                           
          <availability>1.0</availability>
        </attribute>
        <attribute>
          <name>xsl</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
          <description>
            If specified, the context-relative path to an
            application resource containing the XSL stylesheet.
          </description>
          <availability>1.0</availability>
        </attribute>
      </tag>
    
    
      <!-- Export Tag -->
      <tag>
        <name>export</name>
        <tag-class>org.apache.taglibs.xsl.ExportTag</tag-class>
        <body-content>empty</body-content>
        <display-name>export</display-name>
    
        <description>
          Export the contents of the specified JSP bean in the specified scope
          to our output stream, presumably after its contents have been
          manipulated.
        </description>
        <summary>Export the content of a JSP Bean to the output.</summary>
        <availability>1.0</availability>
        <restrictions>None</restrictions>
  
        <attribute>
          <name>name</name>
          <required>true</required>
          <rtexprvalue>false</rtexprvalue>
          <description>
            Name of a JSP bean whose content is to be
            rendered to our output stream.
          </description>                 
          <availability>1.0</availability>
        </attribute>
        <attribute>
          <name>scope</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
          <description>
            Scope in which this bean is registered.  If not
            specified, page scope is assumed.
          </description>
          <availability>1.0</availability>
        </attribute>
      </tag>
    
    
      <!-- Import Tag -->
      <tag>
        <name>import</name>
        <tag-class>org.apache.taglibs.xsl.ImportTag</tag-class>
        <tei-class>org.apache.taglibs.xsl.ImportTei</tei-class>
        <body-content>empty</body-content>
        <display-name>import</display-name>
  
        <description>
          Import the contents of the specified page, and store it as a String
          in the specified bean and scope.  This tag is useful for assigning the
          content of XML data (or an XSL stylesheet) to a bean that can later be
          manipulated with the "apply" tag.
        </description>
  
        <summary>Import the contents of the specified page and store it as a String
          in the specified bean and scope.</summary>
        <availability>1.0</availability>
        <restrictions>None</restrictions>
  
        <attribute>
          <name>id</name>
          <required>true</required>
          <rtexprvalue>false</rtexprvalue>
          <description>
            Name of a JSP bean to be created containing the
            contents of the specified page as a String.
          </description>
          <availability>1.0</availability>
        </attribute>
        <attribute>
          <name>page</name>
          <required>true</required>
          <rtexprvalue>false</rtexprvalue>
          <description>
            Context-relative URI of the page (or servlet) to
            be executed, and whose output should be imported
          </description>
          <availability>1.0</availability>
        </attribute>
        <attribute>
          <name>scope</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
          <description>
            Scope in which the bean specified by "id" will be
            created (page, request, session, application).  If
            not specified, page scope is assumed.
          </description>
          <availability>1.0</availability>
        </attribute>
      </tag>
  
  
      <!-- Include Tag -->
      <tag>
        <name>include</name>
        <tag-class>org.apache.taglibs.xsl.IncludeTag</tag-class>
        <body-content>empty</body-content>
        <display-name>include</display-name>
  
        <description>
          Include the contents of the specified page.  This tag is similar to
          &lt;jsp:include&gt;, but causes the included contents to be rendered to
          our JspWriter (and thus to the body content of any enclosing tag)
          rather than being sent directly to the output stream.
        </description>
    
        <summary>Include the contents of the specified page.</summary>
        <availability>1.0</availability>
        <restrictions>None</restrictions>
  
        <attribute>
          <name>page</name>
          <required>true</required>
          <rtexprvalue>false</rtexprvalue>
          <description>
            Context-relative URI of the page (or servlet) to
            be executed, and whose output should be included
            at this point.
          </description>
          <availability>1.0</availability>
        </attribute>
      </tag>
  
  
      <!-- This tag doesn't really belong here -->
      <tag>
        <name>ShowSource</name>
        <tag-class>org.apache.taglibs.xsl.ShowSource</tag-class>
        <body-content>empty</body-content>                     
        <display-name>ShowSource</display-name>
  
        <description>Convenience tag to show JSP Source.</description>
  
        <summary>Convenience tag to show JSP Source.</summary>
        <availability>1.0</availability>                             
        <restrictions>None</restrictions>
  
        <attribute>
           <name>jspFile</name>
           <required>true</required>
           <rtexprvalue>true</rtexprvalue>
          <description>
            Web application context relative JSP file to show source for.
          </description>
          <availability>1.0</availability>
        </attribute>
      </tag>
  
    </tagtoc>
  
  </taglib>
  
  </document>
  
  
  
  1.12      +28 -182   jakarta-taglibs/xsl/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/xsl/build.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- build.xml	2 Apr 2002 13:01:46 -0000	1.11
  +++ build.xml	6 Apr 2002 15:32:26 -0000	1.12
  @@ -1,198 +1,44 @@
  -<!-- ANT Build Script for the "xsl" Custom Tag Library -->
  -<!-- $Id: build.xml,v 1.11 2002/04/02 13:01:46 glenn Exp $ -->
  -<project name="xsl" default="main" basedir=".">
  +<?xml version="1.0"?>
   
  -    <!-- ******************** Adjustable Properties *********************** -->
  +<!-- Define and use the common.xml ant build file for building
  +     your taglib -->
   
  -    <!--
  +<!DOCTYPE project [
  +    <!ENTITY common SYSTEM "file:../common.xml">
  +]>
   
  -        The following property values should be examined and customized
  -	for each custom tag library subproject.
  +<!-- Your main ant build declaration -->
   
  -        taglib.name		    Base name of this tag library subproject.
  +<project name="xsl" default="main">
   
  -    -->
  +  <property file="../build.properties"/>
  +  <property name="classpath" value="${servlet.jar}:${xalan1.jar}:${xerces1.jar}"/>
   
  -    <property file="../build.properties"/>
  -    <property name="taglib.name"    value="xsl"/>
  +  <property name="checkRequirements.pre" value="checkRequirements.pre"/>
  +  <property name="examples.pre" value="examples.pre"/>
   
  -
  -    <!-- ****************** 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
  -        taglibs.xsl                 Taglibs stylesheet
  -
  -    -->
  -
  -    <property name="taglibs.xsl"    value="../src/doc/stylesheets/taglibs.xsl"/>
  -
  -
  -    <!-- *********************** 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"/>
  -
  -
  -    <!-- ********************* 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}/${taglib.name}-doc"/>
  -    <property name="build.examples" value="${build.dir}/${taglib.name}/${taglib.name}-examples"/>
  -    <property name="build.library"  value="${build.dir}/${taglib.name}/${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"/>
  -    <property name="taglibs.doc"    value="${dist.dir}/doc/doc/${taglib.name}-doc"/>
  -
  -
  -  <!-- ********************** 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">
  -    <copy todir="${build.doc}/WEB-INF">
  -      <fileset dir="${doc.src}/conf"/>
  -    </copy>
  -    <!-- intro.xml isn't part of the documentation application,
  -         this is just a handy place to build it for the web site. -->
  -    <style in="xml/intro.xml"
  -           destdir="${build.doc}"
  -           out="${build.doc}/intro.html"
  -           style="${taglibs.xsl}">
  -      <param name="prefix" expression="../../"/>
  -    </style>
  -    <copy todir="${build.doc}">
  -      <fileset dir="${doc.src}/web">
  -        <include name="**/*.html"/>
  -      </fileset>
  -    </copy>
  +  <target name="checkRequirements.pre">
  +    <antcall target="checkRequiredFile">
  +       <param name="file" value="${xalan1.jar}"/>
  +       <param name="fail.message" value="a jar file containing the Xalan 1 classes is required to compile the XSL taglib. Please define the property xalan1.jar in your build.properties file and ensure that t he file exists"/>
  +    </antcall>
  +    <antcall target="checkRequiredFile">
  +       <param name="file" value="${xerces1.jar}"/>
  +       <param name="fail.message" value="a jar file containing the Xerces 1 classes is required to compile the XSL taglib. Please define the property xerces1.jar in your build.properties file and ensure that t he file exists"/>
  +    </antcall>
     </target>
   
  -  <!-- Compile the examples application -->
  -  <target name="examples" depends="library-dist">
  +  <target name="examples.pre">
  +    <copy file="${xalan1.jar}"
  +          todir="${build.examples}/WEB-INF/lib"/>
  +    <copy file="${xerces1.jar}"
  +          todir="${build.examples}/WEB-INF/lib"/>
       <copy todir="${build.examples}/WEB-INF/classes">
         <fileset dir="${library.src}"/>
       </copy>
  -    <copy todir="${build.examples}/WEB-INF">
  -      <fileset dir="${examples.src}/conf"/>
  -    </copy>
  -    <copy todir="${build.examples}">
  -      <fileset dir="${examples.src}/web"/>
  -    </copy>
  -    <copy file="${dist.tld}"
  -              tofile="${build.examples}/WEB-INF/${taglib.name}.tld"/>
  -    <copy file="${dist.library}"
  -              tofile="${build.examples}/WEB-INF/lib/${taglib.name}.jar"/>
  -    <copy file="${xerces1.jar}"
  -              tofile="${build.examples}/WEB-INF/lib/xerces.jar"/>
  -    <copy file="${xalan1.jar}"
  -              tofile="${build.examples}/WEB-INF/lib/xalan.jar"/>
  -  </target>
  -
  -  <!-- Compile the tag library itself -->
  -  <target name="library" depends="prepare">
  -    <copy file="${conf.src}/taglib.tld"
  -              tofile="${build.library}/META-INF/taglib.tld"/>
  -    <javac srcdir="${library.src}" destdir="${build.library}"
  -           classpath="${servlet.jar};${xalan1.jar};${xerces1.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}" excludes="intro.html"/>
  -    <mkdir dir="${taglibs.doc}"/>
  -    <copy todir="${taglibs.doc}">
  -      <fileset dir="${build.doc}">
  -        <exclude name="WEB-INF/**"/>
  -      </fileset>
  -    </copy>
     </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}"/>
  -    <copy file="${conf.src}/taglib.tld" tofile="${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">
  -    <delete dir="${build.dir}/${taglib.name}"/>
  -    <delete dir="${dist.dir}/${taglib.name}"/>
  -  </target>
  +  <!-- Include the common.xml ant build declarations -->
  +  &common;
   
   </project>
  
  
  
  1.3       +1 -1      jakarta-taglibs/xsl/examples/web/index.html
  
  Index: index.html
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/xsl/examples/web/index.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- index.html	3 Jul 2000 19:29:17 -0000	1.2
  +++ index.html	6 Apr 2002 15:32:26 -0000	1.3
  @@ -10,7 +10,7 @@
   
   <p>This library contains a collection of JSP custom tags that are useful
   in manipulating XML data content using XSL stylesheets.  In order to execute
  -these tags, you must have downloaded the Xalan distribution from
  +these tags, you must have downloaded the Xalan 1 distribution from
   <a href="http://xml.apache.org">http://xml.apache.org</a>, and have installed
   the <code>xalan.jar</code> and <code>xerces.jar</code> files into your
   application's <code>/WEB-INF/lib</code> directory.</p>
  
  
  
  1.2       +2 -0      jakarta-taglibs/xsl/examples/web/jsp/Apply.jsp
  
  Index: Apply.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/xsl/examples/web/jsp/Apply.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Apply.jsp	3 Jul 2000 19:29:25 -0000	1.1
  +++ Apply.jsp	6 Apr 2002 15:32:26 -0000	1.2
  @@ -1,3 +1,4 @@
  +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
   <%@taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0" prefix="xsl" %>
   
   <html>
  @@ -62,3 +63,4 @@
   <xsl:apply nameXml="data" xsl="/xml/employeeList.xsl"/>
   
   </body>
  +</html>
  
  
  
  1.2       +1 -0      jakarta-taglibs/xsl/examples/web/jsp/ShowSource.jsp
  
  Index: ShowSource.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/xsl/examples/web/jsp/ShowSource.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ShowSource.jsp	13 May 2000 20:29:48 -0000	1.1
  +++ ShowSource.jsp	6 Apr 2002 15:32:26 -0000	1.2
  @@ -1,3 +1,4 @@
  +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
   <html>
   <!--
     Copyright (c) 1999 The Apache Software Foundation.  All rights
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>