You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jy...@apache.org on 2004/10/13 22:33:42 UTC

cvs commit: xml-xalan/java/xdocs/sources/xalan extensions.xml resources.xml

jycli       2004/10/13 13:33:42

  Modified:    java     build.xml
               java/src/org/apache/xalan/extensions
                        ExtensionHandlerGeneral.java
               java/xdocs/sources/xalan extensions.xml resources.xml
  Log:
  Fixed of Bug report XalanJ-1822. Added alternative BSF implementation support for extension functions in languages other than Java
  Patch reviewed by Henry Zongaro (zongaro@ca.ibm.com)
  
  Revision  Changes    Path
  1.210     +2 -8      xml-xalan/java/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/build.xml,v
  retrieving revision 1.209
  retrieving revision 1.210
  diff -u -r1.209 -r1.210
  --- build.xml	13 Oct 2004 13:46:23 -0000	1.209
  +++ build.xml	13 Oct 2004 20:33:42 -0000	1.210
  @@ -74,8 +74,6 @@
     <property name="xmlapis.jar" value="${bin.dir}/${xmlapis.jar.name}"/>
     <property name="parser.jar.name" value="xercesImpl.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"/>
  @@ -172,7 +170,6 @@
     <path id="docs.class.path">
       <pathelement location="${xmlapis.jar}" />
       <pathelement location="${parser.jar}" />
  -    <pathelement location="${bsf.jar}" />
       <pathelement location="${bcel.jar}" />
       <pathelement location="${runtime.jar}" />
       <pathelement location="${stylebook.jar}" />
  @@ -217,7 +214,6 @@
       <!-- xsltc.jar will only be picked up if it has been built -->
       <include name="${dist.file}/bin/xsltc.jar"/>      
       <include name="${dist.file}/bin/${xmlapis.jar.name}"/>
  -    <include name="${dist.file}/bin/${bsf.jar.name}"/>
       <include name="${dist.file}/bin/${parser.jar.name}"/>
       <include name="${dist.file}/bin/xalansamples.jar"/>
       <include name="${dist.file}/bin/xalanservlet.war"/>
  @@ -237,7 +233,6 @@
       <!-- xsltc.jar will only be picked up if it has been built -->
       <include name="${dist.file}/bin/xsltc.jar"/>      
       <include name="${dist.file}/bin/${xmlapis.jar.name}"/>
  -    <include name="${dist.file}/bin/${bsf.jar.name}"/>
       <include name="${dist.file}/bin/${parser.jar.name}"/>
       <include name="${dist.file}/bin/xalansamples.jar"/>
       <include name="${dist.file}/bin/xalanservlet.war"/>
  @@ -254,7 +249,6 @@
       <include name="${dist.file}/bin/ant.jar"/>
       <include name="${dist.file}/bin/${parser.jar.name}"/>
       <include name="${dist.file}/bin/${xmlapis.jar.name}"/>
  -    <include name="${dist.file}/bin/${bsf.jar.name}"/>
       <include name="${dist.file}/bin/${stylebook.jar.name}"/>
       <include name="${dist.file}/bin/${doclet.jar.name}"/>
       <include name="${dist.file}/bin/${taglet.jar.name}"/>
  
  
  
  1.24      +20 -6     xml-xalan/java/src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
  
  Index: ExtensionHandlerGeneral.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- ExtensionHandlerGeneral.java	23 Feb 2004 10:29:34 -0000	1.23
  +++ ExtensionHandlerGeneral.java	13 Oct 2004 20:33:42 -0000	1.24
  @@ -28,6 +28,9 @@
   
   import javax.xml.transform.TransformerException;
   
  +import org.apache.xml.res.XMLErrorResources;
  +import org.apache.xml.res.XMLMessages;
  +
   import org.apache.xalan.res.XSLMessages;
   import org.apache.xalan.res.XSLTErrorResources;
   import org.apache.xalan.templates.ElemTemplateElement;
  @@ -75,13 +78,24 @@
     // static fields
   
     /** BSFManager package name */
  -  private static final String BSF_MANAGER = "com.ibm.bsf.BSFManager";
  -
  -  /** BSFEngine package name */
  -  private static final String BSF_ENGINE = "com.ibm.bsf.BSFEngine";
  -
  +  private static String BSF_MANAGER ;
  +  
  +  /** Default BSFManager name */
  +  private static final String DEFAULT_BSF_MANAGER = "org.apache.bsf.BSFManager";
  +  
  +  /** Property name to load the BSFManager class */
  +  private static final String propName = "org.apache.xalan.extensions.bsf.BSFManager";
  +  
     /** Negative one integer */
     private static final Integer NEG1INT = new Integer(-1);
  +
  +  static{
  +          BSF_MANAGER =  ObjectFactory.lookUpFactoryClassName(propName, null, null);
  + 
  +          if (BSF_MANAGER == null){
  +                  BSF_MANAGER = DEFAULT_BSF_MANAGER;               
  +          }          
  +  }
   
     /**
      * Construct a new extension namespace handler given all the information
  
  
  
  1.26      +21 -50    xml-xalan/java/xdocs/sources/xalan/extensions.xml
  
  Index: extensions.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/extensions.xml,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- extensions.xml	17 Feb 2004 19:25:35 -0000	1.25
  +++ extensions.xml	13 Oct 2004 20:33:42 -0000	1.26
  @@ -70,55 +70,26 @@
      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>
  +   extensions implemented in JavaScript. The set of scripting languages supported using BSF is determined
  +   by the BSF implementation you are using. If you are using Jakarta BSF, please refer to 
  +   <jump href="http://jakarta.apache.org/bsf/index.html">Jakarta BSF Supported Languages</jump> for other
  +   scripting languages with BSF support.</p>
  +<p>BSF requires bsf.jar on the classpath. This JAR file is no longer shipped with &xslt4j;. It can be 
  +   downloaded from <jump href="http://jakarta.apache.org/bsf/index.html">the Apache Jakarta BSF project 
  +   web site</jump>. It 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 at Jakarta BSF web site as <jump href="http://jakarta.apache.org/bsf/projects.html"> 
  +   Related Projects </jump> . These files are available from the sources indicated and are not shipped 
  +   with &xslt4j;. </p>
  +<p>By default Xalan-Java assumes BSF support is provided by the Jakarta BSF implementation. There are three 
  +   ways of specifying the class that provides the BSF Manager service:.</p>
  +<ul><li>Set the system property org.apache.xalan.extensions.bsf.BSFManager;</li>
  +    <li>In the property file "/lib/xalan.properties" in the JRE directory, add the key 
  +    org.apache.xalan.extensions.bsf.BSFManager with the value that is the fully qualified BSF 
  +    implementation class name;</li>
  +    <li>Include a META-INF/services/org.apache.xalan.extensions.bsf.BSFManager 
  +    file in your classpath;</li>
  +</ul>
   </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 
  
  
  
  1.37      +1 -1      xml-xalan/java/xdocs/sources/xalan/resources.xml
  
  Index: resources.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/resources.xml,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- resources.xml	23 Oct 2003 21:21:37 -0000	1.36
  +++ resources.xml	13 Oct 2004 20:33:42 -0000	1.37
  @@ -47,7 +47,7 @@
               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"/>
  +            location="http://jakarta.apache.org/bsf/index.html"/>
   
     <resource id="Readme" 
               title="Xalan Repository Release Notes" 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org