zongaro     2003/03/14 11:34:35

  Modified:    java     Tag: XSLTC_DTM build.xml
               java/bin Tag: XSLTC_DTM xml-apis.jar
               java/src/org/apache/xalan/processor Tag: XSLTC_DTM
                        XSLProcessorVersion.java
               java/src/org/apache/xalan/res Tag: XSLTC_DTM
                        XSLTInfo.properties
               java/src/org/apache/xalan/xslt Tag: XSLTC_DTM
                        EnvironmentCheck.java
               java/src/org/apache/xalan/xsltc/compiler Tag: XSLTC_DTM
                        Import.java Include.java XSLTC.java
               java/src/org/apache/xalan/xsltc/compiler/util Tag: XSLTC_DTM
                        ReferenceType.java
               java/src/org/apache/xalan/xsltc/trax Tag: XSLTC_DTM
                        TemplatesHandlerImpl.java TransformerImpl.java
               java/src/org/apache/xml/dtm Tag: XSLTC_DTM Axis.java
  Log:
  Merging latest changes from the MAIN branch back to the XSLTC_DTM branch.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.176.2.7 +34 -20    xml-xalan/java/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/build.xml,v
  retrieving revision 1.176.2.6
  retrieving revision 1.176.2.7
  diff -u -r1.176.2.6 -r1.176.2.7
  --- build.xml 4 Feb 2003 23:40:05 -0000       1.176.2.6
  +++ build.xml 14 Mar 2003 19:34:32 -0000      1.176.2.7
  @@ -70,8 +70,6 @@
     <!-- 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"/>
  @@ -84,8 +82,8 @@
     
     <!-- Defines general variables used by the other targets; name controls 
output xalan.jar  -->
     <property name="version.VERSION" value="2"/>
  -  <property name="version.RELEASE" value="4"/>
  -  <property name="version.DEVELOPER" value=""/><!-- Set this to 'D' if a 
developer release; blank "" if maintenance release -->
  +  <property name="version.RELEASE" value="5"/>
  +  <property name="version.DEVELOPER" value="D"/><!-- Set this to 'D' if a 
developer release; blank "" if maintenance release -->
     <property name="version.MINOR" value="1"/><!-- EITHER the developer 
release number, or a maintenance release number -->
     <property name="version" 
value="${version.VERSION}_${version.RELEASE}_${version.DEVELOPER}${version.MINOR}"/><!--
 GUMP: version # of dist file -->
     <property name="impl.version" 
value="${version.VERSION}.${version.RELEASE}.${version.DEVELOPER}${version.MINOR}"/><!--
 Used in jar task for filtering MANIFEST.MF file -->
  @@ -96,6 +94,7 @@
     <!-- Relative locations of source directories -->
     <property name="manifest.mf" value="./src/MANIFEST.MF"/>
     <property name="manifest.xsltc.mf" value="./src/manifest.xsltc"/>
  +  <property name="XSLTInfo.props" 
value="./src/org/apache/xalan/res/XSLTInfo.properties"/>  
     <property name="src.dir" value="./src"/>
     <property name="apachexml.reldir" value="org/apache/xml"/>
     <property name="xpath.reldir" value="org/apache/xpath"/>
  @@ -115,6 +114,7 @@
     <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.servlet" value="${build.samples}/servlet"/>
     <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}"/>
  @@ -128,7 +128,7 @@
     <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="build.servlet.war" value="${build.dir}/xalanservlet.war"/>
     <property name="build.xsltc.applet.jar" 
value="${build.dir}/xsltcapplet.jar"/>
     <property name="build.xsltc.brazil.jar" 
value="${build.dir}/xsltcbrazil.jar"/>
     <property name="build.xsltc.ejb.jar" value="${build.dir}/xsltcejb.jar"/>
  @@ -267,8 +267,10 @@
       </javac>
       <!-- Copy needed properties, resource, etc. files to be put into .jar 
file -->
       <copy todir="${build.classes}">
  -      <fileset dir="${src.dir}" 
includes="**/*.properties,**/*.res,META-INF/services/*"/>
  +      <fileset dir="${src.dir}" 
includes="**/*.properties,**/*.res,META-INF/services/*" 
excludes="**/XSLTInfo.properties"/>
       </copy>  
  +    <filter token="impl.version" value="${impl.version}"/>
  +    <copy todir="${build.classes}/org/apache/xalan/res" 
file="${XSLTInfo.props}" filtering="true"/>
     </target>
     
     <!-- Compile all java sources (Xalan interpretive and XSLTC) -->
  @@ -285,7 +287,6 @@
       <pathelement location="${jlex.jar}" />
       <pathelement location="${java_cup.jar}" />
       <pathelement location="${runtime.jar}" />
  -    <pathelement location="${crimson.jar}" />
       <!-- build.classes needed for 
            org.apache.xalan.xsltc.util.JavaCupRedirect -->
       <pathelement location="${build.classes}" />
  @@ -626,22 +627,35 @@
     <!-- must be on the classpath                                            
-->
     <!-- =================================================================== 
-->
    <target name="servlet" depends="jar"
  -    description="Compile and jar the servlet samples" >
  +    description="Compile and jar the servlet samples in xalanservlet.war" >
        <echo message="To compile the sample servlets, javax.servlet and 
javax.servlet.http must be on the classpath"/>   
  -     <mkdir dir="${build.samples}/servlet"/>
  +     <mkdir dir="${build.servlet}"/>
  +     <mkdir dir="${build.servlet}/WEB-INF/classes/servlet"/>
  +     <mkdir dir="${build.servlet}/WEB-INF/lib"/>
        <javac srcdir="${samples.dir}/servlet"
  -            destdir="${build.samples}"
  +            destdir="${build.servlet}/WEB-INF/classes"
               debug="${build.debug}"
               bootclasspathref="xslt.boot.class.path" >
          <classpath refid="samples.class.path" />
        </javac>           
  -      <copy todir="${build.samples}/servlet">
  -        <fileset dir="${samples.dir}/servlet" 
  -          includes="media.properties,default.xsl,default2.xsl"/>
  +      <copy todir="${build.servlet}/WEB-INF/classes/servlet">
  +        <fileset dir="${samples.dir}/servlet" includes="media.properties"/>
         </copy>                         
  -    <jar jarfile="${build.servlet.jar}" 
  -         basedir="${build.samples}" 
  -         includes="servlet/**"/>
  +      <copy todir="${build.servlet}/WEB-INF">
  +        <fileset dir="${samples.dir}/servlet" includes="web.xml"/>
  +      </copy>
  +      <copy todir="${build.servlet}">
  +        <fileset dir="${samples.dir}/servlet" 
  +                     includes="birds.xml, birds.xsl, booklist1.xsl, 
  +                     booklist2.xsl, catalog.xml, fooparam.xml, fooparam.xsl, 
jspSample.jsp"/>
  +      </copy>
  +      <copy todir="${build.servlet}/WEB-INF/lib">
  +             <fileset dir="${bin.dir}" includes="${parser.jar.name}, 
${xmlapis.jar.name}"/>
  +      </copy>
  +      <copy file="${build.xalan.jar}" todir="${build.servlet}/WEB-INF/lib" />
  +    <jar jarfile="${build.servlet.war}" 
  +         basedir="${build.servlet}" 
  +         includes="**"/>
    </target>
    
     <!-- =================================================================== 
-->
  @@ -879,7 +893,7 @@
         <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 file="${build.dir}/xalanservlet.war" todir="${dist.dir}/bin"/>
       <copy file="${build.dir}/xsltcapplet.jar"  todir="${dist.dir}/bin"/>
       <copy file="${build.dir}/xsltcbrazil.jar"  todir="${dist.dir}/bin"/>
       <copy file="${build.dir}/xsltcejb.jar"     todir="${dist.dir}/bin"/>
  @@ -910,7 +924,7 @@
         <include name="${dist.file}/bin/${bsf.jar.name}"/>
         <include name="${dist.file}/bin/xercesImpl.jar"/>
         <include name="${dist.file}/bin/xalansamples.jar"/>
  -      <include name="${dist.file}/bin/xalanservlet.jar"/>
  +      <include name="${dist.file}/bin/xalanservlet.war"/>
         <include name="${dist.file}/bin/xsltcapplet.jar"/>
         <include name="${dist.file}/bin/xsltcbrazil.jar"/>
         <include name="${dist.file}/bin/xsltcejb.jar"/>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.4.3   +212 -216  xml-xalan/java/bin/xml-apis.jar
  
        <<Binary file>>
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.38.2.4  +2 -2      
xml-xalan/java/src/org/apache/xalan/processor/XSLProcessorVersion.java
  
  Index: XSLProcessorVersion.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/XSLProcessorVersion.java,v
  retrieving revision 1.38.2.3
  retrieving revision 1.38.2.4
  diff -u -r1.38.2.3 -r1.38.2.4
  --- XSLProcessorVersion.java  27 Jan 2003 19:43:49 -0000      1.38.2.3
  +++ XSLProcessorVersion.java  14 Mar 2003 19:34:34 -0000      1.38.2.4
  @@ -107,7 +107,7 @@
      *            -  API or behaviour change.
      *            -  its designated as a reference release.
      */
  -  public static int RELEASE = 4;
  +  public static int RELEASE = 5;
   
     /**
      * Maintenance Drop Number.
  @@ -137,7 +137,7 @@
      *          well as defect fixes. 'D' drops may not be as stable as
      *          the final releases.
      */
  -  public static int DEVELOPMENT = 0;
  +  public static int DEVELOPMENT = 1;
     
     /**
      * Version String like <CODE>"<B>Xalan</B> <B>Language</B> 
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.29.4.4  +5 -1      
xml-xalan/java/src/org/apache/xalan/res/XSLTInfo.properties
  
  Index: XSLTInfo.properties
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/res/XSLTInfo.properties,v
  retrieving revision 1.29.4.3
  retrieving revision 1.29.4.4
  diff -u -r1.29.4.3 -r1.29.4.4
  --- XSLTInfo.properties       5 Nov 2002 10:41:33 -0000       1.29.4.3
  +++ XSLTInfo.properties       14 Mar 2003 19:34:34 -0000      1.29.4.4
  @@ -2,9 +2,13 @@
   #  XSLT Resource File
   #
   
  -version=2.4.1
   vendor=Apache Software Foundation
   vendor-url=http://xml.apache.org/xalan-j
  +
  +# Product Version: Xalan-Java @impl.version@
  +
  +# W3C XSL Transformations (XSLT) Version 1.0
  +version=1.0
   
   # The XML Parser for SAX2
   # Since XMLReaderFactory doesn't have it's own properties file, 
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.10.6.6  +10 -5     
xml-xalan/java/src/org/apache/xalan/xslt/EnvironmentCheck.java
  
  Index: EnvironmentCheck.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xslt/EnvironmentCheck.java,v
  retrieving revision 1.10.6.5
  retrieving revision 1.10.6.6
  diff -u -r1.10.6.5 -r1.10.6.6
  --- EnvironmentCheck.java     30 Jan 2003 18:41:35 -0000      1.10.6.5
  +++ EnvironmentCheck.java     14 Mar 2003 19:34:34 -0000      1.10.6.6
  @@ -1264,6 +1264,7 @@
       jarVersions.put(new Long(906248), "xalan.jar from xalan-j_2_3_1");
       jarVersions.put(new Long(983377), "xalan.jar from xalan-j_2_4_D1");    
       jarVersions.put(new Long(997276), "xalan.jar from xalan-j_2_4_0");
  +    jarVersions.put(new Long(1031036), "xalan.jar from xalan-j_2_4_1");    
       
       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");
  @@ -1280,6 +1281,8 @@
       jarVersions.put(new Long(589915), "xsltc.jar from xalan-j_2_3_1");
       jarVersions.put(new Long(1306667), "xsltc.jar from xalan-j_2_4_D1");     
       jarVersions.put(new Long(1328227), "xsltc.jar from xalan-j_2_4_0");
  +    jarVersions.put(new Long(1344009), "xsltc.jar from xalan-j_2_4_1");
  +    jarVersions.put(new Long(1348361), "xsltc.jar from xalan-j_2_5_D1");    
       jarVersions.put(new Long(1268634), "xsltc.jar-bundled from 
xalan-j_2_3_0");
   
       jarVersions.put(new Long(100196), "xml-apis.jar from xalan-j_2_2_0 or 
xalan-j_2_3_D1");
  @@ -1287,6 +1290,7 @@
       jarVersions.put(new Long(109049), "xml-apis.jar from xalan-j_2_4_0 from 
xml-commons RIVERCOURT1 branch");
       jarVersions.put(new Long(109049), "xml-apis.jar from xalan-j_2_4_0, 
lotusxsl-j_2_3_2 or lotusxsl-j_2_3_3 from xml-commons RIVERCOURT1");
       jarVersions.put(new Long(113749), "xml-apis.jar from xalan-j_2_4_1, 
lotusxsl-j_2_3_4 or lotusxsl-j_2_3_5 from factoryfinder-build of xml-commons 
RIVERCOURT1");
  +    jarVersions.put(new Long(124704), "xml-apis.jar from xalan-j_2_5_D1 from 
from tck-jaxp-1_2_0 branch of xml-commons");    
       // 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!");
  @@ -1311,7 +1315,8 @@
       jarVersions.put(new Long(1730053), "xercesImpl.jar from xalan-j_2_3_0 or 
xalan-j_2_3_1 from xerces-2_0_0");
       jarVersions.put(new Long(1728861), "xercesImpl.jar from xalan-j_2_4_D1 
from xerces-2_0_1");    
       jarVersions.put(new Long(972027), "xercesImpl.jar from xalan-j_2_4_0 
from xerces-2_1");
  -    jarVersions.put(new Long(831587), "xercesImpl.jar from xalan-j_2_4_1 
from xerces-2_2");    
  +    jarVersions.put(new Long(831587), "xercesImpl.jar from xalan-j_2_4_1 
from xerces-2_2"); 
  +    jarVersions.put(new Long(891817), "xercesImpl.jar from xalan-j_2_5_D1 
from xerces-2_3");           
       jarVersions.put(new Long(1729063), "xercesImpl.jar from lotusxsl-j_2_3_1 
from XML4J-4_0_0");
       jarVersions.put(new Long(1738551), "xercesImpl.jar from lotusxsl-j_2_3_2 
from XML4J-4_0_2");
       jarVersions.put(new Long(3243826), "xercesImpl.jar from lotusxsl-j_2_3_3 
from XML4J-4_0_5");
  @@ -1327,7 +1332,7 @@
       jarVersions.put(new Long(21453), "xalanservlet.jar from xalan-j_2_0_1");
       jarVersions.put(new Long(24826), "xalanservlet.jar from xalan-j_2_3_1 or 
xalan-j_2_4_1 or lotusxsl-j_2_3_1 to lotusxsl-j-2_3_5");    
       jarVersions.put(new Long(24831), "xalanservlet.jar from xalan-j_2_4_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");
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.14.6.6  +11 -2     
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Import.java
  
  Index: Import.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Import.java,v
  retrieving revision 1.14.6.5
  retrieving revision 1.14.6.6
  diff -u -r1.14.6.5 -r1.14.6.6
  --- Import.java       30 Jan 2003 18:41:37 -0000      1.14.6.5
  +++ Import.java       14 Mar 2003 19:34:34 -0000      1.14.6.6
  @@ -76,6 +76,7 @@
   import org.apache.xalan.xsltc.compiler.util.TypeCheckError;
   
   import org.xml.sax.InputSource;
  +import org.xml.sax.XMLReader;
   
   final class Import extends TopLevelElement {
   
  @@ -100,10 +101,12 @@
            String currLoadedDoc = context.getSystemId();
            SourceLoader loader = context.getSourceLoader();
            InputSource input = null;
  +         XMLReader reader = null;
   
            if (loader != null) {
                final XSLTC xsltc = parser.getXSLTC();
                input = loader.loadSource(docToLoad, currLoadedDoc, xsltc);
  +             reader = xsltc.getXMLReader();
            }
            else {
                File file = new File(currLoadedDoc);
  @@ -121,7 +124,13 @@
                return;
            }
   
  -         SyntaxTreeNode root = parser.parse(input);
  +         final SyntaxTreeNode root;
  +            if (reader != null) {
  +                root = parser.parse(reader,input);
  +            }
  +            else {
  +                root = parser.parse(input);
  +            }
   
            if (root == null) return;
            _imported = parser.makeStylesheet(root);
  
  
  
  1.14.2.6  +13 -2     
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Include.java
  
  Index: Include.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Include.java,v
  retrieving revision 1.14.2.5
  retrieving revision 1.14.2.6
  diff -u -r1.14.2.5 -r1.14.2.6
  --- Include.java      30 Jan 2003 18:41:37 -0000      1.14.2.5
  +++ Include.java      14 Mar 2003 19:34:34 -0000      1.14.2.6
  @@ -75,7 +75,9 @@
   import org.apache.xalan.xsltc.compiler.util.MethodGenerator;
   import org.apache.xalan.xsltc.compiler.util.Type;
   import org.apache.xalan.xsltc.compiler.util.TypeCheckError;
  +
   import org.xml.sax.InputSource;
  +import org.xml.sax.XMLReader;
   
   final class Include extends TopLevelElement {
   
  @@ -100,10 +102,12 @@
            String currLoadedDoc = context.getSystemId();
            SourceLoader loader = context.getSourceLoader();
            InputSource input = null;
  +         XMLReader reader = null;
   
            if (loader != null) {
                final XSLTC xsltc = parser.getXSLTC();
                input = loader.loadSource(docToLoad, currLoadedDoc, xsltc);
  +             reader = xsltc.getXMLReader();
            }
            else {
                // bug 7835, patch by Stefan Kost ([EMAIL PROTECTED])
  @@ -141,7 +145,14 @@
                return;
            }
   
  -         final SyntaxTreeNode root = parser.parse(input);
  +         final SyntaxTreeNode root;
  +            if (reader != null) {
  +                root = parser.parse(reader,input);
  +            }
  +            else {
  +                root = parser.parse(input);
  +            }
  +              
            if (root == null) return;
            _included = parser.makeStylesheet(root);
            if (_included == null) return;
  
  
  
  1.35.6.10 +8 -1      
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XSLTC.java
  
  Index: XSLTC.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XSLTC.java,v
  retrieving revision 1.35.6.9
  retrieving revision 1.35.6.10
  diff -u -r1.35.6.9 -r1.35.6.10
  --- XSLTC.java        3 Mar 2003 15:51:37 -0000       1.35.6.9
  +++ XSLTC.java        14 Mar 2003 19:34:34 -0000      1.35.6.10
  @@ -459,6 +459,13 @@
       public void setXMLReader(XMLReader reader) {
        _reader = reader;
       }
  +    
  +    /**
  +     * Get the XMLReader to use for parsing the next input stylesheet
  +     */
  +    public XMLReader getXMLReader() {
  +     return _reader ;
  +    }
   
       /**
        * Get a Vector containing all compile error messages
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.7.6.6   +54 -43    
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ReferenceType.java
  
  Index: ReferenceType.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ReferenceType.java,v
  retrieving revision 1.7.6.5
  retrieving revision 1.7.6.6
  diff -u -r1.7.6.5 -r1.7.6.6
  --- ReferenceType.java        30 Jan 2003 18:41:44 -0000      1.7.6.5
  +++ ReferenceType.java        14 Mar 2003 19:34:34 -0000      1.7.6.6
  @@ -64,6 +64,7 @@
   
   package org.apache.xalan.xsltc.compiler.util;
   
  +import org.apache.bcel.generic.PUSH;
   import org.apache.bcel.generic.ALOAD;
   import org.apache.bcel.generic.ASTORE;
   import org.apache.bcel.generic.ConstantPoolGen;
  @@ -73,8 +74,12 @@
   import org.apache.bcel.generic.INVOKESTATIC;
   import org.apache.bcel.generic.Instruction;
   import org.apache.bcel.generic.InstructionList;
  +
   import org.apache.xalan.xsltc.compiler.Constants;
   import org.apache.xalan.xsltc.compiler.FlowList;
  +import org.apache.xalan.xsltc.DOM;
  +
  +import org.apache.xml.dtm.DTM;
   
   public final class ReferenceType extends Type {
       protected ReferenceType() {}
  @@ -96,13 +101,13 @@
       }
   
       /**
  -     * Translates a reference to an object of internal type 
<code>type</code>. 
  +     * 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, 
  +    public void translateTo(ClassGenerator classGen, MethodGenerator 
methodGen,
                            Type type) {
        if (type == Type.String) {
            translateTo(classGen, methodGen, (StringType) type);
  @@ -132,20 +137,26 @@
       }
   
       /**
  -     * Translates reference into object of internal type <code>type</code>. 
  +     * 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, 
  +    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));
  +     // If no current, conversion is a top-level
  +     if (current < 0) {
  +         il.append(new PUSH(cpg, DTM.ROOT_NODE));  // push root node
  +     }
  +     else {
  +         il.append(new ILOAD(current));
  +     }
        il.append(methodGen.loadDOM());
        final int stringF = cpg.addMethodref(BASIS_LIBRARY_CLASS,
  -                                          "stringF", 
  +                                          "stringF",
                                             "("
                                             + OBJECT_SIG
                                             + NODE_SIG
  @@ -155,18 +166,18 @@
       }
   
       /**
  -     * Translates a reference into an object of internal type 
<code>type</code>. 
  +     * 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, 
  +    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", 
  -                                  "(" 
  +     int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "numberF",
  +                                  "("
                                     + OBJECT_SIG
                                     + DOM_INTF_SIG
                                     + ")D");
  @@ -174,17 +185,17 @@
       }
   
       /**
  -     * Translates a reference to an object of internal type 
<code>type</code>. 
  +     * 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, 
  +    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", 
  -                                  "(" 
  +     int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "booleanF",
  +                                  "("
                                     + OBJECT_SIG
                                     + ")Z");
        il.append(new INVOKESTATIC(index));
  @@ -195,17 +206,17 @@
        *
        * @see  org.apache.xalan.xsltc.compiler.util.Type#translateTo
        */
  -    public void translateTo(ClassGenerator classGen, MethodGenerator 
methodGen, 
  +    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", 
  +     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));
  @@ -227,11 +238,11 @@
        *
        * @see  org.apache.xalan.xsltc.compiler.util.Type#translateTo
        */
  -    public void translateTo(ClassGenerator classGen, MethodGenerator 
methodGen, 
  +    public void translateTo(ClassGenerator classGen, MethodGenerator 
methodGen,
                            ResultTreeType type) {
        final ConstantPoolGen cpg = classGen.getConstantPool();
        final InstructionList il = methodGen.getInstructionList();
  -     int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, 
"referenceToResultTree", 
  +     int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, 
"referenceToResultTree",
                                     "(" + OBJECT_SIG + ")" + DOM_INTF_SIG);
        il.append(new INVOKESTATIC(index));
       }
  @@ -241,21 +252,21 @@
        *
        * @see  org.apache.xalan.xsltc.compiler.util.Type#translateTo
        */
  -    public void translateTo(ClassGenerator classGen, MethodGenerator 
methodGen, 
  +    public void translateTo(ClassGenerator classGen, MethodGenerator 
methodGen,
                            ObjectType type) {
  -     methodGen.getInstructionList().append(NOP);     
  +     methodGen.getInstructionList().append(NOP);
       }
   
       /**
  -     * Translates a reference into the Java type denoted by 
<code>clazz</code>. 
  +     * Translates a reference into the Java type denoted by 
<code>clazz</code>.
        */
  -    public void translateTo(ClassGenerator classGen, MethodGenerator 
methodGen, 
  +    public void translateTo(ClassGenerator classGen, MethodGenerator 
methodGen,
                            Class clazz) {
        final ConstantPoolGen cpg = classGen.getConstantPool();
        final InstructionList il = methodGen.getInstructionList();
  -     
  +
        if (clazz.getName().equals("java.lang.Object")) {
  -         il.append(NOP);     
  +         il.append(NOP);
        }
        else if (clazz == Double.TYPE) {
            translateTo(classGen, methodGen, Type.Real);
  @@ -264,20 +275,20 @@
            translateTo(classGen, methodGen, Type.String);
        }
        else if (clazz.getName().equals("org.w3c.dom.Node")) {
  -         int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, 
"referenceToNode", 
  -                                      "(" 
  -                                      + OBJECT_SIG 
  -                                      + DOM_INTF_SIG 
  +         int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "referenceToNode",
  +                                      "("
  +                                      + OBJECT_SIG
  +                                      + DOM_INTF_SIG
                                         + ")"
                                         + "Lorg/w3c/dom/Node;");
            il.append(methodGen.loadDOM());
            il.append(new INVOKESTATIC(index));
        }
        else if (clazz.getName().equals("org.w3c.dom.NodeList")) {
  -         int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, 
"referenceToNodeList", 
  -                                      "(" 
  -                                      + OBJECT_SIG 
  -                                      + DOM_INTF_SIG 
  +         int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, 
"referenceToNodeList",
  +                                      "("
  +                                      + OBJECT_SIG
  +                                      + DOM_INTF_SIG
                                         + ")"
                                         + "Lorg/w3c/dom/NodeList;");
            il.append(methodGen.loadDOM());
  @@ -297,27 +308,27 @@
        * Translates an external Java type into a reference. Only conversion
        * allowed is from java.lang.Object.
        */
  -    public void translateFrom(ClassGenerator classGen, MethodGenerator 
methodGen, 
  +    public void translateFrom(ClassGenerator classGen, MethodGenerator 
methodGen,
                              Class clazz) {
        if (clazz.getName().equals("java.lang.Object")) {
  -         methodGen.getInstructionList().append(NOP); 
  +         methodGen.getInstructionList().append(NOP);
        }
        else {
            ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
                                toString(), clazz.getName());
            classGen.getParser().reportError(Constants.FATAL, err);
  -        } 
  +        }
       }
   
       /**
        * 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 
  +     * 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, 
  +    public FlowList translateToDesynthesized(ClassGenerator classGen,
  +                                          MethodGenerator methodGen,
                                             BooleanType type) {
        InstructionList il = methodGen.getInstructionList();
        translateTo(classGen, methodGen, type);
  @@ -326,14 +337,14 @@
   
       /**
        * 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) {
       }
  @@ -342,7 +353,7 @@
       public Instruction LOAD(int slot) {
        return new ALOAD(slot);
       }
  -     
  +
       public Instruction STORE(int slot) {
        return new ASTORE(slot);
       }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.8   +13 -9     
xml-xalan/java/src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
  
  Index: TemplatesHandlerImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java,v
  retrieving revision 1.5.2.7
  retrieving revision 1.5.2.8
  diff -u -r1.5.2.7 -r1.5.2.8
  --- TemplatesHandlerImpl.java 10 Mar 2003 18:58:44 -0000      1.5.2.7
  +++ TemplatesHandlerImpl.java 14 Mar 2003 19:34:35 -0000      1.5.2.8
  @@ -82,8 +82,8 @@
   /**
    * Implementation of a JAXP1.1 TemplatesHandler
    */
  -public class TemplatesHandlerImpl extends Parser 
  -    implements TemplatesHandler, SourceLoader 
  +public class TemplatesHandlerImpl extends Parser
  +    implements TemplatesHandler, SourceLoader
   {
       /**
        * System ID for this stylesheet.
  @@ -109,8 +109,8 @@
       /**
        * Default constructor
        */
  -    protected TemplatesHandlerImpl(int indentNumber, 
  -     TransformerFactoryImpl tfactory) 
  +    protected TemplatesHandlerImpl(int indentNumber,
  +     TransformerFactoryImpl tfactory)
       {
        super(null);
        _indentNumber = indentNumber;
  @@ -210,15 +210,19 @@
            if (!errorsFound() && stylesheet != null) {
                stylesheet.setMultiDocument(xsltc.isMultiDocument());
                stylesheet.setHasIdCall(xsltc.hasIdCall());
  -             stylesheet.translate();
  +
  +                // Class synchronization is needed for BCEL
  +                synchronized (xsltc.getClass()) {
  +                    stylesheet.translate();
  +                }
            }
   
            if (!errorsFound()) {
                // Check that the transformation went well before returning
                final byte[][] bytecodes = xsltc.getBytecodes();
                if (bytecodes != null) {
  -                 final TemplatesImpl templates = 
  -                     new TemplatesImpl(xsltc.getBytecodes(), transletName, 
  +                 final TemplatesImpl templates =
  +                     new TemplatesImpl(xsltc.getBytecodes(), transletName,
                            getOutputProperties(), _indentNumber, _tfactory);
   
                    // Set URIResolver on templates object
  @@ -238,7 +242,7 @@
       /**
        * Recieve an object for locating the origin of SAX document events.
        * Most SAX parsers will use this method to inform content handler
  -     * of the location of the parsed document. 
  +     * of the location of the parsed document.
        */
       public void setDocumentLocator(Locator locator) {
        super.setDocumentLocator(locator);
  
  
  
  1.37.2.19 +4 -2      
xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerImpl.java
  
  Index: TransformerImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerImpl.java,v
  retrieving revision 1.37.2.18
  retrieving revision 1.37.2.19
  diff -u -r1.37.2.18 -r1.37.2.19
  --- TransformerImpl.java      3 Mar 2003 15:51:41 -0000       1.37.2.18
  +++ TransformerImpl.java      14 Mar 2003 19:34:35 -0000      1.37.2.19
  @@ -695,8 +695,10 @@
               throw new IllegalArgumentException(err.toString());
        }
           _errorListener = listener;
  +        
        // Register a message handler to report xsl:messages
  -     _translet.setMessageHandler(new MessageHandler(_errorListener));
  +    if (_translet != null)
  +     _translet.setMessageHandler(new MessageHandler(_errorListener));
       }
   
       /**
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.14.2  +1 -0      xml-xalan/java/src/org/apache/xml/dtm/Axis.java
  
  Index: Axis.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/Axis.java,v
  retrieving revision 1.2.14.1
  retrieving revision 1.2.14.2
  diff -u -r1.2.14.1 -r1.2.14.2
  --- Axis.java 27 Jan 2003 19:45:27 -0000      1.2.14.1
  +++ Axis.java 14 Mar 2003 19:34:35 -0000      1.2.14.2
  @@ -61,6 +61,7 @@
    * <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
   {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to