You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by pa...@apache.org on 2002/08/14 21:21:47 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/util IntegerArray.java JavaCupRedirect.java

pauldick    2002/08/14 12:21:47

  Modified:    java/src/org/apache/xalan/extensions Tag: xalan3
                        ExpressionContext.java
                        ExtensionHandlerJavaClass.java MethodResolver.java
                        XSLProcessorContext.java
               java/src/org/apache/xalan/lib Tag: xalan3 ExsltCommon.java
                        ExsltDatetime.java ExsltMath.java ExsltSets.java
                        Extensions.java Redirect.java
               java/src/org/apache/xalan/lib/sql Tag: xalan3
                        XConnection.java
               java/src/org/apache/xalan/processor Tag: xalan3
                        ProcessorInclude.java ProcessorKey.java
                        ProcessorLRE.java ProcessorOutputElem.java
                        ProcessorStylesheetElement.java
                        ProcessorTemplateElem.java StylesheetHandler.java
                        XSLTAttributeDef.java XSLTElementProcessor.java
                        XSLTSchema.java
               java/src/org/apache/xalan/res Tag: xalan3
                        XSLTErrorResources.java
                        XSLTErrorResources.properties
               java/src/org/apache/xalan/serialize Tag: xalan3
                        Encodings.java HTMLEntities.res
                        SerializerToXML.java XMLEntities.res
               java/src/org/apache/xalan/templates Tag: xalan3 AVT.java
                        AVTPart.java AVTPartSimple.java AVTPartXPath.java
                        Constants.java ElemApplyTemplates.java
                        ElemAttribute.java ElemCopyOf.java ElemElement.java
                        ElemForEach.java ElemIf.java ElemLiteralResult.java
                        ElemNumber.java ElemPI.java ElemSort.java
                        ElemTemplate.java ElemTemplateElement.java
                        ElemValueOf.java ElemVariable.java ElemWhen.java
                        ElemWithParam.java FuncDocument.java FuncKey.java
                        KeyDeclaration.java OutputProperties.java
                        RedundentExprEliminator.java Stylesheet.java
                        StylesheetRoot.java TemplateList.java
                        XUnresolvedVariable.java
                        XUnresolvedVariableSimple.java
               java/src/org/apache/xalan/transformer Tag: xalan3
                        NodeSorter.java ResultTreeHandler.java
                        TransformSnapshotImpl.java TransformerImpl.java
                        TreeWalker2Result.java
               java/src/org/apache/xalan/xslt Tag: xalan3
                        EnvironmentCheck.java
               java/src/org/apache/xalan/xsltc Tag: xalan3 DOM.java
                        DOMCache.java NodeIterator.java
                        ProcessorVersion.java StripFilter.java
                        Translet.java TransletException.java
                        TransletOutputHandler.java
               java/src/org/apache/xalan/xsltc/cmdline Tag: xalan3
                        Compile.java Transform.java
               java/src/org/apache/xalan/xsltc/cmdline/getopt Tag: xalan3
                        GetOpt.java GetOptsException.java
                        IllegalArgumentException.java
                        MissingOptArgException.java
               java/src/org/apache/xalan/xsltc/compiler Tag: xalan3
                        AbsoluteLocationPath.java AbsolutePathPattern.java
                        AlternativePattern.java AncestorPattern.java
                        ApplyImports.java ApplyTemplates.java
                        ArgumentList.java Attribute.java AttributeSet.java
                        AttributeValue.java AttributeValueTemplate.java
                        BinOpExpr.java BooleanCall.java BooleanExpr.java
                        CallTemplate.java CastExpr.java CeilingCall.java
                        Choose.java Comment.java CompilerException.java
                        ConcatCall.java Constants.java ContainsCall.java
                        Copy.java CopyOf.java CurrentCall.java
                        DecimalFormatting.java DocumentCall.java
                        ElementAvailableCall.java EqualityExpr.java
                        Expression.java Fallback.java FilterExpr.java
                        FilterParentPath.java
                        FilteredAbsoluteLocationPath.java FloorCall.java
                        FlowList.java ForEach.java FormatNumberCall.java
                        FunctionAvailableCall.java FunctionCall.java
                        GenerateIdCall.java IdKeyPattern.java
                        IdPattern.java If.java IllegalCharException.java
                        Import.java Include.java Instruction.java
                        IntExpr.java Key.java KeyCall.java KeyPattern.java
                        LangCall.java LastCall.java LiteralAttribute.java
                        LiteralElement.java LiteralExpr.java
                        LocalNameCall.java LocationPathPattern.java
                        LogicalExpr.java Message.java Mode.java
                        NameBase.java NameCall.java NamespaceAlias.java
                        NamespaceUriCall.java NodeTest.java NotCall.java
                        Number.java NumberCall.java Otherwise.java
                        Output.java Param.java ParameterRef.java
                        ParentLocationPath.java ParentPattern.java
                        Parser.java Pattern.java PositionCall.java
                        PositionCall.java.inuse Predicate.java
                        ProcessingInstruction.java
                        ProcessingInstructionPattern.java QName.java
                        RealExpr.java RelationalExpr.java
                        RelativeLocationPath.java RelativePathPattern.java
                        RoundCall.java SimpleAttributeValue.java Sort.java
                        SourceLoader.java StartsWithCall.java Step.java
                        StepPattern.java StringCall.java
                        StringLengthCall.java Stylesheet.java
                        SymbolTable.java SyntaxTreeNode.java Template.java
                        TestSeq.java Text.java TopLevelElement.java
                        TransletOutput.java UnaryOpExpr.java
                        UnionPathExpr.java UnparsedEntityUriCall.java
                        UnresolvedRef.java UnsupportedElement.java
                        UseAttributeSets.java ValueOf.java Variable.java
                        VariableBase.java VariableRef.java
                        VariableRefBase.java When.java Whitespace.java
                        WithParam.java XSLTC.java XslAttribute.java
                        XslElement.java xpath.cup xpath.lex
               java/src/org/apache/xalan/xsltc/compiler/util Tag: xalan3
                        AttributeSetMethodGenerator.java BooleanType.java
                        ClassGenerator.java CompareGenerator.java
                        ErrorMessages.java ErrorMessages_no.java
                        ErrorMsg.java FilterGenerator.java IntType.java
                        MatchGenerator.java MethodGenerator.java
                        MethodType.java MultiHashtable.java
                        NamedMethodGenerator.java NodeCounterGenerator.java
                        NodeSetType.java NodeSortRecordGenerator.java
                        NodeType.java NumberType.java RealType.java
                        ReferenceType.java ResultTreeType.java
                        RtMethodGenerator.java SlotAllocator.java
                        StringStack.java StringType.java TestGenerator.java
                        Type.java TypeCheckError.java Util.java
                        VoidType.java
               java/src/org/apache/xalan/xsltc/dom Tag: xalan3
                        AbsoluteIterator.java AnyNodeCounter.java Axis.java
                        BitArray.java CurrentNodeListFilter.java
                        CurrentNodeListIterator.java DOM.java.Palm
                        DOMAdapter.java DOMBuilder.java DOMImpl.java
                        DTDMonitor.java DocumentCache.java
                        DupFilterIterator.java EmptyFilter.java
                        ExtendedSAX.java Filter.java FilterIterator.java
                        FilteredStepIterator.java KeyIndex.java
                        LoadDocument.java MatchingIterator.java
                        MultiDOM.java MultipleNodeCounter.java
                        NodeCounter.java NodeIteratorBase.java
                        NodeSortRecord.java NodeSortRecordFactory.java
                        NthIterator.java ReverseIterator.java
                        SingleNodeCounter.java SingletonIterator.java
                        SortingIterator.java StepIterator.java
                        StripWhitespaceFilter.java UnionIterator.java
               java/src/org/apache/xalan/xsltc/runtime Tag: xalan3
                        AbstractTranslet.java AttributeList.java
                        Attributes.java BasisLibrary.java Constants.java
                        DefaultSAXOutputHandler.java ErrorMessages.java
                        ErrorMessages_no.java Hashtable.java
                        MessageHandler.java Node.java Operators.java
                        Parameter.java SAXAdapter.java
                        StringValueHandler.java TextOutput.java
                        TransletLoader.java TransletOutputBase.java
               java/src/org/apache/xalan/xsltc/runtime/output Tag: xalan3
                        OutputBase.java SAXHTMLOutput.java SAXOutput.java
                        SAXTextOutput.java SAXXMLOutput.java
                        StreamHTMLOutput.java StreamOutput.java
                        StreamTextOutput.java StreamUnknownOutput.java
                        StreamXMLOutput.java
                        TransletOutputHandlerFactory.java
               java/src/org/apache/xalan/xsltc/trax Tag: xalan3
                        DOM2SAX.java OutputSettings.java SAX2DOM.java
                        SmartTransformerFactoryImpl.java
                        TemplatesHandlerImpl.java TemplatesImpl.java
                        TrAXFilter.java TransformerFactoryImpl.java
                        TransformerHandlerImpl.java TransformerImpl.java
                        XSLTCSource.java
               java/src/org/apache/xalan/xsltc/util Tag: xalan3
                        IntegerArray.java JavaCupRedirect.java
  Added:       java/src/org/apache/xalan/extensions Tag: xalan3
                        ExtensionHandlerStylesheetFunction.java
               java/src/org/apache/xalan/processor Tag: xalan3
                        ProcessorFuncResult.java ProcessorFunction.java
                        ProcessorResultDocument.java
               java/src/org/apache/xalan/templates Tag: xalan3
                        ElemForEachGroup.java ElemFuncResult.java
                        ElemFunction.java ElemNamespace.java
                        ElemPrincipalResultDocument.java
                        ElemResultDocument.java FuncCurrentGroup.java
               java/src/org/apache/xalan/transformer Tag: xalan3
                        GroupSorter.java GroupingIterator.java
                        ItemSorter.java SortKey.java
  Log:
  Xalan3 specific additions and updates
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.1   +2 -2      xml-xalan/java/src/org/apache/xalan/extensions/ExpressionContext.java
  
  Index: ExpressionContext.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/ExpressionContext.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- ExpressionContext.java	10 Jun 2002 19:24:41 -0000	1.4
  +++ ExpressionContext.java	14 Aug 2002 19:21:25 -0000	1.4.2.1
  @@ -56,9 +56,9 @@
    */
   package org.apache.xalan.extensions;
   
  -import org.w3c.dom.traversal.NodeIterator;
  -import org.w3c.dom.Node;
   import org.apache.xpath.objects.XObject;
  +import org.w3c.dom.Node;
  +import org.w3c.dom.traversal.NodeIterator;
   
   /**
    * An object that implements this interface can supply
  
  
  
  1.11.2.1  +3 -9      xml-xalan/java/src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
  
  Index: ExtensionHandlerJavaClass.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- ExtensionHandlerJavaClass.java	29 Jul 2002 18:47:00 -0000	1.11
  +++ ExtensionHandlerJavaClass.java	14 Aug 2002 19:21:25 -0000	1.11.2.1
  @@ -305,6 +305,9 @@
   
             if (targetObject instanceof XObject)
               targetObject = ((XObject) targetObject).object();
  +          
  +          if(null == targetObject)
  +            throw new RuntimeException("The object is null for targetObject: "+targetObject);
   
             if (m_classObj.isAssignableFrom(targetObject.getClass()))
               resolveType = MethodResolver.DYNAMIC;
  @@ -411,15 +414,6 @@
       try
       {
         result = m.invoke(m_defaultInstance, new Object[] {xpc, element});
  -    }
  -    catch (InvocationTargetException e)
  -    {
  -      Throwable targetException = e.getTargetException();
  -      
  -      if (targetException != null)
  -        throw new TransformerException (targetException.getMessage (), targetException);
  -      else
  -        throw new TransformerException (e.getMessage (), e);
       }
       catch (Exception e)
       {
  
  
  
  1.27.4.1  +4 -4      xml-xalan/java/src/org/apache/xalan/extensions/MethodResolver.java
  
  Index: MethodResolver.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/MethodResolver.java,v
  retrieving revision 1.27
  retrieving revision 1.27.4.1
  diff -u -r1.27 -r1.27.4.1
  --- MethodResolver.java	22 Mar 2002 14:50:49 -0000	1.27
  +++ MethodResolver.java	14 Aug 2002 19:21:25 -0000	1.27.4.1
  @@ -776,18 +776,18 @@
             if ( (javaClass == NodeIterator.class) ||
                  (javaClass == java.lang.Object.class) )
             {
  -            DTMIterator dtmIter = ((XRTreeFrag) xobj).asNodeIterator();
  +            DTMIterator dtmIter = ((XRTreeFrag) xobj).iter();
               return new DTMNodeIterator(dtmIter);
             }
             else if (javaClass == NodeList.class)
             {
  -            return ((XRTreeFrag) xobj).convertToNodeset();
  +            return ((XRTreeFrag) xobj).nodelist();
             }
             // Same comment as above
             // else if(Node.class.isAssignableFrom(javaClass))
             else if(javaClass == Node.class)
             {
  -            DTMIterator iter = ((XRTreeFrag) xobj).asNodeIterator();
  +            DTMIterator iter = ((XRTreeFrag) xobj).iter();
               int rootHandle = iter.nextNode();
               DTM dtm = iter.getDTM(rootHandle);
               return dtm.getNode(dtm.getFirstChild(rootHandle));
  @@ -806,7 +806,7 @@
             }
             else
             {
  -            DTMIterator iter = ((XRTreeFrag) xobj).asNodeIterator();
  +            DTMIterator iter = ((XRTreeFrag) xobj).iter();
               int rootHandle = iter.nextNode();
               DTM dtm = iter.getDTM(rootHandle);
               Node child = dtm.getNode(dtm.getFirstChild(rootHandle));
  
  
  
  1.13.8.1  +1 -1      xml-xalan/java/src/org/apache/xalan/extensions/XSLProcessorContext.java
  
  Index: XSLProcessorContext.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/XSLProcessorContext.java,v
  retrieving revision 1.13
  retrieving revision 1.13.8.1
  diff -u -r1.13 -r1.13.8.1
  --- XSLProcessorContext.java	8 Feb 2002 23:33:49 -0000	1.13
  +++ XSLProcessorContext.java	14 Aug 2002 19:21:25 -0000	1.13.8.1
  @@ -223,7 +223,7 @@
         }
         else if (obj instanceof Double)
         {
  -        value = new XNumber(((Double) obj).doubleValue());
  +        value = new org.apache.xpath.objects.XDouble(((Double) obj).doubleValue());
         }
         else if (obj instanceof DocumentFragment)
         {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +248 -0    xml-xalan/java/src/org/apache/xalan/extensions/Attic/ExtensionHandlerStylesheetFunction.java
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.1   +1 -2      xml-xalan/java/src/org/apache/xalan/lib/ExsltCommon.java
  
  Index: ExsltCommon.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/ExsltCommon.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- ExsltCommon.java	29 Jul 2002 18:32:59 -0000	1.4
  +++ ExsltCommon.java	14 Aug 2002 19:21:25 -0000	1.4.2.1
  @@ -71,7 +71,6 @@
   
   import org.apache.xpath.XPath;
   import org.apache.xpath.XPathContext;
  -import org.apache.xpath.DOMHelper;
   import org.apache.xml.dtm.DTMIterator;
   import org.apache.xml.dtm.DTM;
   import org.apache.xml.dtm.ref.DTMNodeIterator;
  @@ -94,7 +93,7 @@
    * This class contains EXSLT common extension functions.
    * It is accessed by specifying a namespace URI as follows:
    * <pre>
  - *    xmlns:exslt="http://exslt.org/common"
  + *    xmlns:exslt="http://exslt.org/xalan/common"
    * </pre>
    * 
    * The documentation for each function has been copied from the relevant
  
  
  
  1.2.2.1   +53 -53    xml-xalan/java/src/org/apache/xalan/lib/ExsltDatetime.java
  
  Index: ExsltDatetime.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/ExsltDatetime.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- ExsltDatetime.java	17 Jun 2002 20:06:00 -0000	1.2
  +++ ExsltDatetime.java	14 Aug 2002 19:21:25 -0000	1.2.2.1
  @@ -65,7 +65,7 @@
   import java.text.DateFormat;
   import java.text.ParseException;
   import org.apache.xpath.objects.XString;
  -import org.apache.xpath.objects.XNumber;
  +import org.apache.xpath.objects.XDouble;
   import org.apache.xpath.objects.XBoolean;
   import org.apache.xpath.objects.XObject;
   
  @@ -269,30 +269,30 @@
        *   xs:gYear (CCYY) 
        * If the date/time string is not in one of these formats, then NaN is returned. 
        */
  -    public static XNumber year(String datetimeIn)
  +    public static XDouble year(String datetimeIn)
         throws ParseException
       {
         String[] edz = getEraDatetimeZone(datetimeIn);
         boolean ad = edz[0].length() == 0; // AD (Common Era -- empty leader)
         String datetime = edz[1];
         if (datetime == null) 
  -        return new XNumber(Double.NaN);
  +        return new XDouble(Double.NaN);
         
         String[] formats = {dt, d, gym, gy};
         double yr = getNumber(datetime, formats, Calendar.YEAR);
         if (ad || yr == Double.NaN)
  -        return new XNumber(yr);
  +        return new XDouble(yr);
         else
  -        return new XNumber(-yr);
  +        return new XDouble(-yr);
       }
        
       /**
        * See above.
        */
  -    public static XNumber year()
  +    public static XDouble year()
       {
         Calendar cal = Calendar.getInstance();
  -      return new XNumber(cal.get(Calendar.YEAR));
  +      return new XDouble(cal.get(Calendar.YEAR));
       }
       
       /**
  @@ -309,25 +309,25 @@
        *    xs:gYearMonth (CCYY-MM) 
        * If the date/time string is not in one of these formats, then NaN is returned. 
        */
  -    public static XNumber monthInYear(String datetimeIn)
  +    public static XDouble monthInYear(String datetimeIn)
         throws ParseException
       {
         String[] edz = getEraDatetimeZone(datetimeIn);
         String datetime = edz[1];
         if (datetime == null)
  -        return new XNumber(Double.NaN);      
  +        return new XDouble(Double.NaN);      
         
         String[] formats = {dt, d, gym};
  -      return new XNumber(getNumber(datetime, formats, Calendar.MONTH));
  +      return new XDouble(getNumber(datetime, formats, Calendar.MONTH));
       }
       
       /**
        * See above.
        */
  -    public static XNumber monthInYear()
  +    public static XDouble monthInYear()
       {      
         Calendar cal = Calendar.getInstance();
  -      return new XNumber(cal.get(Calendar.MONTH));
  +      return new XDouble(cal.get(Calendar.MONTH));
      }
       
       /**
  @@ -343,25 +343,25 @@
        *    xs:date (CCYY-MM-DD) 
        * If the date/time string is not in one of these formats, then NaN is returned. 
        */
  -    public static XNumber weekInYear(String datetimeIn)
  +    public static XDouble weekInYear(String datetimeIn)
         throws ParseException
       {
         String[] edz = getEraDatetimeZone(datetimeIn);
         String datetime = edz[1];
         if (datetime == null) 
  -        return new XNumber(Double.NaN);      
  +        return new XDouble(Double.NaN);      
         
         String[] formats = {dt, d};
  -      return new XNumber(getNumber(datetime, formats, Calendar.WEEK_OF_YEAR));
  +      return new XDouble(getNumber(datetime, formats, Calendar.WEEK_OF_YEAR));
       }
           
       /**
        * See above.
        */
  -    public static XNumber weekInYear()
  +    public static XDouble weekInYear()
       {
          Calendar cal = Calendar.getInstance();
  -      return new XNumber(cal.get(Calendar.WEEK_OF_YEAR));
  +      return new XDouble(cal.get(Calendar.WEEK_OF_YEAR));
      }
   
       /**
  @@ -377,25 +377,25 @@
        *     xs:date (CCYY-MM-DD) 
        * If the date/time string is not in one of these formats, then NaN is returned. 
        */
  -    public static XNumber dayInYear(String datetimeIn)
  +    public static XDouble dayInYear(String datetimeIn)
         throws ParseException
       {
         String[] edz = getEraDatetimeZone(datetimeIn);
         String datetime = edz[1];
         if (datetime == null) 
  -        return new XNumber(Double.NaN);            
  +        return new XDouble(Double.NaN);            
         
         String[] formats = {dt, d};
  -      return new XNumber(getNumber(datetime, formats, Calendar.DAY_OF_YEAR));
  +      return new XDouble(getNumber(datetime, formats, Calendar.DAY_OF_YEAR));
       }
       
       /**
        * See above.
        */
  -    public static XNumber dayInYear()
  +    public static XDouble dayInYear()
       {
          Calendar cal = Calendar.getInstance();
  -      return new XNumber(cal.get(Calendar.DAY_OF_YEAR));
  +      return new XDouble(cal.get(Calendar.DAY_OF_YEAR));
      }
       
   
  @@ -414,23 +414,23 @@
        *      xs:gDay (---DD) 
        * If the date/time string is not in one of these formats, then NaN is returned. 
        */
  -    public static XNumber dayInMonth(String datetimeIn)
  +    public static XDouble dayInMonth(String datetimeIn)
         throws ParseException
       {
         String[] edz = getEraDatetimeZone(datetimeIn);
         String datetime = edz[1];
         String[] formats = {dt, d, gmd, gd};
         double day = getNumber(datetime, formats, Calendar.DAY_OF_MONTH);
  -      return new XNumber(day);
  +      return new XDouble(day);
       }
       
       /**
        * See above.
        */
  -    public static XNumber dayInMonth()
  +    public static XDouble dayInMonth()
       {
         Calendar cal = Calendar.getInstance();
  -      return new XNumber(cal.get(Calendar.DAY_OF_MONTH));
  +      return new XDouble(cal.get(Calendar.DAY_OF_MONTH));
      }
       
       /**
  @@ -447,25 +447,25 @@
        *      xs:date (CCYY-MM-DD) 
        * If the date/time string is not in one of these formats, then NaN is returned. 
        */
  -    public static XNumber dayOfWeekInMonth(String datetimeIn)
  +    public static XDouble dayOfWeekInMonth(String datetimeIn)
         throws ParseException
       {
         String[] edz = getEraDatetimeZone(datetimeIn);
         String datetime = edz[1];
         if (datetime == null) 
  -        return new XNumber(Double.NaN);            
  +        return new XDouble(Double.NaN);            
   
         String[] formats =  {dt, d};
  -      return new XNumber(getNumber(datetime, formats, Calendar.DAY_OF_WEEK_IN_MONTH));
  +      return new XDouble(getNumber(datetime, formats, Calendar.DAY_OF_WEEK_IN_MONTH));
       }
       
       /**
        * See above.
        */
  -    public static XNumber dayOfWeekInMonth()
  +    public static XDouble dayOfWeekInMonth()
       {
          Calendar cal = Calendar.getInstance();
  -      return new XNumber(cal.get(Calendar.DAY_OF_WEEK_IN_MONTH));
  +      return new XDouble(cal.get(Calendar.DAY_OF_WEEK_IN_MONTH));
      }
         
       
  @@ -483,25 +483,25 @@
        * If the date/time string is not in one of these formats, then NaN is returned. 
                               The numbering of days of the week starts at 1 for Sunday, 2 for Monday and so on up to 7 for Saturday.  
        */
  -    public static XNumber dayInWeek(String datetimeIn)
  +    public static XDouble dayInWeek(String datetimeIn)
         throws ParseException
       {
         String[] edz = getEraDatetimeZone(datetimeIn);
         String datetime = edz[1];
         if (datetime == null) 
  -        return new XNumber(Double.NaN);            
  +        return new XDouble(Double.NaN);            
   
         String[] formats = {dt, d};
  -      return new XNumber(getNumber(datetime, formats, Calendar.DAY_OF_WEEK));
  +      return new XDouble(getNumber(datetime, formats, Calendar.DAY_OF_WEEK));
       }
       
       /**
        * See above.
        */
  -    public static XNumber dayInWeek()
  +    public static XDouble dayInWeek()
       {
          Calendar cal = Calendar.getInstance();
  -      return new XNumber(cal.get(Calendar.DAY_OF_WEEK));
  +      return new XDouble(cal.get(Calendar.DAY_OF_WEEK));
      }        
   
       /**
  @@ -517,25 +517,25 @@
        *     xs:time (hh:mm:ss) 
        * If the date/time string is not in one of these formats, then NaN is returned. 
        */
  -    public static XNumber hourInDay(String datetimeIn)
  +    public static XDouble hourInDay(String datetimeIn)
         throws ParseException
       {
         String[] edz = getEraDatetimeZone(datetimeIn);
         String datetime = edz[1];
         if (datetime == null) 
  -        return new XNumber(Double.NaN);            
  +        return new XDouble(Double.NaN);            
         
         String[] formats = {d, t};
  -      return new XNumber(getNumber(datetime, formats, Calendar.HOUR_OF_DAY));
  +      return new XDouble(getNumber(datetime, formats, Calendar.HOUR_OF_DAY));
       }
       
       /**
        * See above.
        */
  -    public static XNumber hourInDay()
  +    public static XDouble hourInDay()
       {
          Calendar cal = Calendar.getInstance();
  -      return new XNumber(cal.get(Calendar.HOUR_OF_DAY));
  +      return new XDouble(cal.get(Calendar.HOUR_OF_DAY));
      }
       
       /**
  @@ -551,25 +551,25 @@
        *      xs:time (hh:mm:ss) 
        * If the date/time string is not in one of these formats, then NaN is returned. 
        */
  -    public static XNumber minuteInHour(String datetimeIn)
  +    public static XDouble minuteInHour(String datetimeIn)
         throws ParseException
       {
         String[] edz = getEraDatetimeZone(datetimeIn);
         String datetime = edz[1];
         if (datetime == null) 
  -        return new XNumber(Double.NaN);            
  +        return new XDouble(Double.NaN);            
         
         String[] formats = {dt,t};
  -      return new XNumber(getNumber(datetime, formats, Calendar.MINUTE));
  +      return new XDouble(getNumber(datetime, formats, Calendar.MINUTE));
       }    
       
       /**
        * See above.
        */
  -   public static XNumber minuteInHour()
  +   public static XDouble minuteInHour()
       {
          Calendar cal = Calendar.getInstance();
  -      return new XNumber(cal.get(Calendar.MINUTE));
  +      return new XDouble(cal.get(Calendar.MINUTE));
      }    
   
       /**
  @@ -585,25 +585,25 @@
        *      xs:time (hh:mm:ss) 
        * If the date/time string is not in one of these formats, then NaN is returned. 
        */
  -    public static XNumber secondInMinute(String datetimeIn)
  +    public static XDouble secondInMinute(String datetimeIn)
         throws ParseException
       {
         String[] edz = getEraDatetimeZone(datetimeIn);
         String datetime = edz[1];
         if (datetime == null) 
  -        return new XNumber(Double.NaN);            
  +        return new XDouble(Double.NaN);            
         
         String[] formats = {dt, t};
  -      return new XNumber(getNumber(datetime, formats, Calendar.SECOND));
  +      return new XDouble(getNumber(datetime, formats, Calendar.SECOND));
       }
   
       /**
        * See above.
        */
  -    public static XNumber secondInMinute()
  +    public static XDouble secondInMinute()
       {
          Calendar cal = Calendar.getInstance();
  -      return new XNumber(cal.get(Calendar.SECOND));
  +      return new XDouble(cal.get(Calendar.SECOND));
       }
          
       /**
  @@ -627,12 +627,12 @@
         String[] edz = getEraDatetimeZone(datetimeIn);
         String datetime = edz[1];
         if (datetime == null) 
  -        return new XNumber(Double.NaN);            
  +        return new XDouble(Double.NaN);            
               
         String[] formats = {dt, d, gym, gy};
         double dbl = getNumber(datetime, formats, Calendar.YEAR);
         if (dbl == Double.NaN) 
  -        return new XNumber(Double.NaN);
  +        return new XDouble(Double.NaN);
         int yr = (int)dbl;
         return new XBoolean(yr % 400 == 0 || (yr % 100 != 0 && yr % 4 == 0));
       }
  
  
  
  1.3.2.1   +4 -5      xml-xalan/java/src/org/apache/xalan/lib/ExsltMath.java
  
  Index: ExsltMath.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/ExsltMath.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- ExsltMath.java	29 Jul 2002 18:32:59 -0000	1.3
  +++ ExsltMath.java	14 Aug 2002 19:21:25 -0000	1.3.2.1
  @@ -71,7 +71,6 @@
   
   import org.apache.xpath.XPath;
   import org.apache.xpath.XPathContext;
  -import org.apache.xpath.DOMHelper;
   import org.apache.xml.dtm.DTMIterator;
   import org.apache.xml.dtm.ref.DTMNodeIterator;
   import org.apache.xml.utils.XMLString;
  @@ -195,7 +194,7 @@
      * @param expCon is passed in by the Xalan extension processor
      * @param ni The NodeIterator for the node-set to be evaluated.
      * 
  -   * @return node-set with nodes containing the maximum value found, an empty node-set
  +   * @return node-set with nodes containing the minimum value found, an empty node-set
      * if any node cannot be converted to a number.
      */
     public static NodeSet highest (ExpressionContext expCon, NodeIterator ni)
  @@ -205,7 +204,7 @@
       NodeIterator niClone = ns.cloneWithReset();
       double high = new Double(max(expCon, niClone)).doubleValue();
       NodeSet highNodes = new NodeSet();
  -    highNodes.setShouldCacheNodes(true);
  +    highNodes.setShouldCache(true);
       
       if (Double.isNaN(high))
         return highNodes;  // empty Nodeset
  @@ -234,7 +233,7 @@
      * @param expCon is passed in by the Xalan extension processor
      * @param ni The NodeIterator for the node-set to be evaluated.
      * 
  -   * @return node-set with nodes containing the minimum value found, an empty node-set
  +   * @return node-set with nodes containing the maximum value found, an empty node-set
      * if any node cannot be converted to a number.
      * 
      */
  @@ -246,7 +245,7 @@
       double low = new Double(min(expCon, niClone)).doubleValue();
   
       NodeSet lowNodes = new NodeSet();
  -    lowNodes.setShouldCacheNodes(true);
  +    lowNodes.setShouldCache(true);
       
       if (Double.isNaN(low))
         return lowNodes;  // empty Nodeset
  
  
  
  1.3.2.1   +3 -3      xml-xalan/java/src/org/apache/xalan/lib/ExsltSets.java
  
  Index: ExsltSets.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/ExsltSets.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- ExsltSets.java	29 Jul 2002 18:32:59 -0000	1.3
  +++ ExsltSets.java	14 Aug 2002 19:21:25 -0000	1.3.2.1
  @@ -93,7 +93,7 @@
    * This class contains EXSLT set extension functions.
    * It is accessed by specifying a namespace URI as follows:
    * <pre>
  - *    xmlns:set="http://exslt.org/sets"
  + *    xmlns:set="http://exslt.org/xalan/sets"
    * </pre>
    * 
    * The documentation for each function has been copied from the relevant
  @@ -145,8 +145,8 @@
      * 
      * @param ni1 NodeIterator for first node-set.
      * @param ni2 NodeIterator for second node-set.
  -   * @return a node-set containing the nodes in ni1 that follow in document order the first
  -   * node in ni2; an empty node-set if the first node in ni2 is not in ni1; all of ni1 if ni2
  +   * @return a node-set containing the nodes in ni1 that precede in document order the first
  +   * node in ni2; an empty node-set if the first noe in ni2 is not in ni1; all of ni1 if ni2
      * is empty.
      * 
      * @see <a href="http://www.exslt.org/">EXSLT</a>
  
  
  
  1.19.2.1  +9 -68     xml-xalan/java/src/org/apache/xalan/lib/Extensions.java
  
  Index: Extensions.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/Extensions.java,v
  retrieving revision 1.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- Extensions.java	29 Jul 2002 18:32:59 -0000	1.19
  +++ Extensions.java	14 Aug 2002 19:21:25 -0000	1.19.2.1
  @@ -66,10 +66,9 @@
   import org.apache.xpath.NodeSet;
   import org.apache.xpath.objects.XObject;
   import org.apache.xpath.objects.XBoolean;
  -import org.apache.xpath.objects.XNumber;
  +import org.apache.xpath.objects.XDouble;
   import org.apache.xpath.XPath;
   import org.apache.xpath.XPathContext;
  -import org.apache.xpath.DOMHelper;
   import org.apache.xml.dtm.DTMIterator;
   import org.apache.xml.dtm.ref.DTMNodeIterator;
   import org.apache.xml.utils.XMLString;
  @@ -148,7 +147,7 @@
         }
         else if (rtf instanceof Double)
         {
  -        textNodeValue = new XNumber(((Double) rtf).doubleValue()).str();
  +        textNodeValue = new XDouble(((Double) rtf).doubleValue()).str();
         }
         else
         {
  @@ -195,7 +194,7 @@
       NodeSet ns2 = new NodeSet(ni2);
       NodeSet inter = new NodeSet();
   
  -    inter.setShouldCacheNodes(true);
  +    inter.setShouldCache(true);
   
       for (int i = 0; i < ns1.getLength(); i++)
       {
  @@ -228,7 +227,7 @@
       // NodeSet inter= new NodeSet();
       NodeSet diff = new NodeSet();
   
  -    diff.setShouldCacheNodes(true);
  +    diff.setShouldCache(true);
   
       for (int i = 0; i < ns1.getLength(); i++)
       {
  @@ -258,7 +257,7 @@
       // strings.
   
       NodeSet dist = new NodeSet();
  -    dist.setShouldCacheNodes(true);
  +    dist.setShouldCache(true);
   
       Hashtable stringTable = new Hashtable();
   
  @@ -280,7 +279,7 @@
     }
   
     /**
  -   * Returns true if both node-sets contain the same set of nodes.
  +   * Returns true of both node-sets contain the same set of nodes.
      * @param n1 NodeIterator for first node-set
      *
      * NEEDSDOC @param ni1
  @@ -334,7 +333,7 @@
                       ((XPathContext.XPathExpressionContext) myContext).getXPathContext();
           XPath dynamicXPath = new XPath(xpathExpr, xctxt.getSAXLocator(),
                                          xctxt.getNamespaceContext(),
  -                                       XPath.SELECT);
  +                                       XPath.SELECT, null, 1.0);
   
           return dynamicXPath.execute(xctxt, myContext.getContextNode(),
                                       xctxt.getNamespaceContext());
  @@ -419,11 +418,7 @@
      * <p>Simply calls the {@link org.apache.xalan.xslt.EnvironmentCheck}
      * utility to grab info about the Java environment and CLASSPATH, 
      * etc., and then returns the resulting Node.  Stylesheets can 
  -   * then maniuplate this data or simply xsl:copy-of the Node.  Note 
  -   * that we first attempt to load the more advanced 
  -   * org.apache.env.Which utility by reflection; only if that fails 
  -   * to we still use the internal version.  Which is available from 
  -   * <a href="http://xml.apache.org/commons/">http://xml.apache.org/commons/</a>.</p>
  +   * then maniuplate this data or simply xsl:copy-of the Node.</p>
      *
      * <p>We throw a WrappedRuntimeException in the unlikely case 
      * that reading information from the environment throws us an 
  @@ -451,17 +446,9 @@
       Node resultNode = null;
       try
       {
  -      // First use reflection to try to load Which, which is a 
  -      //  better version of EnvironmentCheck
  -      resultNode = checkEnvironmentUsingWhich(myContext, factoryDocument);
  -
  -      if (null != resultNode)
  -        return resultNode;
  -
  -      // If reflection failed, fallback to our internal EnvironmentCheck
  +      resultNode = factoryDocument.createElement("checkEnvironmentExtension");
         EnvironmentCheck envChecker = new EnvironmentCheck();
         Hashtable h = envChecker.getEnvironmentHash();
  -      resultNode = factoryDocument.createElement("checkEnvironmentExtension");
         envChecker.appendEnvironmentReport(resultNode, factoryDocument, h);
         envChecker = null;
       }
  @@ -473,50 +460,4 @@
       return resultNode;
     }
   
  -  /**
  -   * Private worker method to attempt to use org.apache.env.Which.
  -   *
  -   * @param myContext an <code>ExpressionContext</code> passed in by the
  -   *                  extension mechanism.  This must be an XPathContext.
  -   * @param factoryDocument providing createElement services, etc.
  -   * @return a Node with environment info; null if any error
  -   */
  -  private static Node checkEnvironmentUsingWhich(ExpressionContext myContext, 
  -        Document factoryDocument)
  -  {
  -    final String WHICH_CLASSNAME = "org.apache.env.Which";
  -    final String WHICH_METHODNAME = "which";
  -    final Class WHICH_METHOD_ARGS[] = { java.util.Hashtable.class,
  -                                        java.lang.String.class,
  -                                        java.lang.String.class };
  -    try
  -    {
  -      // Use reflection to try to find xml-commons utility 'Which'
  -      // Classloader note: if anyone really cares, we could try to 
  -      //    use the context classloader instead
  -      Class clazz = Class.forName(WHICH_CLASSNAME);
  -      if (null == clazz)
  -        return null;
  -
  -      // Fully qualify names since this is the only method they're used in
  -      java.lang.reflect.Method method = clazz.getMethod(WHICH_METHODNAME, WHICH_METHOD_ARGS);
  -      Hashtable report = new Hashtable();
  -
  -      // Call the method with our Hashtable, common options, and ignore return value
  -      Object[] methodArgs = { report, "XmlCommons;Xalan;Xerces;Crimson;Ant", "" };
  -      Object returnValue = method.invoke(null, methodArgs);
  -
  -      // Create a parent to hold the report and append hash to it
  -      Node resultNode = factoryDocument.createElement("checkEnvironmentExtension");
  -      org.apache.xml.utils.Hashtree2Node.appendHashToNode(report, "whichReport", 
  -            resultNode, factoryDocument);
  -
  -      return resultNode;
  -    }
  -    catch (Throwable t)
  -    {
  -      // Simply return null; no need to report error
  -      return null;
  -    }
  -  }
   }
  
  
  
  1.16.12.1 +2 -1      xml-xalan/java/src/org/apache/xalan/lib/Redirect.java
  
  Index: Redirect.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/Redirect.java,v
  retrieving revision 1.16
  retrieving revision 1.16.12.1
  diff -u -r1.16 -r1.16.12.1
  --- Redirect.java	29 Nov 2001 19:26:11 -0000	1.16
  +++ Redirect.java	14 Aug 2002 19:21:25 -0000	1.16.12.1
  @@ -323,7 +323,8 @@
       {
         org.apache.xpath.XPathContext xctxt 
           = context.getTransformer().getXPathContext();
  -      XPath myxpath = new XPath(fileNameExpr, elem, xctxt.getNamespaceContext(), XPath.SELECT);
  +      XPath myxpath = new XPath(fileNameExpr, elem, xctxt.getNamespaceContext(), 
  +                                XPath.SELECT, null, 1.0);
         XObject xobj = myxpath.execute(xctxt, context.getContextNode(), elem);
         fileName = xobj.str();
         if((null == fileName) || (fileName.length() == 0))
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.23.12.1 +32 -39    xml-xalan/java/src/org/apache/xalan/lib/sql/XConnection.java
  
  Index: XConnection.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/sql/XConnection.java,v
  retrieving revision 1.23
  retrieving revision 1.23.12.1
  diff -u -r1.23 -r1.23.12.1
  --- XConnection.java	17 Jan 2002 19:12:43 -0000	1.23
  +++ XConnection.java	14 Aug 2002 19:21:26 -0000	1.23.12.1
  @@ -56,33 +56,26 @@
    */
   package org.apache.xalan.lib.sql;
   
  +import java.math.BigDecimal;
   import java.sql.Connection;
  -import java.sql.DatabaseMetaData;
  -import java.sql.DriverManager;
  -import java.sql.SQLException;
  -import java.sql.Statement;
  +import java.sql.Date;
   import java.sql.PreparedStatement;
   import java.sql.ResultSet;
  -import java.sql.Date;
  -import java.sql.Timestamp;
  +import java.sql.SQLException;
  +import java.sql.Statement;
   import java.sql.Time;
  +import java.sql.Timestamp;
  +import java.util.Enumeration;
   import java.util.Properties;
  -import java.util.Vector;
   import java.util.StringTokenizer;
  -import java.lang.IllegalArgumentException;
  -import org.w3c.dom.Element;
  -import org.w3c.dom.NamedNodeMap;
  -import org.w3c.dom.NodeList;
  -import org.w3c.dom.Node;
   import java.util.Vector;
  -import java.util.Enumeration;
  -import java.math.BigDecimal;
  +
  +import org.apache.xalan.extensions.ExpressionContext;
   import org.apache.xml.dtm.DTM;
   import org.apache.xml.dtm.DTMManager;
   import org.apache.xml.dtm.ref.DTMManagerDefault;
   import org.apache.xpath.XPathContext;
  -import org.apache.xalan.extensions.ExpressionContext;
  -import org.apache.xpath.objects.XBooleanStatic;
  +import org.apache.xpath.objects.XBoolean;
   
   import org.w3c.dom.*;
   import java.sql.*;
  @@ -241,7 +234,7 @@
      * @param ConnPoolName
      * @return
      */
  -  public XBooleanStatic connect( ExpressionContext exprContext, String ConnPoolName )
  +  public XBoolean connect( ExpressionContext exprContext, String ConnPoolName )
     {
       try
       {
  @@ -251,12 +244,12 @@
           throw new java.lang.IllegalArgumentException("Invalid Pool Name");
   
         m_IsDefaultPool = false;
  -      return new XBooleanStatic(true);
  +      return XBoolean.S_TRUE;
       }
       catch (Exception e)
       {
         buildErrorDocument(exprContext, e);
  -      return new XBooleanStatic(false);
  +      return  new XBoolean(false) /* XBoolean.S_FALSE? */;
       }
   
     }
  @@ -268,22 +261,22 @@
      * @param dbURL database URL of the form jdbc:subprotocol:subname.
      * @return
      */
  -  public XBooleanStatic connect( ExpressionContext exprContext, String driver, String dbURL )
  +  public XBoolean connect( ExpressionContext exprContext, String driver, String dbURL )
     {
       try
       {
         init(driver, dbURL, new Properties());
  -      return new XBooleanStatic(true);
  +      return XBoolean.S_TRUE;
       }
       catch(SQLException e)
       {
         buildErrorDocument(exprContext, e);
  -      return new XBooleanStatic(false);
  +      return XBoolean.S_FALSE;
       }
       catch (Exception e)
       {
         buildErrorDocument(exprContext, e);
  -      return new XBooleanStatic(false);
  +      return XBoolean.S_FALSE;
       }
     }
   
  @@ -292,22 +285,22 @@
      * @param protocolElem
      * @return
      */
  -  public XBooleanStatic connect( ExpressionContext exprContext, Element protocolElem )
  +  public XBoolean connect( ExpressionContext exprContext, Element protocolElem )
     {
       try
       {
         initFromElement(protocolElem);
  -      return new XBooleanStatic(true);
  +      return XBoolean.S_TRUE;
       }
       catch(SQLException e)
       {
         buildErrorDocument(exprContext, e);
  -      return new XBooleanStatic(false);
  +      return XBoolean.S_FALSE;
       }
       catch (Exception e)
       {
         buildErrorDocument(exprContext, e);
  -      return new XBooleanStatic(false);
  +      return XBoolean.S_FALSE;
       }
     }
   
  @@ -316,22 +309,22 @@
      * @param list
      * @return
      */
  -  public XBooleanStatic connect( ExpressionContext exprContext, NodeList list )
  +  public XBoolean connect( ExpressionContext exprContext, NodeList list )
     {
       try
       {
         initFromElement( (Element) list.item(0) );
  -      return new XBooleanStatic(true);
  +      return XBoolean.S_TRUE;
       }
       catch(SQLException e)
       {
         buildErrorDocument(exprContext, e);
  -      return new XBooleanStatic(false);
  +      return XBoolean.S_FALSE;
       }
       catch (Exception e)
       {
         buildErrorDocument(exprContext, e);
  -      return new XBooleanStatic(false);
  +      return XBoolean.S_FALSE;
       }
     }
   
  @@ -344,7 +337,7 @@
      * @param password connection password.
      * @return
      */
  -  public XBooleanStatic connect( ExpressionContext exprContext, String driver, String dbURL, String user, String password )
  +  public XBoolean connect( ExpressionContext exprContext, String driver, String dbURL, String user, String password )
     {
       try
       {
  @@ -354,17 +347,17 @@
   
         init(driver, dbURL, prop);
   
  -      return new XBooleanStatic(true);
  +      return XBoolean.S_TRUE;
       }
       catch(SQLException e)
       {
         buildErrorDocument(exprContext, e);
  -      return new XBooleanStatic(false);
  +      return XBoolean.S_FALSE;
       }
       catch (Exception e)
       {
         buildErrorDocument(exprContext, e);
  -      return new XBooleanStatic(false);
  +      return XBoolean.S_FALSE;
       }
     }
   
  @@ -378,7 +371,7 @@
      * normally including at least "user" and "password".
      * @return
      */
  -  public XBooleanStatic connect( ExpressionContext exprContext, String driver, String dbURL, Element protocolElem )
  +  public XBoolean connect( ExpressionContext exprContext, String driver, String dbURL, Element protocolElem )
     {
       try
       {
  @@ -393,17 +386,17 @@
   
         init(driver, dbURL, prop);
   
  -      return new XBooleanStatic(true);
  +      return XBoolean.S_TRUE;
       }
       catch(SQLException e)
       {
         buildErrorDocument(exprContext, e);
  -      return new XBooleanStatic(false);
  +      return XBoolean.S_FALSE;
       }
       catch (Exception e)
       {
         buildErrorDocument(exprContext, e);
  -      return new XBooleanStatic(false);
  +      return XBoolean.S_FALSE;
       }
     }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.21.2.1  +1 -10     xml-xalan/java/src/org/apache/xalan/processor/ProcessorInclude.java
  
  Index: ProcessorInclude.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/ProcessorInclude.java,v
  retrieving revision 1.21
  retrieving revision 1.21.2.1
  diff -u -r1.21 -r1.21.2.1
  --- ProcessorInclude.java	30 Jul 2002 18:05:13 -0000	1.21
  +++ ProcessorInclude.java	14 Aug 2002 19:21:26 -0000	1.21.2.1
  @@ -238,16 +238,7 @@
           if (null != source && source instanceof DOMSource)
           {
             Node node = ((DOMSource)source).getNode();
  -          
  -          String systemId = source.getSystemId();
  -          if (systemId == null)
  -          {
  -            systemId = SystemIDResolver.getAbsoluteURI(getHref(),
  -                         handler.getBaseIdentifier());
  -            
  -          }
  -          
  -          TreeWalker walker = new TreeWalker(handler, new org.apache.xpath.DOM2Helper(), systemId);
  +          TreeWalker walker = new TreeWalker(handler, new org.apache.xpath.DOM2Helper(), source.getSystemId());
   
             try
             {
  
  
  
  1.10.4.1  +6 -5      xml-xalan/java/src/org/apache/xalan/processor/ProcessorKey.java
  
  Index: ProcessorKey.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/ProcessorKey.java,v
  retrieving revision 1.10
  retrieving revision 1.10.4.1
  diff -u -r1.10 -r1.10.4.1
  --- ProcessorKey.java	22 Mar 2002 01:04:40 -0000	1.10
  +++ ProcessorKey.java	14 Aug 2002 19:21:26 -0000	1.10.4.1
  @@ -151,11 +151,12 @@
         {
           String valueString = attributes.getValue(i);
   
  -        if (valueString.indexOf(org.apache.xpath.compiler.Keywords.FUNC_KEY_STRING
  -                                + "(") >= 0)
  -          handler.error(
  -            XSLMessages.createMessage(
  -            XSLTErrorResources.ER_INVALID_KEY_CALL, null), null);
  +        // TBD: Figure out what this is all about, and what to do about it in the new world.
  +//        if (valueString.indexOf(org.apache.xpath.compiler.Keywords.FUNC_KEY_STRING
  +//                                + "(") >= 0)
  +//          handler.error(
  +//            XSLMessages.createMessage(
  +//            XSLTErrorResources.ER_INVALID_KEY_CALL, null), null);
   
           processedDefs.addElement(attrDef);
           attrDef.setAttrValue(handler, attrUri, attrLocalName,
  
  
  
  1.18.12.1 +2 -1      xml-xalan/java/src/org/apache/xalan/processor/ProcessorLRE.java
  
  Index: ProcessorLRE.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/ProcessorLRE.java,v
  retrieving revision 1.18
  retrieving revision 1.18.12.1
  diff -u -r1.18 -r1.18.12.1
  --- ProcessorLRE.java	28 Jul 2001 00:25:57 -0000	1.18
  +++ ProcessorLRE.java	14 Aug 2002 19:21:26 -0000	1.18.12.1
  @@ -215,7 +215,8 @@
           appendAndPush(handler, template);
   
           XPath rootMatch = new XPath("/", stylesheet, stylesheet, XPath.MATCH, 
  -             handler.getStylesheetProcessor().getErrorListener());
  +             handler.getStylesheetProcessor().getErrorListener(), 
  +             stylesheet.getVersionNumber());
   
           template.setMatch(rootMatch);
   
  
  
  
  1.14.2.1  +29 -4     xml-xalan/java/src/org/apache/xalan/processor/ProcessorOutputElem.java
  
  Index: ProcessorOutputElem.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/ProcessorOutputElem.java,v
  retrieving revision 1.14
  retrieving revision 1.14.2.1
  diff -u -r1.14 -r1.14.2.1
  --- ProcessorOutputElem.java	6 Jun 2002 14:20:25 -0000	1.14
  +++ ProcessorOutputElem.java	14 Aug 2002 19:21:26 -0000	1.14.2.1
  @@ -72,6 +72,7 @@
   
   import org.xml.sax.Attributes;
   
  +
   /**
    * TransformerFactory for xsl:output markup.
    * @see <a href="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
  @@ -79,7 +80,7 @@
    */
   class ProcessorOutputElem extends XSLTElementProcessor
   {
  -
  +  
     /** The output properties, set temporarily while the properties are 
      *  being set from the attributes, and then nulled after that operation 
      *  is completed.  */
  @@ -90,11 +91,22 @@
      * @see javax.xml.transform.OutputKeys#CDATA_SECTION_ELEMENTS
      * @param newValue non-null reference to processed attribute value.
      */
  +  public void setCdataSectionElements(java.util.Vector newValue, QName qname)
  +  {
  +    m_outputProperties.setQNameProperties(OutputKeys.CDATA_SECTION_ELEMENTS, newValue);
  +  }
  +
  +  /**
  +   * Set the cdata-section-elements property from the attribute value.
  +   * @see javax.xml.transform.OutputKeys#CDATA_SECTION_ELEMENTS
  +   * @param newValue non-null reference to processed attribute value.
  +   */
     public void setCdataSectionElements(java.util.Vector newValue)
     {
       m_outputProperties.setQNameProperties(OutputKeys.CDATA_SECTION_ELEMENTS, newValue);
     }
   
  +
     /**
      * Set the doctype-public property from the attribute value.
      * @see javax.xml.transform.OutputKeys#DOCTYPE_PUBLIC
  @@ -204,6 +216,18 @@
       QName key = new QName(attrUri, attrLocalName);
       m_outputProperties.setProperty(key, attrValue);
     }
  +  
  +  //XSLT 2.0
  + 
  +  public void setName(QName v)
  +  {
  +    m_outputProperties.setQNameProperty("name", v);
  +  }    
  +  
  +  public QName getName()
  +  {
  +    return m_outputProperties.getQNameProperty("name");
  +  }
   
     /**
      * Receive notification of the start of an xsl:output element.
  @@ -234,7 +258,7 @@
       m_outputProperties.setLocaterInfo(handler.getLocator());
       m_outputProperties.setUid(handler.nextUid());
       setPropertiesFromAttributes(handler, rawName, attributes, this);
  -    
  +
       // Access this only from the Hashtable level... we don't want to 
       // get default properties.
       String entitiesFileName =
  @@ -254,11 +278,12 @@
         }
       }
       
  -    handler.getStylesheet().setOutput(m_outputProperties);
  +    // for 2.0, can have multiple output properties, identified by name.
  +    handler.getStylesheet().setOutput(m_outputProperties); 
       
       ElemTemplateElement parent = handler.getElemTemplateElement();
       parent.appendChild(m_outputProperties);
       
       m_outputProperties = null;
     }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.10.12.1 +9 -7      xml-xalan/java/src/org/apache/xalan/processor/ProcessorStylesheetElement.java
  
  Index: ProcessorStylesheetElement.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/ProcessorStylesheetElement.java,v
  retrieving revision 1.10
  retrieving revision 1.10.12.1
  diff -u -r1.10 -r1.10.12.1
  --- ProcessorStylesheetElement.java	10 Oct 2001 18:42:07 -0000	1.10
  +++ ProcessorStylesheetElement.java	14 Aug 2002 19:21:26 -0000	1.10.12.1
  @@ -102,14 +102,16 @@
   
         if (stylesheetType == StylesheetHandler.STYPE_ROOT)
         {
  -        try
  -        {
  +      	// TBD: Figure out what TransformerConfigurationException isn't thrown anymore in the new world.
  +      	// Likely that this will magically reappear.
  +//        try
  +//        {
             stylesheet = new StylesheetRoot(handler.getSchema(), handler.getStylesheetProcessor().getErrorListener());
  -        }
  -        catch(TransformerConfigurationException tfe)
  -        {
  -          throw new TransformerException(tfe);
  -        }
  +//        }
  +//        catch(TransformerConfigurationException tfe)
  +//        {
  +//          throw new TransformerException(tfe); 
  +//        }
         }
         else
         {
  
  
  
  1.10.4.1  +1 -1      xml-xalan/java/src/org/apache/xalan/processor/ProcessorTemplateElem.java
  
  Index: ProcessorTemplateElem.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/ProcessorTemplateElem.java,v
  retrieving revision 1.10
  retrieving revision 1.10.4.1
  diff -u -r1.10 -r1.10.4.1
  --- ProcessorTemplateElem.java	28 Mar 2002 19:52:50 -0000	1.10
  +++ ProcessorTemplateElem.java	14 Aug 2002 19:21:26 -0000	1.10.4.1
  @@ -105,7 +105,7 @@
         try
         {
           elem = (ElemTemplateElement) classObject.newInstance();
  -
  +        elem.setParentElem(handler.getElemTemplateElement());
           elem.setDOMBackPointer(handler.getOriginatingNode());
           elem.setLocaterInfo(handler.getLocator());
           elem.setPrefixes(handler.getNamespaceSupport());
  
  
  
  1.53.2.1  +35 -41    xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java
  
  Index: StylesheetHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java,v
  retrieving revision 1.53
  retrieving revision 1.53.2.1
  diff -u -r1.53 -r1.53.2.1
  --- StylesheetHandler.java	8 Jul 2002 22:05:56 -0000	1.53
  +++ StylesheetHandler.java	14 Aug 2002 19:21:26 -0000	1.53.2.1
  @@ -56,55 +56,42 @@
    */
   package org.apache.xalan.processor;
   
  -import java.net.URL;
  -
  -import java.io.IOException;
  +import java.util.EmptyStackException;
  +import java.util.Stack;
  +import java.util.Vector;
   
  -import javax.xml.transform.sax.TemplatesHandler;
  +import javax.xml.transform.ErrorListener;
  +import javax.xml.transform.SourceLocator;
   import javax.xml.transform.Templates;
  -import javax.xml.transform.TransformerException;
   import javax.xml.transform.TransformerConfigurationException;
  -
  -import java.util.Stack;
  -
  +import javax.xml.transform.TransformerException;
  +import javax.xml.transform.sax.TemplatesHandler;
  +import org.apache.xalan.extensions.ExpressionVisitor;
   import org.apache.xalan.res.XSLMessages;
   import org.apache.xalan.res.XSLTErrorResources;
   import org.apache.xalan.templates.Constants;
  -import org.apache.xalan.templates.ElemTemplateElement;
  -import org.apache.xalan.templates.ElemUnknown;
   import org.apache.xalan.templates.ElemForEach;
  -import org.apache.xalan.templates.StylesheetRoot;
  +import org.apache.xalan.templates.ElemTemplateElement;
   import org.apache.xalan.templates.Stylesheet;
  +import org.apache.xalan.templates.StylesheetRoot;
  +import org.apache.xml.utils.BoolStack;
  +import org.apache.xml.utils.NamespaceSupport2;
   import org.apache.xml.utils.NodeConsumer;
   import org.apache.xml.utils.PrefixResolver;
  +import org.apache.xml.utils.QName;
  +import org.apache.xml.utils.SAXSourceLocator;
   import org.apache.xml.utils.XMLCharacterRecognizer;
  -import org.apache.xml.utils.BoolStack;
  -import org.apache.xpath.compiler.FunctionTable;
  -import org.apache.xpath.compiler.XPathParser;
  -import org.apache.xpath.functions.Function;
  -import org.apache.xpath.XPathFactory;
   import org.apache.xpath.XPath;
  -
  -import org.apache.xpath.functions.FuncExtFunction;
  -import org.apache.xalan.extensions.ExpressionVisitor;
  +import org.apache.xpath.functions.Function;
  +import org.apache.xpath.parser.SimpleNode;
   import org.w3c.dom.Node;
  -
   import org.xml.sax.Attributes;
  -import org.xml.sax.ContentHandler;
  -import org.xml.sax.DTDHandler;
  -import org.xml.sax.EntityResolver;
   import org.xml.sax.InputSource;
   import org.xml.sax.Locator;
  -
  -import org.xml.sax.helpers.NamespaceSupport;
  -import org.apache.xml.utils.NamespaceSupport2;
  +import org.xml.sax.SAXException;
  +import org.xml.sax.SAXParseException;
   import org.xml.sax.helpers.DefaultHandler;
  -
  -import javax.xml.transform.SourceLocator;
  -import javax.xml.transform.ErrorListener;
  -import javax.xml.transform.TransformerException;
  -
  -import org.apache.xml.utils.SAXSourceLocator;
  +import org.xml.sax.helpers.NamespaceSupport;
   
   /**
    * <meta name="usage" content="advanced"/>
  @@ -159,14 +146,18 @@
             m_xpathFunctionsInited = true;
   
             Function func = new org.apache.xalan.templates.FuncDocument();
  -
  -          FunctionTable.installFunction("document", func);
  +          
  +          SimpleNode.m_builtInFunctions.put(new QName("document"), func);
   
             // func = new org.apache.xalan.templates.FuncKey();
             // FunctionTable.installFunction("key", func);
             func = new org.apache.xalan.templates.FuncFormatNumb();
   
  -          FunctionTable.installFunction("format-number", func);
  +          SimpleNode.m_builtInFunctions.put(new QName("format-number"), func);
  +					
  +          func = new org.apache.xalan.templates.FuncCurrentGroup();
  +
  +          SimpleNode.m_builtInFunctions.put(new QName("current-group"), func);
           }
         }
       }
  @@ -196,7 +187,9 @@
             throws javax.xml.transform.TransformerException
     {
       ErrorListener handler = m_stylesheetProcessor.getErrorListener();
  -    XPath xpath = new XPath(str, owningTemplate, this, XPath.SELECT, handler);
  +    XPath xpath = new XPath(str, owningTemplate, owningTemplate, 
  +      XPath.SELECT, handler, getStylesheetRoot().getVersionNumber());
  +      
       // Visit the expression, registering namespaces for any extension functions it includes.
       xpath.callVisitors(xpath, new ExpressionVisitor(getStylesheetRoot()));
       return xpath;
  @@ -216,7 +209,8 @@
             throws javax.xml.transform.TransformerException
     {
       ErrorListener handler = m_stylesheetProcessor.getErrorListener();
  -    return new XPath(str, owningTemplate, this, XPath.MATCH, handler);
  +    return new XPath(str, owningTemplate, owningTemplate, XPath.MATCH, handler,
  +          getStylesheetRoot().getVersionNumber());
     }
   
     /**
  @@ -422,8 +416,8 @@
       }
   
       if (null == elemProcessor)
  -      error(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_ALLOWED_IN_POSITION, new Object[]{rawName}),null);//rawName + " is not allowed in this position in the stylesheet!",
  -            
  +      error(rawName + " is not allowed in this position in the stylesheet!",
  +            null);
                   
       return elemProcessor;
     }
  @@ -740,8 +734,8 @@
         // If it's whitespace, just ignore it, otherwise flag an error.
         if (!XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
           error(
  -          XSLMessages.createMessage(XSLTErrorResources.ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION, null),null);//"Non-whitespace text is not allowed in this position in the stylesheet!",
  -          
  +          "Non-whitespace text is not allowed in this position in the stylesheet!",
  +          null);
       }
       else
         elemProcessor.characters(this, ch, start, length);
  
  
  
  1.24.2.1  +101 -618  xml-xalan/java/src/org/apache/xalan/processor/XSLTAttributeDef.java
  
  Index: XSLTAttributeDef.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/XSLTAttributeDef.java,v
  retrieving revision 1.24
  retrieving revision 1.24.2.1
  diff -u -r1.24 -r1.24.2.1
  --- XSLTAttributeDef.java	26 Jul 2002 00:28:15 -0000	1.24
  +++ XSLTAttributeDef.java	14 Aug 2002 19:21:26 -0000	1.24.2.1
  @@ -58,8 +58,13 @@
   
   import org.apache.xml.utils.StringToIntTable;
   
  +import java.lang.IllegalAccessException;
  +import java.lang.IndexOutOfBoundsException;
  +import java.lang.InstantiationException;
  +import java.lang.NoSuchMethodException;
   import java.lang.reflect.InvocationTargetException;
   import java.lang.reflect.Method;
  +import java.lang.StringBuffer;
   
   import java.util.StringTokenizer;
   import java.util.Vector;
  @@ -72,12 +77,10 @@
   import org.apache.xml.utils.QName;
   import org.apache.xml.utils.SystemIDResolver;
   import org.apache.xml.utils.StringVector;
  -import org.apache.xml.utils.XMLChar;
   import org.apache.xpath.XPath;
   
   import javax.xml.transform.TransformerException;
   
  - 
   /**
    * This class defines an attribute for an element in a XSLT stylesheet,
    * is meant to reflect the structure defined in http://www.w3.org/TR/xslt#dtd, and the
  @@ -85,32 +88,24 @@
    */
   public class XSLTAttributeDef
   {
  -   // How to handle invalid values for this attribute 
  -   static final int FATAL = 0;
  -   static final int ERROR = 1;
  -   static final int WARNING = 2;
  -   
  -   
  +
     /**
      * Construct an instance of XSLTAttributeDef.
      *
      * @param namespace The Namespace URI, or an empty string.
      * @param name The local name (without prefix), or empty string if not namespace processing.
      * @param type One of T_CDATA, T_URL, T_AVT, T_PATTERN, T_EXPR, T_CHAR,
  -   * T_NUMBER, T_YESNO, T_QNAME, T_QNAMES, T_ENUM, T_SIMPLEPATTERNLIST,
  -   * T_NMTOKEN, T_STRINGLIST, T_PREFIX_URLLIST, T_ENUM_OR_PQNAME, T_NCNAME.
  +   * T_PRIORITY, T_YESNO, T_QNAME, T_QNAMES, T_ENUM, T_SIMPLEPATTERNLIST,
  +   * T_NMTOKEN, T_STRINGLIST, T_PREFIX_URLLIST.
      * @param required true if this is attribute is required by the XSLT specification.
  -   * @param supportsAVT true if this attribute supports AVT's.
  -   * @param errorType the type of error to issue if validation fails.  One of FATAL, ERROR, WARNING. 
      */
  -  XSLTAttributeDef(String namespace, String name, int type, boolean required, boolean supportsAVT, int errorType)
  +  XSLTAttributeDef(String namespace, String name, int type, boolean required)
     {
  +
       this.m_namespace = namespace;
       this.m_name = name;
       this.m_type = type;
       this.m_required = required;
  -    this.m_supportsAVT = supportsAVT;
  -    this.m_errorType = errorType;
     }
   
     /**
  @@ -119,24 +114,19 @@
      * @param namespace The Namespace URI, or an empty string.
      * @param name The local name (without prefix), or empty string if not namespace processing.
      * @param type One of T_CDATA, T_URL, T_AVT, T_PATTERN, T_EXPR,
  -   * T_CHAR, T_NUMBER, T_YESNO, T_QNAME, T_QNAMES, T_ENUM,
  -   * T_SIMPLEPATTERNLIST, T_NMTOKEN, T_STRINGLIST, T_PREFIX_URLLIST, 
  -   * T_ENUM_OR_PQNAME, T_NCNAME.
  -   * @param supportsAVT true if this attribute supports AVT's. 
  -   * @param errorType the type of error to issue if validation fails.  One of FATAL, ERROR, WARNING. 
  +   * T_CHAR, T_PRIORITY, T_YESNO, T_QNAME, T_QNAMES, T_ENUM,
  +   * T_SIMPLEPATTERNLIST, T_NMTOKEN, T_STRINGLIST, T_PREFIX_URLLIST.
      * @param defaultVal The default value for this attribute.
      */
  -  XSLTAttributeDef(String namespace, String name, int type, boolean supportsAVT, int errorType, String defaultVal)
  +  XSLTAttributeDef(String namespace, String name, int type, String defaultVal)
     {
   
       this.m_namespace = namespace;
       this.m_name = name;
       this.m_type = type;
       this.m_required = false;
  -    this.m_supportsAVT = supportsAVT;  
  -    this.m_errorType = errorType;      
       this.m_default = defaultVal;
  -   }
  +  }
   
     /**
      * Construct an instance of XSLTAttributeDef that uses two
  @@ -145,24 +135,19 @@
      * @param namespace The Namespace URI, or an empty string.
      * @param name The local name (without prefix), or empty string if not namespace processing.
      * @param required true if this attribute is required by the XSLT specification.
  -   * @param supportsAVT true if this attribute supports AVT's.  
  -   * @param prefixedQNameValAllowed If true, the type is T_ENUM_OR_PQNAME       
  -   * @param errorType the type of error to issue if validation fails.  One of FATAL, ERROR, WARNING. 
      * @param k1 The XSLT name of the enumerated value.
      * @param v1 An integer representation of k1.
      * @param k2 The XSLT name of the enumerated value.
      * @param v2 An integer representation of k2.
  -    */
  -  XSLTAttributeDef(String namespace, String name, boolean required, boolean supportsAVT, 
  -                    boolean prefixedQNameValAllowed, int errorType, String k1, int v1, String k2, int v2)
  +   */
  +  XSLTAttributeDef(String namespace, String name, boolean required,
  +                   String k1, int v1, String k2, int v2)
     {
   
       this.m_namespace = namespace;
       this.m_name = name;
  -	this.m_type = prefixedQNameValAllowed ? this.T_ENUM_OR_PQNAME : this.T_ENUM;    
  +    this.m_type = this.T_ENUM;
       this.m_required = required;
  -    this.m_supportsAVT = supportsAVT;    
  -    this.m_errorType = errorType;    
       m_enums = new StringToIntTable(2);
   
       m_enums.put(k1, v1);
  @@ -176,9 +161,6 @@
      * @param namespace The Namespace URI, or an empty string.
      * @param name The local name (without prefix), or empty string if not namespace processing.
      * @param required true if this attribute is required by the XSLT specification.
  -   * @param supportsAVT true if this attribute supports AVT's.
  -   * @param prefixedQNameValAllowed If true, the type is T_ENUM_OR_PQNAME
  -   * @param errorType the type of error to issue if validation fails.  One of FATAL, ERROR, WARNING.    * 
      * @param k1 The XSLT name of the enumerated value.
      * @param v1 An integer representation of k1.
      * @param k2 The XSLT name of the enumerated value.
  @@ -186,16 +168,14 @@
      * @param k3 The XSLT name of the enumerated value.
      * @param v3 An integer representation of k3.
      */
  -  XSLTAttributeDef(String namespace, String name, boolean required, boolean supportsAVT,
  -                    boolean prefixedQNameValAllowed, int errorType, String k1, int v1, String k2, int v2, String k3, int v3)
  +  XSLTAttributeDef(String namespace, String name, boolean required,
  +                   String k1, int v1, String k2, int v2, String k3, int v3)
     {
   
       this.m_namespace = namespace;
       this.m_name = name;
  -	this.m_type = prefixedQNameValAllowed ? this.T_ENUM_OR_PQNAME : this.T_ENUM;    
  +    this.m_type = this.T_ENUM;
       this.m_required = required;
  -    this.m_supportsAVT = supportsAVT; 
  -    this.m_errorType = errorType;      
       m_enums = new StringToIntTable(3);
   
       m_enums.put(k1, v1);
  @@ -210,9 +190,7 @@
      * @param namespace The Namespace URI, or an empty string.
      * @param name The local name (without prefix), or empty string if not namespace processing.
      * @param required true if this attribute is required by the XSLT specification.
  -   * @param supportsAVT true if this attribute supports AVT's.
  -   * @param prefixedQNameValAllowed If true, the type is T_ENUM_OR_PQNAME
  -   * @param errorType the type of error to issue if validation fails.  One of FATAL, ERROR, WARNING.    * @param k1 The XSLT name of the enumerated value.
  +   * @param k1 The XSLT name of the enumerated value.
      * @param v1 An integer representation of k1.
      * @param k2 The XSLT name of the enumerated value.
      * @param v2 An integer representation of k2.
  @@ -221,17 +199,15 @@
      * @param k4 The XSLT name of the enumerated value.
      * @param v4 An integer representation of k4.
      */
  -  XSLTAttributeDef(String namespace, String name, boolean required, boolean supportsAVT,
  -                   boolean prefixedQNameValAllowed, int errorType, String k1, int v1, String k2, int v2, 
  -                   String k3, int v3, String k4, int v4)
  +  XSLTAttributeDef(String namespace, String name, boolean required,
  +                   String k1, int v1, String k2, int v2, String k3, int v3,
  +                   String k4, int v4)
     {
   
       this.m_namespace = namespace;
       this.m_name = name;
  -	this.m_type = prefixedQNameValAllowed ? this.T_ENUM_OR_PQNAME : this.T_ENUM;    
  +    this.m_type = this.T_ENUM;
       this.m_required = required;
  -    this.m_supportsAVT = supportsAVT;      
  -    this.m_errorType = errorType; 
       m_enums = new StringToIntTable(4);
   
       m_enums.put(k1, v1);
  @@ -260,8 +236,8 @@
     // of a single character.-->
     T_CHAR = 6,
   
  -  // <!-- Used for the type of an attribute value that is a number. -->
  -  T_NUMBER = 7,
  +  // <!-- Used for the type of an attribute value that is a priority. -->
  +  T_PRIORITY = 7,
   
     // Used for boolean values
     T_YESNO = 8,
  @@ -270,8 +246,7 @@
     // gets expanded by the XSLT processor. -->
     T_QNAME = 9,
   
  -  // <!--Used for a whitespace-separated list of QNames where the non-prefixed
  -  // entries are not to be placed in the default namespace. -->
  +  // <!-- Like qname but a whitespace-separated list of QNames. -->
     T_QNAMES = 10,
   
     // <!-- Used for enumerated values -->
  @@ -287,25 +262,11 @@
     T_STRINGLIST = 14,
   
     // Used for a list of white-space delimited strings.
  -  T_PREFIX_URLLIST = 15,
  -  
  -  // Used for enumerated values, one of which could be a qname-but-not-ncname
  -  T_ENUM_OR_PQNAME = 16,
  -
  -  // Used for the type of an attribute value that is a NCName
  -  T_NCNAME = 17,
  -  
  -  // Used for QName attributes that are always AVT.  Prefix isn't resolved.
  -  T_AVT_QNAME = 18,
  -  
  -  // Used for a list of QNames where non-prefixed items are to be resolved
  -  // using the default namespace (This is only true for cdata-section-elements)
  -  T_QNAMES_RESOLVE_NULL = 19;
  -  
  +  T_PREFIX_URLLIST = 15;
   
     /** Representation for an attribute in a foreign namespace. */
     static XSLTAttributeDef m_foreignAttr = new XSLTAttributeDef("*", "*",
  -                                            XSLTAttributeDef.T_CDATA,false, false, WARNING);
  +                                            XSLTAttributeDef.T_CDATA, false);
   
     /** Method name that objects may implement if they wish to have forein attributes set. */
     static String S_FOREIGNATTR_SETTER = "setForeignAttr";
  @@ -349,8 +310,8 @@
      * Get the type of this attribute value.
      *
      * @return One of T_CDATA, T_URL, T_AVT, T_PATTERN, T_EXPR, T_CHAR,
  -   * T_NUMBER, T_YESNO, T_QNAME, T_QNAMES, T_ENUM, T_SIMPLEPATTERNLIST,
  -   * T_NMTOKEN, T_STRINGLIST, T_PREFIX_URLLIST, T_ENUM_OR_PQNAME.
  +   * T_PRIORITY, T_YESNO, T_QNAME, T_QNAMES, T_ENUM, T_SIMPLEPATTERNLIST,
  +   * T_NMTOKEN, T_STRINGLIST, T_PREFIX_URLLIST.
      */
     int getType()
     {
  @@ -378,19 +339,6 @@
       return m_enums.get(key);
     }
   
  - /**
  -   * If this element is of type T_ENUM, this will return
  -   * an array of strings - the values in the enumeration
  -   *
  -   * @return An array of the enumerated values permitted for this attribute.
  -   *
  -   * @throws Throws NullPointerException if m_enums is null.
  -   */
  -  private String[] getEnumNames()
  -  {
  -    return m_enums.keys();
  -  }
  -
     /**
      * The default value for this attribute.
      */
  @@ -432,32 +380,6 @@
     }
   
     /**
  -   * If true, this is attribute supports AVT's.
  -   */
  -  private boolean m_supportsAVT;
  -
  -  /**
  -   * Get whether or not this attribute supports AVT's.
  -   *
  -   * @return true if this attribute supports AVT's.
  -   */
  -  boolean getSupportsAVT()
  -  {
  -    return m_supportsAVT;
  -  }
  -  
  -  int m_errorType = this.WARNING;
  -  
  -  /**
  -   * Get the type of error message to use if the attribute value is invalid.
  -   *
  -   * @return one of XSLAttributeDef.FATAL, XSLAttributeDef.ERROR, XSLAttributeDef.WARNING
  -   */
  -  int getErrorType()
  -  {
  -    return m_errorType;
  -  }
  -  /**
      * String that should represent the setter method which which
      * may be used on objects to set a value that represents this attribute  
      */
  @@ -571,26 +493,11 @@
      * @param value non-null string reference.
      *
      * @return The value argument.
  -   * 
  -   * @throws org.xml.sax.SAXException.
      */
     Object processCDATA(StylesheetHandler handler, String uri, String name,
  -                      String rawName, String value, ElemTemplateElement owner)
  -                      throws org.xml.sax.SAXException
  +                      String rawName, String value)
     {
  -  	if (getSupportsAVT()) {
  -	    try
  -	    {
  -	      AVT avt = new AVT(handler, uri, name, rawName, value, owner);
  -	      return avt;
  -	    }
  -	    catch (TransformerException te)
  -	    {
  -	      throw new org.xml.sax.SAXException(te);
  -	    }  		
  -  	} else {  	  	
  -	    return value;
  -  	}
  +    return value;
     }
   
     /**
  @@ -608,38 +515,22 @@
      * @throws org.xml.sax.SAXException if the string is not a length of 1.
      */
     Object processCHAR(
  -          StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner)
  +          StylesheetHandler handler, String uri, String name, String rawName, String value)
               throws org.xml.sax.SAXException
     {
  -	if (getSupportsAVT()) {
  -	    try
  -	    {
  -	      AVT avt = new AVT(handler, uri, name, rawName, value, owner);
  -	
  -		  // If an AVT wasn't used, validate the value
  -		  if ((avt.isSimple()) && (value.length() != 1)) {
  -		  	handleError(handler, XSLTErrorResources.INVALID_TCHAR, new Object[] {name, value},null);
  -            return null;
  -		  }	
  -	      return avt;
  -	    }
  -	    catch (TransformerException te)
  -	    {
  -	      throw new org.xml.sax.SAXException(te);
  -	    }
  -	} else {    
  -	    if (value.length() != 1)
  -	    {
  -            handleError(handler, XSLTErrorResources.INVALID_TCHAR, new Object[] {name, value},null);
  -            return null;
  -	    }
   
  -	    return new Character(value.charAt(0));
  -	}
  +    if (value.length() != 1)
  +    {
  +      handler.error(
  +        "An XSLT attribute of type T_CHAR must be only 1 character!", null);
  +    }
  +
  +    return new Character(value.charAt(0));
     }
   
     /**
  -   * Process an attribute string of type T_ENUM into a int value.
  +   * Process an attribute string of type T_ENUM into
  +   * a int value.
      *
      * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
      * @param uri The Namespace URI, or an empty string.
  @@ -647,126 +538,16 @@
      * @param rawName The qualified name (with prefix).
      * @param value non-null string that represents an enumerated value that is
      * valid for this element.
  -   * @param owner
      *
  -   * @return An Integer representation of the enumerated value if this attribute does not support
  -   *         AVT.  Otherwise, and AVT is returned.
  +   * @return An Integer representation of the enumerated value.
      */
     Object processENUM(StylesheetHandler handler, String uri, String name,
  -                     String rawName, String value, ElemTemplateElement owner)
  -                     throws org.xml.sax.SAXException
  +                     String rawName, String value)
     {
   
  -	AVT avt = null;
  -	if (getSupportsAVT()) {
  -	    try
  -	    {
  -	      avt = new AVT(handler, uri, name, rawName, value, owner);
  -	      
  -	      // If this attribute used an avt, then we can't validate at this time.
  -	      if (!avt.isSimple()) return avt;
  -	    }
  -	    catch (TransformerException te)
  -	    {
  -	      throw new org.xml.sax.SAXException(te);
  -	    }
  -	}    
  -	
  -    int retVal = this.getEnum(value);
  -    
  -	if (retVal == StringToIntTable.INVALID_KEY) 
  -    {
  -       StringBuffer enumNamesList = getListOfEnums();
  -       handleError(handler, XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null);
  -       return null;
  -    }
  -
  -	if (getSupportsAVT()) return avt;
  -	else return new Integer(retVal);	
  +    int enum = this.getEnum(value);
   
  -  }
  -
  -  /**
  -   * Process an attribute string of that is either an enumerated value or a qname-but-not-ncname.
  -   * Returns an AVT, if this attribute support AVT; otherwise returns int or qname.
  -   *
  -   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
  -   * @param uri The Namespace URI, or an empty string.
  -   * @param name The local name (without prefix), or empty string if not namespace processing.
  -   * @param rawName The qualified name (with prefix).
  -   * @param value non-null string that represents an enumerated value that is
  -   * valid for this element.
  -   * @param owner
  -   *
  -   * @return AVT if attribute supports AVT. An Integer representation of the enumerated value if
  -   *         attribute does not support AVT and an enumerated value was used.  Otherwise a qname
  -   *         is returned.
  -   */
  -  Object processENUM_OR_PQNAME(StylesheetHandler handler, String uri, String name,
  -                     String rawName, String value, ElemTemplateElement owner)
  -                     throws org.xml.sax.SAXException
  -  {
  -
  -	Object objToReturn = null;
  -	
  -	if (getSupportsAVT()) {
  -	    try
  -	    {
  -	      AVT avt = new AVT(handler, uri, name, rawName, value, owner);
  -	      if (!avt.isSimple()) return avt;
  -	      else objToReturn = avt;
  -	    }  
  -	    catch (TransformerException te)
  -	    {
  -	      throw new org.xml.sax.SAXException(te);
  -	    }
  -	}    
  -	
  -    // An avt wasn't used.
  -  	int enum = this.getEnum(value);
  -    
  -    if (enum != StringToIntTable.INVALID_KEY) 
  -    {
  -        if (objToReturn == null) objToReturn = new Integer(enum);
  -    }
  -
  -    // enum not used.  Validate qname-but-not-ncname.
  -    else
  -    {
  -        try 
  -        {
  -			QName qname = new QName(value, handler, true);
  -            if (objToReturn == null) objToReturn = qname;	
  -	        
  -			if (qname.getPrefix() == null) {
  -	           StringBuffer enumNamesList = getListOfEnums();
  -
  - 	           enumNamesList.append(" <qname-but-not-ncname>");
  -               handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); 
  -               return null;
  -        
  -	        }            
  -        }
  -        catch (IllegalArgumentException ie) 
  -        {
  -           StringBuffer enumNamesList = getListOfEnums();
  -           enumNamesList.append(" <qname-but-not-ncname>");
  -           
  -           handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },ie); 
  -           return null;
  -
  -        }
  -        catch (RuntimeException re)
  -        {
  -           StringBuffer enumNamesList = getListOfEnums();
  -           enumNamesList.append(" <qname-but-not-ncname>");
  -
  -           handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },re); 
  -           return null;
  -        }    
  -  	}
  -  	
  -  	return objToReturn;
  +    return new Integer(enum);
     }
   
     /**
  @@ -814,37 +595,11 @@
      * @param rawName The qualified name (with prefix).
      * @param value A NMTOKEN string.
      *
  -   * @return the value argument or an AVT if this attribute supports AVTs.
  -   * 
  -   * @throws org.xml.sax.SAXException if the value is not a valid nmtoken
  +   * @return the value argument.
      */
     Object processNMTOKEN(StylesheetHandler handler, String uri, String name,
  -                        String rawName, String value, ElemTemplateElement owner)
  -             throws org.xml.sax.SAXException
  +                        String rawName, String value)
     {
  -  	
  -  	if (getSupportsAVT()) {
  -	    try
  -	    {
  -	      AVT avt = new AVT(handler, uri, name, rawName, value, owner);
  -	
  -		  // If an AVT wasn't used, validate the value
  -		  if ((avt.isSimple()) && (!XMLChar.isValidNmtoken(value))) {
  -            handleError(handler,XSLTErrorResources.INVALID_NMTOKEN, new Object[] {name,value},null);
  -            return null;
  -		  }	
  -	      return avt;
  -	    }
  -	    catch (TransformerException te)
  -	    {
  -	      throw new org.xml.sax.SAXException(te);
  -	    }  		
  -  	} else {
  -  		if (!XMLChar.isValidNmtoken(value)) {
  -            handleError(handler,XSLTErrorResources.INVALID_NMTOKEN, new Object[] {name,value},null);
  -            return null;
  -  		}
  -  	}	  			
       return value;
     }
   
  @@ -883,7 +638,7 @@
     }
   
     /**
  -   * Process an attribute string of type T_NUMBER into
  +   * Process an attribute string of type T_PRIORITY into
      * a double value.
      *
      * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
  @@ -891,7 +646,6 @@
      * @param name The local name (without prefix), or empty string if not namespace processing.
      * @param rawName The qualified name (with prefix).
      * @param value A string that can be parsed into a double value.
  -   * @param number
      *
      * @return A Double object.
      *
  @@ -899,208 +653,49 @@
      * {@link javax.xml.transform.TransformerException}
      * if the string does not contain a parsable number.
      */
  -  Object processNUMBER(
  -          StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner)
  +  Object processPRIORITY(
  +          StylesheetHandler handler, String uri, String name, String rawName, String value)
               throws org.xml.sax.SAXException
     {
   
  +    try
  +    {
  +      return Double.valueOf(value);
  +    }
  +    catch (NumberFormatException nfe)
  +    {
  +      handler.error(XSLTErrorResources.ER_PRIORITY_NOT_PARSABLE, null, nfe);//"Priority value does not contain a parsable number.",
  +                    //nfe);
   
  -	if (getSupportsAVT()) 
  -	{
  -		Double val;
  -		AVT avt = null;
  -	    try
  -	    {
  -	      avt = new AVT(handler, uri, name, rawName, value, owner);
  -	      
  -	      // If this attribute used an avt, then we can't validate at this time.
  -	      if (avt.isSimple()) 
  -	      {
  -	      	val = Double.valueOf(value);
  -	      }
  -	    }
  -	    catch (TransformerException te)
  -	    {
  -	      throw new org.xml.sax.SAXException(te);
  -	    } 
  -	    catch (NumberFormatException nfe)
  -	    {
  -	     	handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe);
  -            return null;
  -	    }
  -	    return avt;
  -	
  -	} 
  -	else
  -    {
  -	    try
  -	    {
  -	      return Double.valueOf(value);
  -	    }
  -	    catch (NumberFormatException nfe)
  -	    {
  -            handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe);
  -            return null;
  -	    }
  -    }    
  +      return new Double(0.0);
  +    }
     }
   
     /**
  -   * Process an attribute string of type T_QNAME into a QName value.
  +   * Process an attribute string of type T_QNAME into
  +   * a QName value.
      *
      * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
      * @param uri The Namespace URI, or an empty string.
      * @param name The local name (without prefix), or empty string if not namespace processing.
      * @param rawName The qualified name (with prefix).
      * @param value A string that represents a potentially prefix qualified name.
  -   * @param owner
      *
  -   * @return A QName object if this attribute does not support AVT's.  Otherwise, an AVT
  -   *         is returned.
  +   * @return A QName object.
      *
      * @throws org.xml.sax.SAXException if the string contains a prefix that can not be
      * resolved, or the string contains syntax that is invalid for a qualified name.
      */
     Object processQNAME(
  -          StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner)
  -            throws org.xml.sax.SAXException
  -  {
  -
  -     try 
  -        {	
  -   	      QName qname = new QName(value, handler, true);
  -          return qname;
  -        }
  -        catch (IllegalArgumentException ie)
  -        {
  -            // thrown by QName constructor
  -            handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},ie);
  -            return null;
  -        }
  -        catch (RuntimeException re) {
  -            // thrown by QName constructor
  -            handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},re);
  -            return null;
  -        }
  -  	}
  - 
  -
  -  /**
  -   * Process an attribute string of type T_QNAME into a QName value.
  -   *
  -   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
  -   * @param uri The Namespace URI, or an empty string.
  -   * @param name The local name (without prefix), or empty string if not namespace processing.
  -   * @param rawName The qualified name (with prefix).
  -   * @param value A string that represents a potentially prefix qualified name.
  -   * @param owner
  -   *
  -   * @return An AVT is returned.
  -   *
  -   * @throws org.xml.sax.SAXException if the string contains a prefix that can not be
  -   * resolved, or the string contains syntax that is invalid for a qualified name.
  -   */
  -  Object processAVT_QNAME(
  -          StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner)
  -            throws org.xml.sax.SAXException
  -  {
  -
  -       AVT avt = null;
  -       try
  -       {
  -          avt = new AVT(handler, uri, name, rawName, value, owner);
  -    
  -          // If an AVT wasn't used, validate the value
  -          if (avt.isSimple())
  -          {
  -             int indexOfNSSep = value.indexOf(':');
  -
  -             if (indexOfNSSep >= 0) 
  -             {   
  -                  String prefix = value.substring(0, indexOfNSSep);
  -                  if (!XMLChar.isValidNCName(prefix))
  -                  {
  -                     handleError(handler,XSLTErrorResources.INVALID_QNAME,new Object[]{name,value },null);
  -                     return null;
  -                  }
  -             }
  -                 
  -             String localName =  (indexOfNSSep < 0)
  -                 ? value : value.substring(indexOfNSSep + 1); 
  -             
  -             if ((localName == null) || (localName.length() == 0) ||
  -                 (!XMLChar.isValidNCName(localName)))
  -             {    
  -                     handleError(handler,XSLTErrorResources.INVALID_QNAME,new Object[]{name,value },null );
  -                     return null;
  -             }
  -          }  
  -        }
  -        catch (TransformerException te)
  -        {
  -           // thrown by AVT constructor
  -          throw new org.xml.sax.SAXException(te);
  -        } 
  -    
  -    return avt;
  - }
  -
  -  /**
  -   * Process an attribute string of type NCName into a String
  -   *
  -   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
  -   * @param uri The Namespace URI, or an empty string.
  -   * @param name The local name (without prefix), or empty string if not namespace processing.
  -   * @param rawName The qualified name (with prefix).
  -   * @param value A string that represents a potentially prefix qualified name.
  -   * @param owner
  -   *
  -   * @return A String object if this attribute does not support AVT's.  Otherwise, an AVT
  -   *         is returned.
  -   *
  -   * @throws org.xml.sax.SAXException if the string contains a prefix that can not be
  -   * resolved, or the string contains syntax that is invalid for a NCName.
  -   */
  -  Object processNCNAME(
  -          StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner)
  +          StylesheetHandler handler, String uri, String name, String rawName, String value)
               throws org.xml.sax.SAXException
     {
  -    
  -    if (getSupportsAVT()) 
  -    {
  -        AVT avt = null;
  -        try
  -        {
  -          avt = new AVT(handler, uri, name, rawName, value, owner);
  -    
  -          // If an AVT wasn't used, validate the value
  -          if ((avt.isSimple()) &&  (!XMLChar.isValidNCName(value))) 
  -          {
  -             handleError(handler,XSLTErrorResources.INVALID_NCNAME,new Object[] {name,value},null);
  -             return null;
  -          }      
  -          return avt;
  -        }
  -        catch (TransformerException te)
  -        {
  -           // thrown by AVT constructor
  -          throw new org.xml.sax.SAXException(te);
  -        } 
  -        
  -    } else {
  -        if (!XMLChar.isValidNCName(value)) 
  -        {
  -            handleError(handler,XSLTErrorResources.INVALID_NCNAME,new Object[] {name,value},null);
  -            return null;
  -        }
  -        return value;
  -    }
  - }
  +    return new QName(value, handler);
  +  }
   
     /**
  -   * Process an attribute string of type T_QNAMES into a vector of QNames where
  -   * the specification requires that non-prefixed elements not be placed in a
  -   * namespace.  (See section 2.4 of XSLT 1.0.)
  +   * Process an attribute string of type T_QNAMES into
  +   * a vector of QNames.
      *
      * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
      * @param uri The Namespace URI, or an empty string.
  @@ -1132,47 +727,6 @@
       return qnames;
     }
   
  - /**
  -   * Process an attribute string of type T_QNAMES_RESOLVE_NULL into a vector
  -   * of QNames where the specification requires non-prefixed elements to be
  -   * placed in the default namespace.  (See section 16 of XSLT 1.0; the
  -   * <em>only</em> time that this will get called is for the
  -   * <code>cdata-section-elements</code> attribute on <code>xsl:output</code>.
  -   *
  -   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
  -   * @param uri The Namespace URI, or an empty string.
  -   * @param name The local name (without prefix), or empty string if not namespace processing.
  -   * @param rawName The qualified name (with prefix).
  -   * @param value A whitespace delimited list of qualified names.
  -   *
  -   * @return a Vector of QName objects.
  -   *
  -   * @throws org.xml.sax.SAXException if the one of the qualified name strings
  -   * contains a prefix that can not be resolved, or a qualified name contains
  -   * syntax that is invalid for a qualified name.
  -   */
  -  final Vector processQNAMESRNU(StylesheetHandler handler, String uri,
  -    String name, String rawName, String value)
  -    throws org.xml.sax.SAXException
  -  {
  -
  -    StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f");
  -    int nQNames = tokenizer.countTokens();
  -    Vector qnames = new Vector(nQNames);
  -
  -    String defaultURI = handler.getNamespaceForPrefix("");
  -    for (int i = 0; i < nQNames; i++)
  -    {
  -      String tok = tokenizer.nextToken();
  -      if (tok.indexOf(':') == -1) {
  -        qnames.addElement(new QName(defaultURI,tok));
  -      } else {
  -        qnames.addElement(new QName(tok, handler));
  -      }
  -    }
  -    return qnames;
  -  }
  -
     /**
      * Process an attribute string of type T_SIMPLEPATTERNLIST into
      * a vector of XPath match patterns.
  @@ -1289,40 +843,19 @@
      * @param rawName The qualified name (with prefix).
      * @param value non-null string that conforms to the URL syntax.
      *
  -   * @return The non-absolutized URL argument, in other words, the value argument.  If this 
  -   *         attribute supports AVT, an AVT is returned.
  +   * @return The non-absolutized URL argument, in other words, the value argument.
      *
      * @throws org.xml.sax.SAXException if the URL does not conform to the URL syntax.
      */
  -  Object processURL(
  -          StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner)
  +  String processURL(
  +          StylesheetHandler handler, String uri, String name, String rawName, String value)
               throws org.xml.sax.SAXException
     {
   
  -    if (getSupportsAVT()) {
  -	    try
  -	    {
  -	      AVT avt = new AVT(handler, uri, name, rawName, value, owner);
  -	
  -		  // If an AVT wasn't used, validate the value
  -		 // if (avt.getSimpleString() != null) {
  -			   // TODO: syntax check URL value.
  -			    // return SystemIDResolver.getAbsoluteURI(value, 
  -			    //                                         handler.getBaseIdentifier());
  -		  //}	
  -	      return avt;
  -	    }
  -	    catch (TransformerException te)
  -	    {
  -	      throw new org.xml.sax.SAXException(te);
  -	    }  		
  -     } else {
       // TODO: syntax check URL value.
       // return SystemIDResolver.getAbsoluteURI(value, 
       //                                         handler.getBaseIdentifier());
  -     	
  -	    return value;
  -    }
  +    return value;
     }
   
     /**
  @@ -1346,12 +879,10 @@
   
       // Is this already checked somewhere else?  -sb
       if (!(value.equals("yes") || value.equals("no")))
  -    {
  -      handleError(handler, XSLTErrorResources.INVALID_BOOLEAN, new Object[] {name,value}, null);
  -      return null;
  -   }
  - 
  -     return new Boolean(value.equals("yes") ? true : false);
  +      handler.error(XSLTErrorResources.ER_VALUE_SHOULD_EQUAL, new Object[]{name}, null);//"Value for " + name + " should equal 'yes' or 'no'",
  +                    //null);
  +
  +    return new Boolean(value.equals("yes") ? true : false);
     }
   
     /**
  @@ -1382,41 +913,38 @@
         processedValue = processAVT(handler, uri, name, rawName, value, owner);
         break;
       case T_CDATA :
  -      processedValue = processCDATA(handler, uri, name, rawName, value, owner);
  +      processedValue = processCDATA(handler, uri, name, rawName, value);
         break;
       case T_CHAR :
  -      processedValue = processCHAR(handler, uri, name, rawName, value, owner);
  +      processedValue = processCHAR(handler, uri, name, rawName, value);
         break;
       case T_ENUM :
  -      processedValue = processENUM(handler, uri, name, rawName, value, owner);
  +      processedValue = processENUM(handler, uri, name, rawName, value);
         break;
       case T_EXPR :
         processedValue = processEXPR(handler, uri, name, rawName, value, owner);
         break;
       case T_NMTOKEN :
  -      processedValue = processNMTOKEN(handler, uri, name, rawName, value, owner);
  +      processedValue = processNMTOKEN(handler, uri, name, rawName, value);
         break;
       case T_PATTERN :
         processedValue = processPATTERN(handler, uri, name, rawName, value, owner);
         break;
  -    case T_NUMBER :
  -      processedValue = processNUMBER(handler, uri, name, rawName, value, owner);
  +    case T_PRIORITY :
  +      processedValue = processPRIORITY(handler, uri, name, rawName, value);
         break;
       case T_QNAME :
  -      processedValue = processQNAME(handler, uri, name, rawName, value, owner);
  +      processedValue = processQNAME(handler, uri, name, rawName, value);
         break;
       case T_QNAMES :
         processedValue = processQNAMES(handler, uri, name, rawName, value);
         break;
  -	case T_QNAMES_RESOLVE_NULL:
  -      processedValue = processQNAMESRNU(handler, uri, name, rawName, value);
  -      break;
       case T_SIMPLEPATTERNLIST :
         processedValue = processSIMPLEPATTERNLIST(handler, uri, name, rawName,
                                                   value, owner);
         break;
       case T_URL :
  -      processedValue = processURL(handler, uri, name, rawName, value, owner);
  +      processedValue = processURL(handler, uri, name, rawName, value);
         break;
       case T_YESNO :
         processedValue = processYESNO(handler, uri, name, rawName, value);
  @@ -1428,15 +956,6 @@
         processedValue = processPREFIX_URLLIST(handler, uri, name, rawName,
                                                value);
         break;
  -    case T_ENUM_OR_PQNAME :
  -    	processedValue = processENUM_OR_PQNAME(handler, uri, name, rawName, value, owner);
  -    	break;
  -    case T_NCNAME :
  -        processedValue = processNCNAME(handler, uri, name, rawName, value, owner);
  -        break;
  -    case T_AVT_QNAME :
  -        processedValue = processAVT_QNAME(handler, uri, name, rawName, value, owner);
  -        break;
       default :
       }
   
  @@ -1514,26 +1033,6 @@
   
       return cl;
     }
  -  
  -  /**
  -   * StringBuffer containing comma delimited list of valid values for ENUM type.
  -   * Used to build error message.
  -   */
  -  private StringBuffer getListOfEnums() 
  -  {
  -     StringBuffer enumNamesList = new StringBuffer();            
  -     String [] enumValues = this.getEnumNames();
  -
  -     for (int i = 0; i < enumValues.length; i++)
  -     {
  -        if (i > 0)
  -        {
  -           enumNamesList.append(' ');
  -        }
  -        enumNamesList.append(enumValues[i]);
  -    }        
  -    return enumNamesList;
  -  }
   
     /**
      * Set a value on an attribute.
  @@ -1547,13 +1046,22 @@
      *
      * @throws org.xml.sax.SAXException
      */
  -  boolean setAttrValue(
  +  void setAttrValue(
             StylesheetHandler handler, String attrUri, String attrLocalName, 
             String attrRawName, String attrValue, ElemTemplateElement elem)
               throws org.xml.sax.SAXException
     {
       if(attrRawName.equals("xmlns") || attrRawName.startsWith("xmlns:"))
  -      return true;
  +      return;
  +      
  +    if(null == elem.getParentElem())
  +    {
  +      // This is kind of a hack here. I just need to make sure that the element 
  +      // is parented, so that prefix resolution will work. -sb
  +      ElemTemplateElement parent = handler.getElemTemplateElement();
  +      if(null != parent)
  +        elem.setParentElem(parent);
  +    }
         
       String setterString = getSetterMethodName();
   
  @@ -1584,9 +1092,6 @@
           {
             Object value = processValue(handler, attrUri, attrLocalName,
                                         attrRawName, attrValue, elem);
  -          // If a warning was issued because the value for this attribute was
  -          // invalid, then the value will be null.  Just return
  -          if (null == value) return false;
                                         
             // First try to match with the primative value.
             Class[] argTypes = new Class[]{ getPrimativeClass(value) };
  @@ -1611,39 +1116,17 @@
         }
         catch (NoSuchMethodException nsme)
         {
  -        if (!setterString.equals(S_FOREIGNATTR_SETTER)) 
  -        {
  +        if (!setterString.equals(S_FOREIGNATTR_SETTER))
             handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, nsme);//"Failed calling " + setterString + " method!", nsme);
  -          return false;
  -        }
         }
         catch (IllegalAccessException iae)
         {
           handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, iae);//"Failed calling " + setterString + " method!", iae);
  -        return false;
         }
         catch (InvocationTargetException nsme)
         {
  -        handleError(handler, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE,
  -            new Object[]{ Constants.ATTRNAME_NAME, getName()}, nsme);
  -        return false;
  +        handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, nsme);//"Failed calling " + setterString + " method!", nsme);
         }
  -    }
  -    
  -    return true;
  -  }
  -  
  -  private void handleError(StylesheetHandler handler, int msg, Object [] args, Exception exc) throws org.xml.sax.SAXException
  -  {
  -    switch (getErrorType()) 
  -    {
  -        case (FATAL):
  -        case (ERROR):
  -                handler.error(msg, args, exc);          
  -                break;
  -        case (WARNING):
  -                handler.warn(msg, args);       
  -        default: break;
       }
     }
   }
  
  
  
  1.14.2.1  +3 -13     xml-xalan/java/src/org/apache/xalan/processor/XSLTElementProcessor.java
  
  Index: XSLTElementProcessor.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/XSLTElementProcessor.java,v
  retrieving revision 1.14
  retrieving revision 1.14.2.1
  diff -u -r1.14 -r1.14.2.1
  --- XSLTElementProcessor.java	10 Jul 2002 16:06:31 -0000	1.14
  +++ XSLTElementProcessor.java	14 Aug 2002 19:21:26 -0000	1.14.2.1
  @@ -338,9 +338,6 @@
       // Keep track of which XSLTAttributeDefs have been processed, so 
       // I can see which default values need to be set.
       Vector processedDefs = new Vector();
  -
  -    // Keep track of XSLTAttributeDefs that were invalid
  -    Vector errorDefs = new Vector();    
       int nAttrs = attributes.getLength();
   
       for (int i = 0; i < nAttrs; i++)
  @@ -376,17 +373,10 @@
         }
         else
         {
  -        // Can we switch the order here:
  -
  -        boolean success = attrDef.setAttrValue(handler, attrUri, attrLocalName,
  +        processedDefs.addElement(attrDef);
  +        attrDef.setAttrValue(handler, attrUri, attrLocalName,
                                attributes.getQName(i), attributes.getValue(i),
                                target);
  -                             
  -        // Now we only add the element if it passed a validation check
  -        if (success)
  -            processedDefs.addElement(attrDef);
  -        else
  -            errorDefs.addElement(attrDef);
         }
       }
   
  @@ -408,7 +398,7 @@
   
         if (attrDef.getRequired())
         {
  -        if ((!processedDefs.contains(attrDef)) && (!errorDefs.contains(attrDef)))
  +        if (!processedDefs.contains(attrDef))
             handler.error(
               XSLMessages.createMessage(
                 XSLTErrorResources.ER_REQUIRES_ATTRIB, new Object[]{ rawName,
  
  
  
  1.29.2.1  +210 -192  xml-xalan/java/src/org/apache/xalan/processor/XSLTSchema.java
  
  Index: XSLTSchema.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/XSLTSchema.java,v
  retrieving revision 1.29
  retrieving revision 1.29.2.1
  diff -u -r1.29 -r1.29.2.1
  --- XSLTSchema.java	26 Jul 2002 00:28:16 -0000	1.29
  +++ XSLTSchema.java	14 Aug 2002 19:21:26 -0000	1.29.2.1
  @@ -83,251 +83,202 @@
      */
     void build()
     {
  -	// xsl:import, xsl:include
  +
       XSLTAttributeDef hrefAttr = new XSLTAttributeDef(null, "href",
  -                                  XSLTAttributeDef.T_URL, true, false,XSLTAttributeDef.ERROR);
  -                                  
  -	// xsl:preserve-space, xsl:strip-space
  +                                  XSLTAttributeDef.T_URL, true);
  +    XSLTAttributeDef hrefAttrOpt = new XSLTAttributeDef(null, "href",
  +                                  XSLTAttributeDef.T_URL, false);
  +    
       XSLTAttributeDef elementsAttr = new XSLTAttributeDef(null, "elements",
                                         XSLTAttributeDef.T_SIMPLEPATTERNLIST,
  -                                      true, false, XSLTAttributeDef.ERROR);
  -                                      
  +                                      true);
       // XSLTAttributeDef anyNamespacedAttr = new XSLTAttributeDef("*", "*",
       //                                XSLTAttributeDef.T_CDATA, false);
  -    
  -    // xsl:output
       XSLTAttributeDef methodAttr = new XSLTAttributeDef(null, "method",
  -                                    XSLTAttributeDef.T_QNAME, false, false,XSLTAttributeDef.ERROR);
  +                                    XSLTAttributeDef.T_QNAME, false);
       XSLTAttributeDef versionAttr = new XSLTAttributeDef(null, "version",
  -                                     XSLTAttributeDef.T_NMTOKEN, false, false,XSLTAttributeDef.ERROR);
  +                                     XSLTAttributeDef.T_NMTOKEN, false);
       XSLTAttributeDef encodingAttr = new XSLTAttributeDef(null, "encoding",
  -                                      XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR);
  +                                      XSLTAttributeDef.T_CDATA, false);
       XSLTAttributeDef omitXmlDeclarationAttr = new XSLTAttributeDef(null,
                                                   "omit-xml-declaration",
                                                   XSLTAttributeDef.T_YESNO,
  -                                                false, false,XSLTAttributeDef.ERROR);
  +                                                false);
       XSLTAttributeDef standaloneAttr = new XSLTAttributeDef(null,
                                           "standalone",
  -                                        XSLTAttributeDef.T_YESNO, false, false,XSLTAttributeDef.ERROR);
  +                                        XSLTAttributeDef.T_YESNO, false);
       XSLTAttributeDef doctypePublicAttr = new XSLTAttributeDef(null,
                                              "doctype-public",
  -                                           XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR);
  +                                           XSLTAttributeDef.T_CDATA, false);
       XSLTAttributeDef doctypeSystemAttr = new XSLTAttributeDef(null,
                                              "doctype-system",
  -                                           XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR);
  +                                           XSLTAttributeDef.T_CDATA, false);
       XSLTAttributeDef cdataSectionElementsAttr = new XSLTAttributeDef(null,
                                                     "cdata-section-elements",
  -                                                  XSLTAttributeDef.T_QNAMES_RESOLVE_NULL,
  -                                                  false, false,XSLTAttributeDef.ERROR);
  +                                                  XSLTAttributeDef.T_QNAMES,
  +                                                  false);
       XSLTAttributeDef indentAttr = new XSLTAttributeDef(null, "indent",
  -                                    XSLTAttributeDef.T_YESNO, false, false,XSLTAttributeDef.ERROR);
  +                                    XSLTAttributeDef.T_YESNO, false);
       XSLTAttributeDef mediaTypeAttr = new XSLTAttributeDef(null, "media-type",
  -                                       XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.ERROR);
  -                                       
  -                  
  -    // Required.
  -    // It is an error if the name attribute is invalid on any of these elements
  -    // xsl:key, xsl:attribute-set, xsl:call-template, xsl:with-param, xsl:variable, xsl:param
  +                                       XSLTAttributeDef.T_CDATA, false);
       XSLTAttributeDef nameAttrRequired = new XSLTAttributeDef(null, "name",
  -                                          XSLTAttributeDef.T_QNAME, true, false,XSLTAttributeDef.ERROR);
  -	// Required.
  -    // Support AVT
  -    // xsl:element, xsl:attribute                                    
  -    XSLTAttributeDef nameAVTRequired = new XSLTAttributeDef(null, "name",
  -                                         XSLTAttributeDef.T_AVT_QNAME, true, true,XSLTAttributeDef.WARNING);
  -            
  -
  -    // Required.
  -    // Support AVT
  -    // xsl:processing-instruction                                     
  -    XSLTAttributeDef nameAVT_NCNAMERequired = new XSLTAttributeDef(null, "name",
  -                                         XSLTAttributeDef.T_NCNAME, true, true,XSLTAttributeDef.WARNING);
  -                                        
  -    // Optional.
  -    // Static error if invalid
  -    // xsl:template, xsl:decimal-format                                      
  -    XSLTAttributeDef nameAttrOpt_ERROR = new XSLTAttributeDef(null, "name",
  -                                     XSLTAttributeDef.T_QNAME, false, false,XSLTAttributeDef.ERROR);
  -
  -    // xsl:key                                 
  +                                          XSLTAttributeDef.T_QNAME, true);
  +    XSLTAttributeDef nameAttrOpt = new XSLTAttributeDef(null, "name",
  +                                     XSLTAttributeDef.T_QNAME, false);
       XSLTAttributeDef useAttr = new XSLTAttributeDef(null, "use",
  -                                 XSLTAttributeDef.T_EXPR, true, false,XSLTAttributeDef.ERROR);
  -           
  -    // xsl:element, xsl:attribute                              
  +                                 XSLTAttributeDef.T_EXPR, true);
  +    XSLTAttributeDef nameAVTRequired = new XSLTAttributeDef(null, "name",
  +                                         XSLTAttributeDef.T_AVT, true);
       XSLTAttributeDef namespaceAVTOpt = new XSLTAttributeDef(null,
  -                                         "namespace",XSLTAttributeDef.T_URL,
  -                                         false, true,XSLTAttributeDef.WARNING);
  -    // xsl:decimal-format                                     
  +                                         "namespace", XSLTAttributeDef.T_AVT,
  +                                         false);
       XSLTAttributeDef decimalSeparatorAttr = new XSLTAttributeDef(null,
                                                 "decimal-separator",
  -                                              XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR, ".");
  +                                              XSLTAttributeDef.T_CHAR, ".");
  +    XSLTAttributeDef groupingSeparatorAttr = new XSLTAttributeDef(null,
  +                                               "grouping-separator",
  +                                               XSLTAttributeDef.T_CHAR, ",");
       XSLTAttributeDef infinityAttr = new XSLTAttributeDef(null, "infinity",
  -                                      XSLTAttributeDef.T_CDATA, false,XSLTAttributeDef.ERROR,"Infinity");
  +                                      XSLTAttributeDef.T_CDATA, "Infinity");
       XSLTAttributeDef minusSignAttr = new XSLTAttributeDef(null, "minus-sign",
  -                                       XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR,"-");
  +                                       XSLTAttributeDef.T_CHAR, "-");
       XSLTAttributeDef NaNAttr = new XSLTAttributeDef(null, "NaN",
  -                                 XSLTAttributeDef.T_CDATA, false,XSLTAttributeDef.ERROR, "NaN");
  +                                 XSLTAttributeDef.T_CDATA, "NaN");
       XSLTAttributeDef percentAttr = new XSLTAttributeDef(null, "percent",
  -                                     XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR, "%");
  +                                     XSLTAttributeDef.T_CHAR, "%");
       XSLTAttributeDef perMilleAttr = new XSLTAttributeDef(null, "per-mille",
                                         XSLTAttributeDef.T_CHAR,
  -                                      false, false,XSLTAttributeDef.ERROR /* ,"&#x2030;" */);
  +                                      false /* ,"&#x2030;" */);
       XSLTAttributeDef zeroDigitAttr = new XSLTAttributeDef(null, "zero-digit",
  -                                       XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR, "0");
  +                                       XSLTAttributeDef.T_CHAR, "0");
       XSLTAttributeDef digitAttr = new XSLTAttributeDef(null, "digit",
  -                                   XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR, "#");
  +                                   XSLTAttributeDef.T_CHAR, "#");
       XSLTAttributeDef patternSeparatorAttr = new XSLTAttributeDef(null,
                                                 "pattern-separator",
  -                                              XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR, ";");
  -    // xsl:decimal-format                                         
  -    XSLTAttributeDef groupingSeparatorAttr = new XSLTAttributeDef(null,
  -                                               "grouping-separator",
  -                                               XSLTAttributeDef.T_CHAR, false,XSLTAttributeDef.ERROR,",");
  -
  -                                              
  -    // xsl:element, xsl:attribute-set, xsl:copy                                           
  +                                              XSLTAttributeDef.T_CHAR, ";");
       XSLTAttributeDef useAttributeSetsAttr = new XSLTAttributeDef(null,
                                                 "use-attribute-sets",
                                                 XSLTAttributeDef.T_QNAMES,
  -                                              false, false, XSLTAttributeDef.ERROR);
  -
  -    // xsl:if, xsl:when         
  -    XSLTAttributeDef testAttrRequired = new XSLTAttributeDef(null, "test",   
  -                                          XSLTAttributeDef.T_EXPR, true, false,XSLTAttributeDef.ERROR);
  -      
  -      
  -    // Required.                                       
  -    // xsl:value-of, xsl:for-each, xsl:copy-of                             
  +                                              false);
       XSLTAttributeDef selectAttrRequired = new XSLTAttributeDef(null,
                                               "select",
  -                                            XSLTAttributeDef.T_EXPR, true, false,XSLTAttributeDef.ERROR);
  -
  -    // Optional.                                          
  -    // xsl:variable, xsl:param, xsl:with-param                                       
  +                                            XSLTAttributeDef.T_EXPR, true);
  +    XSLTAttributeDef separatorAttr = new XSLTAttributeDef(null, "separator",
  +                                       XSLTAttributeDef.T_AVT, false);
  +    XSLTAttributeDef testAttrRequired = new XSLTAttributeDef(null, "test",
  +                                          XSLTAttributeDef.T_EXPR, true);
       XSLTAttributeDef selectAttrOpt = new XSLTAttributeDef(null, "select",
  -                                       XSLTAttributeDef.T_EXPR, false, false,XSLTAttributeDef.ERROR);
  -
  -    // Optional.
  -    // Default: "node()"
  -    // xsl:apply-templates                                           
  +                                       XSLTAttributeDef.T_EXPR, false);
       XSLTAttributeDef selectAttrDefNode = new XSLTAttributeDef(null, "select",
  -                                           XSLTAttributeDef.T_EXPR, false,XSLTAttributeDef.ERROR, "node()");
  -    // Optional.
  -    // Default: "."
  -    // xsl:sort                                        
  +                                           XSLTAttributeDef.T_EXPR, "node()");
       XSLTAttributeDef selectAttrDefDot = new XSLTAttributeDef(null, "select",
  -                                          XSLTAttributeDef.T_EXPR, false,XSLTAttributeDef.ERROR, ".");
  -    // xsl:key                                      
  +                                          XSLTAttributeDef.T_EXPR, ".");
       XSLTAttributeDef matchAttrRequired = new XSLTAttributeDef(null, "match",
  -                                           XSLTAttributeDef.T_PATTERN, true, false,XSLTAttributeDef.ERROR);
  -    // xsl:template                                       
  +                                           XSLTAttributeDef.T_PATTERN, true);
       XSLTAttributeDef matchAttrOpt = new XSLTAttributeDef(null, "match",
  -                                      XSLTAttributeDef.T_PATTERN, false, false,XSLTAttributeDef.ERROR);
  -    // xsl:template                                  
  +                                      XSLTAttributeDef.T_PATTERN, false);
       XSLTAttributeDef priorityAttr = new XSLTAttributeDef(null, "priority",
  -                                     XSLTAttributeDef.T_NUMBER, false, false,XSLTAttributeDef.ERROR);
  -                                     
  -    // xsl:template, xsl:apply-templates                                 
  +                                      XSLTAttributeDef.T_PRIORITY, false);
       XSLTAttributeDef modeAttr = new XSLTAttributeDef(null, "mode",
  -                                     XSLTAttributeDef.T_QNAME, false, false,XSLTAttributeDef.ERROR);
  -   
  +                                  XSLTAttributeDef.T_QNAME, false);
       XSLTAttributeDef spaceAttr =
  -      new XSLTAttributeDef(Constants.S_XMLNAMESPACEURI, "space", false, false, false, XSLTAttributeDef.WARNING,
  +      new XSLTAttributeDef(Constants.S_XMLNAMESPACEURI, "space", false,
                              "default", Constants.ATTRVAL_STRIP, "preserve",
                              Constants.ATTRVAL_PRESERVE);
  -                           
  -                         
       XSLTAttributeDef spaceAttrLiteral =
         new XSLTAttributeDef(Constants.S_XMLNAMESPACEURI, "space", 
  -                                          XSLTAttributeDef.T_URL, false, true,XSLTAttributeDef.ERROR);
  -    // xsl:namespace-alias                                      
  +                                          XSLTAttributeDef.T_AVT, false);
       XSLTAttributeDef stylesheetPrefixAttr = new XSLTAttributeDef(null,
                                                 "stylesheet-prefix",
  -                                              XSLTAttributeDef.T_CDATA, true, false,XSLTAttributeDef.ERROR);
  +                                              XSLTAttributeDef.T_CDATA, true);
       XSLTAttributeDef resultPrefixAttr = new XSLTAttributeDef(null,
                                             "result-prefix",
  -                                          XSLTAttributeDef.T_CDATA, true, false,XSLTAttributeDef.ERROR);
  -                                          
  -    // xsl:text, xsl:value-of                                      
  +                                          XSLTAttributeDef.T_CDATA, true);
       XSLTAttributeDef disableOutputEscapingAttr = new XSLTAttributeDef(null,
                                                      "disable-output-escaping",
                                                      XSLTAttributeDef.T_YESNO,
  -                                                   false, false,XSLTAttributeDef.ERROR);
  -                                                   
  -	// xsl:number                                                   
  -    XSLTAttributeDef levelAttr = new XSLTAttributeDef(null, "level", false, false, false, XSLTAttributeDef.ERROR,
  +                                                   false);
  +    XSLTAttributeDef levelAttr = new XSLTAttributeDef(null, "level", false,
                                      "single", Constants.NUMBERLEVEL_SINGLE,
                                      "multiple", Constants.NUMBERLEVEL_MULTI,
                                      "any", Constants.NUMBERLEVEL_ANY);
  +
       levelAttr.setDefault("single");
  +
       XSLTAttributeDef countAttr = new XSLTAttributeDef(null, "count",
  -                                   XSLTAttributeDef.T_PATTERN, false, false,XSLTAttributeDef.ERROR);
  +                                   XSLTAttributeDef.T_PATTERN, false);
       XSLTAttributeDef fromAttr = new XSLTAttributeDef(null, "from",
  -                                  XSLTAttributeDef.T_PATTERN, false, false,XSLTAttributeDef.ERROR);
  +                                  XSLTAttributeDef.T_PATTERN, false);
       XSLTAttributeDef valueAttr = new XSLTAttributeDef(null, "value",
  -                                   XSLTAttributeDef.T_EXPR, false, false,XSLTAttributeDef.ERROR);
  +                                   XSLTAttributeDef.T_EXPR, false);
       XSLTAttributeDef formatAttr = new XSLTAttributeDef(null, "format",
  -                                    XSLTAttributeDef.T_CDATA, false, true,XSLTAttributeDef.ERROR);
  +                                    XSLTAttributeDef.T_AVT, false);
  +
       formatAttr.setDefault("1");
  -    
  -    // xsl:number, xsl:sort
  +
       XSLTAttributeDef langAttr = new XSLTAttributeDef(null, "lang",
  -                                  XSLTAttributeDef.T_NMTOKEN, false, true,XSLTAttributeDef.ERROR);
  -   
  -    // xsl:number
  +                                  XSLTAttributeDef.T_AVT, false);
       XSLTAttributeDef letterValueAttr = new XSLTAttributeDef(null,
                                            "letter-value",
  -                                         false, true, false, XSLTAttributeDef.ERROR,
  -                                         "alphabetic", Constants.NUMBERLETTER_ALPHABETIC,
  -                                         "traditional", Constants.NUMBERLETTER_TRADITIONAL);
  -    // xsl:number
  +                                         XSLTAttributeDef.T_AVT, false);
       XSLTAttributeDef groupingSeparatorAVT = new XSLTAttributeDef(null,
                                                 "grouping-separator",
  -                                              XSLTAttributeDef.T_CHAR, false, true,XSLTAttributeDef.ERROR);
  -    // xsl:number
  +                                              XSLTAttributeDef.T_AVT, false);
       XSLTAttributeDef groupingSizeAttr = new XSLTAttributeDef(null,
                                             "grouping-size",
  -                                          XSLTAttributeDef.T_NUMBER, false, true,XSLTAttributeDef.ERROR);
  -   
  -   // xsl:sort
  -    XSLTAttributeDef dataTypeAttr = new XSLTAttributeDef(null, "data-type", false, true, true, XSLTAttributeDef.ERROR,
  -                                    "text", Constants.SORTDATATYPE_TEXT ,"number", Constants.SORTDATATYPE_TEXT);
  -	dataTypeAttr.setDefault("text");
  -	
  -	// xsl:sort
  -    XSLTAttributeDef orderAttr = new XSLTAttributeDef(null, "order", false, true, false,XSLTAttributeDef.ERROR,
  -                                    "ascending", Constants.SORTORDER_ASCENDING, 
  -                                    "descending", Constants.SORTORDER_DESCENDING);
  -    orderAttr.setDefault("ascending");
  -
  -    // xsl:sort                             
  -    XSLTAttributeDef caseOrderAttr = new XSLTAttributeDef(null, "case-order", false, true, false,XSLTAttributeDef.ERROR,
  -                                       "upper-first", Constants.SORTCASEORDER_UPPERFIRST ,
  -                                       "lower-first", Constants.SORTCASEORDER_LOWERFIRST);
  -	    
  -    // xsl:message                                   
  +                                          XSLTAttributeDef.T_AVT, false);
  +    XSLTAttributeDef dataTypeAttr = new XSLTAttributeDef(null, "data-type",
  +                                      XSLTAttributeDef.T_AVT, "text");
  +    XSLTAttributeDef orderAttr = new XSLTAttributeDef(null, "order",
  +                                   XSLTAttributeDef.T_AVT, "ascending");
  +    XSLTAttributeDef caseOrderAttr = new XSLTAttributeDef(null, "case-order",
  +                                       XSLTAttributeDef.T_AVT, false);
       XSLTAttributeDef terminateAttr = new XSLTAttributeDef(null, "terminate",
  -                                       XSLTAttributeDef.T_YESNO, false, false,XSLTAttributeDef.ERROR);
  +                                       XSLTAttributeDef.T_YESNO, false);
  +
       terminateAttr.setDefault("no");
   
  -	// top level attributes
       XSLTAttributeDef xslExcludeResultPrefixesAttr =
         new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL,
                              "exclude-result-prefixes",
  -                           XSLTAttributeDef.T_STRINGLIST, false, false,XSLTAttributeDef.ERROR);
  +                           XSLTAttributeDef.T_STRINGLIST, false);
       XSLTAttributeDef xslExtensionElementPrefixesAttr =
         new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL,
                              "extension-element-prefixes",
  -                           XSLTAttributeDef.T_PREFIX_URLLIST, false, false,XSLTAttributeDef.ERROR);
  -    // result-element-atts                       
  +                           XSLTAttributeDef.T_PREFIX_URLLIST, false);
       XSLTAttributeDef xslUseAttributeSetsAttr =
         new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL, "use-attribute-sets",
  -                           XSLTAttributeDef.T_QNAMES, false, false,XSLTAttributeDef.ERROR);
  +                           XSLTAttributeDef.T_QNAMES, false);
       XSLTAttributeDef xslVersionAttr =
         new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL, "version",
  -                           XSLTAttributeDef.T_NMTOKEN, false, false,XSLTAttributeDef.ERROR);
  -                           
  -    XSLTElementDef charData = new XSLTElementDef(this, null, "text()",
  +                           XSLTAttributeDef.T_NMTOKEN, false);
  +    //dml for result-document
  +    XSLTAttributeDef resultDocFormatAttr =
  +      new XSLTAttributeDef(null, "format",
  +                           XSLTAttributeDef.T_QNAME, false);
  +    // dml for output
  +    XSLTAttributeDef includeContentTypeAttr = new XSLTAttributeDef(null,
  +                                                   "include-content-type",
  +                                                   XSLTAttributeDef.T_YESNO,
  +                                                   false);
  +    XSLTAttributeDef escapeUriAttributesAttr = new XSLTAttributeDef(null,
  +                                                   "excape-uri-asttributes",
  +                                                   XSLTAttributeDef.T_YESNO,
  +                                                   false);
  +    
  +    XSLTAttributeDef groupByAttr = new XSLTAttributeDef(null,
  +                                            "group-by",
  +                                            XSLTAttributeDef.T_EXPR, false);                           
  +    XSLTAttributeDef groupAdjAttr = new XSLTAttributeDef(null,
  +                                            "group-adjacent",
  +                                            XSLTAttributeDef.T_EXPR, false);
  +    XSLTAttributeDef groupStartWithAttr = new XSLTAttributeDef(null,
  +                                            "group-starting-with",
  +                                            XSLTAttributeDef.T_EXPR, false);
  +    XSLTAttributeDef groupEndWithAttr = new XSLTAttributeDef(null,
  +                                            "group-ending-with",
  +                                            XSLTAttributeDef.T_EXPR, false);                                                                                                                                        
  +		XSLTElementDef charData = new XSLTElementDef(this, null, "text()",
                                   null /*alias */, null /* elements */, null,  /* attributes */
                                   new ProcessorCharacters(),
                                   ElemTextLiteral.class /* class object */);
  @@ -343,18 +294,17 @@
       charData.setType(XSLTElementDef.T_PCDATA);
   
       XSLTAttributeDef resultAttr = new XSLTAttributeDef(null, "*",
  -                                    XSLTAttributeDef.T_AVT, false, true,XSLTAttributeDef.WARNING);
  +                                    XSLTAttributeDef.T_AVT, false);
       XSLTAttributeDef xslResultAttr =
         new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL, "*",
  -                           XSLTAttributeDef.T_CDATA, false, false,XSLTAttributeDef.WARNING);
  -                           
  -    XSLTElementDef[] templateElements = new XSLTElementDef[22];
  -    XSLTElementDef[] templateElementsAndParams = new XSLTElementDef[23];
  -    XSLTElementDef[] templateElementsAndSort = new XSLTElementDef[23];
  +                           XSLTAttributeDef.T_CDATA, false);
  +    XSLTElementDef[] templateElements = new XSLTElementDef[26];
  +    XSLTElementDef[] templateElementsAndParams = new XSLTElementDef[27];
  +    XSLTElementDef[] templateElementsAndSort = new XSLTElementDef[27];
       //exslt
  -    XSLTElementDef[] exsltFunctionElements = new XSLTElementDef[23];
  +    XSLTElementDef[] exsltFunctionElements = new XSLTElementDef[27];// although should exclude some template elements.
       
  -    XSLTElementDef[] charTemplateElements = new XSLTElementDef[15];
  +    XSLTElementDef[] charTemplateElements = new XSLTElementDef[16];
       XSLTElementDef resultElement = new XSLTElementDef(this, null, "*",
                                        null /*alias */,
                                        templateElements /* elements */,
  @@ -377,21 +327,28 @@
                                                    xslVersionAttr,
                                                    xslResultAttr,
                                                    resultAttr }, 
  -                                                                                                 new ProcessorUnknown(),
  -                         ElemUnknown.class /* class object */, 20, true);
  +                                                 new ProcessorUnknown(),
  +                                                 ElemUnknown.class /* class object */, 20, true);
       XSLTElementDef xslValueOf = new XSLTElementDef(this,
                                     Constants.S_XSLNAMESPACEURL, "value-of",
                                     null /*alias */, null /* elements */,
                                     new XSLTAttributeDef[]{ selectAttrRequired,
  -                                                          disableOutputEscapingAttr }, 
  +                                                          disableOutputEscapingAttr,
  +                                                          separatorAttr }, 
                                                  new ProcessorTemplateElem(),
                                     ElemValueOf.class /* class object */, 20, true);
  -    XSLTElementDef xslCopyOf = new XSLTElementDef(this,
  -                                 Constants.S_XSLNAMESPACEURL, "copy-of",
  -                                 null /*alias */, null /* elements */,
  -                                 new XSLTAttributeDef[]{ selectAttrRequired },
  -                                 new ProcessorTemplateElem(),
  -                                 ElemCopyOf.class /* class object */, 20, true);
  +    XSLTElementDef xslCopyOf =
  +      new XSLTElementDef(
  +        this,
  +        Constants.S_XSLNAMESPACEURL,
  +        "copy-of",
  +        null,
  +        null,
  +        new XSLTAttributeDef[] { selectAttrRequired, separatorAttr },
  +        new ProcessorTemplateElem(),
  +        ElemCopyOf.class,
  +        20,
  +        true);
       XSLTElementDef xslNumber = new XSLTElementDef(this,
                                    Constants.S_XSLNAMESPACEURL, "number",
                                    null /*alias */, null /* elements */,
  @@ -450,6 +407,13 @@
                                                             spaceAttr }, 
                                                  new ProcessorTemplateElem(),
                                     ElemForEach.class /* class object */, true, false, true, 20, true);
  +		XSLTElementDef xslForEachGroup = new XSLTElementDef(this,
  +                                  Constants.S_XSLNAMESPACEURL, "for-each-group",
  +                                  null /*alias */, templateElementsAndSort,  // (#PCDATA %instructions; %result-elements; | xsl:sort)*
  +                                  new XSLTAttributeDef[]{ selectAttrRequired,
  +                                                          groupByAttr, groupAdjAttr, groupStartWithAttr, groupEndWithAttr }, 
  +                                               new ProcessorTemplateElem(),
  +                                  ElemForEachGroup.class /* class object */, true, false, true, 20, true);                                  
       XSLTElementDef xslIf = new XSLTElementDef(this,
                                                 Constants.S_XSLNAMESPACEURL,
                                                 "if", null /*alias */,
  @@ -526,7 +490,7 @@
                            "processing-instruction", null /*alias */,
                            charTemplateElements /* elements */,  // %char-template;>
                            new XSLTAttributeDef[]{
  -                                                  nameAVT_NCNAMERequired,
  +                                                  nameAVTRequired,
                                                     spaceAttr }, 
                                           new ProcessorTemplateElem(),
                             ElemPI.class /* class object */, 20, true);
  @@ -589,9 +553,56 @@
                                     new ProcessorExsltFuncResult(),
                                     ElemExsltFuncResult.class  /* class object */);            
       
  -
  +    //XSLT 2.0
  +    XSLTElementDef xslResult =   new XSLTElementDef(this, 
  +                                   Constants.S_XSLNAMESPACEURL,
  +                                   "result",
  +                                   null /*alias */,
  +                                   templateElements /* elements */,
  +                                   new XSLTAttributeDef[]{ selectAttrOpt },
  +                                   new ProcessorFuncResult(),
  +                                   ElemFuncResult.class  /* class object */);                
  +    XSLTElementDef[] xslFunctionElements = new XSLTElementDef[]
  +                                          {xslParam, xslVariable, 
  +                                           xslMessage, xslComment, 
  +                                           xslResult};                                                            
  +    XSLTElementDef xslFunction = new XSLTElementDef(this,
  +                                   Constants.S_XSLNAMESPACEURL,
  +                                   "function",
  +                                   null,
  +                                   xslFunctionElements,
  +                                   new XSLTAttributeDef[]{ nameAttrRequired },
  +                                   new ProcessorFunction(),
  +                                   ElemFunction.class /* class object */);
  +    
  +    XSLTElementDef xslPrincipalResultDocument = 
  +                                 new XSLTElementDef(this,
  +                                 Constants.S_XSLNAMESPACEURL, "principal-result-document",
  +                                 null /*alias */,
  +                                 templateElements,
  +                                 new XSLTAttributeDef[]{resultDocFormatAttr, hrefAttrOpt},
  +                                 new ProcessorResultDocument(),
  +                                 ElemPrincipalResultDocument.class);
  +
  +    XSLTElementDef xslResultDocument = 
  +                                 new XSLTElementDef(this,
  +                                 Constants.S_XSLNAMESPACEURL, "result-document",
  +                                 null /*alias */,
  +                                 templateElements,
  +                                 new XSLTAttributeDef[]{resultDocFormatAttr, hrefAttr},
  +                                 new ProcessorResultDocument(),
  +                                 ElemResultDocument.class);
  +                                 
  +    XSLTElementDef xslNamespace = new XSLTElementDef(this,
  +                                              Constants.S_XSLNAMESPACEURL,
  +                                              "namespace", null /*alias */,
  +                                              templateElements /* elements */,  // %template;
  +                                         new XSLTAttributeDef[]{nameAVTRequired}, 
  +                                         new ProcessorTemplateElem(),
  +                                              ElemNamespace.class /* class object */, 20, true);
  +                                 
  +    
       int i = 0;
  -
       templateElements[i++] = charData;  // #PCDATA
   
       // char-instructions
  @@ -599,6 +610,7 @@
       templateElements[i++] = xslCallTemplate;
       templateElements[i++] = xslApplyImports;
       templateElements[i++] = xslForEach;
  +		templateElements[i++] = xslForEachGroup;
       templateElements[i++] = xslValueOf;
       templateElements[i++] = xslCopyOf;
       templateElements[i++] = xslNumber;
  @@ -617,7 +629,10 @@
       templateElements[i++] = xslAttribute;
       templateElements[i++] = resultElement;
       templateElements[i++] = unknownElement;
  +    templateElements[i++] = xslResult;
       templateElements[i++] = exsltResult;
  +    templateElements[i++] = xslResultDocument; // May NOT appear in xslFunction or exsltFunction.
  +    templateElements[i++] = xslNamespace;
   
       int k;
   
  @@ -626,9 +641,7 @@
         templateElementsAndParams[k] = templateElements[k];
         templateElementsAndSort[k] = templateElements[k];
         exsltFunctionElements[k]     = templateElements[k];
  -
       }
  -
       templateElementsAndParams[k] = xslParam;
       templateElementsAndSort[k] = xslSort;
       exsltFunctionElements[k]   = xslParam;
  @@ -641,6 +654,7 @@
       charTemplateElements[i++] = xslCallTemplate;
       charTemplateElements[i++] = xslApplyImports;
       charTemplateElements[i++] = xslForEach;
  +	charTemplateElements[i++] = xslForEachGroup;
       charTemplateElements[i++] = xslValueOf;
       charTemplateElements[i++] = xslCopyOf;
       charTemplateElements[i++] = xslNumber;
  @@ -666,6 +680,7 @@
                                     new ProcessorInclude(),
                                     null /* class object */,
                                                  20, true);
  +    
       XSLTElementDef[] topLevelElements = new XSLTElementDef[]
                                    {includeDef,
                                     importDef,
  @@ -699,6 +714,7 @@
                                            null /*alias */,
                                            null /* elements */,
                                            new XSLTAttributeDef[]{
  +                                                  nameAttrOpt /*2.0-dml */, 
                                                     methodAttr,
                                                     versionAttr,
                                                     encodingAttr,
  @@ -709,7 +725,9 @@
                                                     cdataSectionElementsAttr,
                                                     indentAttr,
                                                     mediaTypeAttr,
  -                                                  XSLTAttributeDef.m_foreignAttr }, 
  +                                                  includeContentTypeAttr,
  +                                                  escapeUriAttributesAttr,
  +                                                  XSLTAttributeDef.m_foreignAttr },
                                             new ProcessorOutputElem(), null /* class object */, 20, true), 
                                     new XSLTElementDef(
                                             this,
  @@ -728,7 +746,7 @@
                                             null /*alias */,
                                             null /* elements */,  // EMPTY
                                             new XSLTAttributeDef[]{
  -                                                  nameAttrOpt_ERROR,
  +                                                  nameAttrOpt,
                                                     decimalSeparatorAttr,
                                                     groupingSeparatorAttr,
                                                     infinityAttr,
  @@ -783,7 +801,7 @@
                                              templateElementsAndParams /* elements */,
                                              new XSLTAttributeDef[]{
                                                      matchAttrOpt,
  -                                                   nameAttrOpt_ERROR,
  +                                                   nameAttrOpt,
                                                      priorityAttr,
                                                      modeAttr,
                                                      spaceAttr }, 
  @@ -816,33 +834,34 @@
                                                                   null,
                                                                   "lang",
                                                                   XSLTAttributeDef.T_NMTOKEN,
  -                                                                true, false,XSLTAttributeDef.WARNING),
  +                                                                true),
                                                               new XSLTAttributeDef(
  -                                                                null, "src", XSLTAttributeDef.T_URL, false, false,XSLTAttributeDef.WARNING) }, 
  +                                                                null, "src", XSLTAttributeDef.T_URL, false) }, 
                                                                   new ProcessorLRE(),
                                                                   ElemExtensionScript.class /* class object */, 20, true) },  // EMPTY
                                                               new XSLTAttributeDef[]{ 
                                                                   new XSLTAttributeDef(
  -                                                                    null, "prefix", XSLTAttributeDef.T_NMTOKEN, true, false,XSLTAttributeDef.WARNING),
  +                                                                    null, "prefix", XSLTAttributeDef.T_NMTOKEN, true),
                                                                   new XSLTAttributeDef(
  -                                                                    null, "elements", XSLTAttributeDef.T_STRINGLIST, false, false,XSLTAttributeDef.WARNING),
  +                                                                    null, "elements", XSLTAttributeDef.T_STRINGLIST, false),
                                                                   new XSLTAttributeDef(
  -                                                                    null, "functions", XSLTAttributeDef.T_STRINGLIST, false, false,XSLTAttributeDef.WARNING) }, 
  +                                                                    null, "functions", XSLTAttributeDef.T_STRINGLIST, false) }, 
                                                       new ProcessorLRE(), ElemExtensionDecl.class /* class object */),
  -                                  exsltFunction}/* exslt */;  //end of topevelElements
  +                                  exsltFunction, xslFunction/* exslt, stylesheet function*/,
  +                                  xslPrincipalResultDocument};  //end of topevelElements
       
       XSLTAttributeDef excludeResultPrefixesAttr =
         new XSLTAttributeDef(null, "exclude-result-prefixes",
  -                           XSLTAttributeDef.T_STRINGLIST, false,false,XSLTAttributeDef.WARNING);
  +                           XSLTAttributeDef.T_STRINGLIST, false);
       XSLTAttributeDef extensionElementPrefixesAttr =
         new XSLTAttributeDef(null, "extension-element-prefixes",
  -                           XSLTAttributeDef.T_PREFIX_URLLIST, false,false,XSLTAttributeDef.WARNING);
  +                           XSLTAttributeDef.T_PREFIX_URLLIST, false);
       XSLTAttributeDef idAttr = new XSLTAttributeDef(null, "id",
  -                                XSLTAttributeDef.T_CDATA, false,false,XSLTAttributeDef.WARNING);
  +                                XSLTAttributeDef.T_CDATA, false);
       XSLTAttributeDef versionAttrRequired = new XSLTAttributeDef(null,
                                                "version",
                                                XSLTAttributeDef.T_NMTOKEN,
  -                                             true,false,XSLTAttributeDef.WARNING);
  +                                             true);
       XSLTElementDef stylesheetElemDef = new XSLTElementDef(this,
                                            Constants.S_XSLNAMESPACEURL,
                                            "stylesheet", "transform",
  @@ -909,4 +928,3 @@
       return m_availElems.containsKey(elemName);
     }
   }
  -
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.4.1   +0 -0      xml-xalan/java/src/org/apache/xalan/processor/Attic/ProcessorFuncResult.java
  
  
  
  
  1.2.4.1   +1 -1      xml-xalan/java/src/org/apache/xalan/processor/Attic/ProcessorFunction.java
  
  
  
  
  1.2.4.1   +0 -0      xml-xalan/java/src/org/apache/xalan/processor/Attic/ProcessorResultDocument.java
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.29.2.1  +2 -76     xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.java
  
  Index: XSLTErrorResources.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.java,v
  retrieving revision 1.29
  retrieving revision 1.29.2.1
  diff -u -r1.29 -r1.29.2.1
  --- XSLTErrorResources.java	24 Jul 2002 14:15:03 -0000	1.29
  +++ XSLTErrorResources.java	14 Aug 2002 19:21:27 -0000	1.29.2.1
  @@ -934,9 +934,8 @@
     public static final int ER_FAILED_CREATING_ELEMLITRSLT = 203;
   
     
  -   /** Value for {0} should contain a parsable number   */
  -  public static final int ER_VALUE_SHOULD_BE_NUMBER = 204;
  -
  +   /** Priority value does not contain a parsable number   */
  +  public static final int ER_PRIORITY_NOT_PARSABLE = 204;
   
     
      /**  Value for {0} should equal 'yes' or 'no'   */
  @@ -1017,44 +1016,6 @@
   // ListingErrorHandler created with null PrintWriter!
     public static final int ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = 236;
   
  -  // {0}is not allowed in this position in the stylesheet!
  -  public static final int ER_NOT_ALLOWED_IN_POSITION = 237;
  -
  -  // Non-whitespace text is not allowed in this position in the stylesheet!
  -  public static final int ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION = 238;
  -  
  -  // This code is shared with warning codes.
  -  // Illegal value: {1} used for CHAR attribute: {0}.  An attribute of type CHAR must be only 1 character!
  -  public static final int INVALID_TCHAR = 239;
  -  
  -  // SystemId Unknown
  -  public static final int ER_SYSTEMID_UNKNOWN = 240;
  -    
  -  // Location of error unknown  
  -  public static final int ER_LOCATION_UNKNOWN = 241;
  -  
  -  //The following codes are shared with the warning codes... 
  -  // Illegal value: {1} used for QNAME attribute: {0}
  -  public static final int INVALID_QNAME = 242;   
  -   
  -  // Illegal value\u003a {1} used for ENUM attribute\u003a {0}.  Valid values are\u003a {2}.
  -  public static final int INVALID_ENUM = 243;
  -   
  -  // Illegal value\u003a {1} used for NMTOKEN attribute\u003a {0}. 
  -  public static final int INVALID_NMTOKEN = 244;
  -      
  -  // Illegal value\u003a {1} used for NCNAME attribute\u003a {0}. 
  -  public static final int INVALID_NCNAME = 245;  
  -   
  -  // Illegal value\u003a {1} used for boolean attribute\u003a {0}. 
  -  public static final int INVALID_BOOLEAN = 246;  
  -
  -  // Illegal value\u003a {1} used for number attribute\u003a {0}. 
  -  public static final int INVALID_NUMBER = 247;
  -  // End of shared codes...
  -  
  -
  -
     /*
       /**  Cannot find SAX1 driver class    *
     public static final int ER_CANNOT_FIND_SAX1_DRIVER = 190;
  @@ -1204,42 +1165,7 @@
   
     /** WG_EMPTY_SECOND_ARG          */
     public static final int WG_EMPTY_SECOND_ARG = 26;
  -  
  -  /** WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML          */
  -  public static final int WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML = 27;
  -  
  -  /** WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME          */
  -  public static final int WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME = 28;  
  -  
  -  
  -  //The following warning codes are shared with the error codes ... 
  -  // Illegal value: {1} used for CHAR attribute: {0}.  An attribute of type CHAR must be only 1 character!
  -  public static final int WG_INVALID_TCHAR = 239;
  -  
  -  
  -  // Illegal value: {1} used for QNAME attribute: {0}
  -  public static final int WG_INVALID_QNAME = 242;
  -  
  -   
  -  // Illegal value\u003a {1} used for ENUM attribute\u003a {0}.  Valid values are\u003a {2}.
  -  public static final int WG_INVALID_ENUM = 243;
  -  
  -   
  -  // Illegal value\u003a {1} used for NMTOKEN attribute\u003a {0}. 
  -  public static final int WG_INVALID_NMTOKEN = 244;
  -  
  -      
  -  // Illegal value\u003a {1} used for NCNAME attribute\u003a {0}. 
  -  public static final int WG_INVALID_NCNAME = 245;
  -  
  -   
  -  // Illegal value\u003a {1} used for boolean attribute\u003a {0}. 
  -  public static final int WG_INVALID_BOOLEAN = 246;
  -  
   
  -  // Illegal value\u003a {1} used for number attribute\u003a {0}. 
  -  public static final int WG_INVALID_NUMBER = 247;
  -  // End of codes that are shared...
   
     // Other miscellaneous text used inside the code...
   
  
  
  
  1.9.2.1   +3 -54     xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.properties
  
  Index: XSLTErrorResources.properties
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.properties,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  --- XSLTErrorResources.properties	29 Jul 2002 18:47:00 -0000	1.9
  +++ XSLTErrorResources.properties	14 Aug 2002 19:21:27 -0000	1.9.2.1
  @@ -175,7 +175,7 @@
   # ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER
   ER0084=Can't resolve prefix of non-Prefix resolver!
   # ER_REDIRECT_COULDNT_GET_FILENAME
  -ER0085=Redirect extension\u003a Could not get filename - file or select attribute must return valid string.
  +ER0085=Redirect extension\u003a Could not get filename - file or select attribute must return vald string.
   # ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT
   ER0086=Can not build FormatterListener in Redirect extension!
   # ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX
  @@ -412,8 +412,8 @@
   ER0202=Cannot initialize URI with empty parameters
   # ER_FAILED_CREATING_ELEMLITRSLT
   ER0203=Failed creating ElemLiteralResult instance
  -# ER_VALUE_SHOULD_BE_NUMBER
  -ER0204=Value for {0} should contain a parsable number
  +# ER_PRIORITY_NOT_PARSABLE
  +ER0204=Priority value does not contain a parsable number
   # ER_VALUE_SHOULD_EQUAL
   ER0205= Value for {0} should equal yes or no
   # ER_FAILED_CALLING_METHOD
  @@ -480,30 +480,6 @@
   ER0235=Axis traverser not supported: {0}
   # ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER!
   ER0236=ListingErrorHandler created with null PrintWriter!
  -# ER_NOT_ALLOWED_IN_POSITION
  -ER0237={0} is not allowed in this position in the stylesheet!
  -# ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION
  -ER0238=Non-whitespace text is not allowed in this position in the stylesheet!
  -# INVALID_TCHAR
  -ER0239=Illegal value: {1} used for CHAR attribute: {0}.  An attribute of type CHAR must be only 1 character!
  -# ER_SYSTEMID_UNKNOWN
  -ER0240=SystemId Unknown
  -# ER_LOCATION_UNKNOWN
  -ER0241=Location of error unknown
  -# INVALID_QNAME 	
  -ER0242=Illegal value\u003a {1} used for QNAME attribute\u003a {0}
  -# INVALID_ENUM
  -ER0243=Illegal value\u003a {1} used for ENUM attribute\u003a {0}.  Valid values are\u003a {2}.
  -# INVALID NMTOKEN
  -ER0244=Illegal value\u003a {1} used for NMTOKEN attribute\u003a {0} 
  -# INVALID_NCNAME
  -ER0245=Illegal value\u003a {1} used for NCNAME attribute\u003a {0} 
  -# INVALID_BOOLEAN 
  -ER0246=Illegal value\u003a {1} used for boolean attribute\u003a {0} 
  -# INVALID_NUMBER 
  -ER0247=Illegal value\u003a {1} used for number attribute\u003a {0} 
  -
  -
   
   # WG_FOUND_CURLYBRACE 
   WR0001=Found '}' but no attribute template open!
  @@ -557,33 +533,6 @@
   WR0025=Illegal value used for attribute {0}\u003a {1}
   # WG_EMPTY_SECOND_ARG 
   WR0026=Resulting nodeset from second argument of document function is empty. The first agument will be used.
  -# WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML
  -WR0027=processing-instruction name can not be 'xml'
  -# WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME
  -WR0028=processing-instruction name must be a valid NCName\u003a {0}
  -
  -
  -# INVALID_TCHAR
  -WR0239=Illegal value: {1} used for CHAR attribute: {0}.  An attribute of type CHAR must be only 1 character!
  -
  -# INVALID_QNAME	
  -WR0242=Illegal value\u003a {1} used for QNAME attribute\u003a {0}
  -
  -# INVALID_ENUM
  -WR0243=Illegal value\u003a {1} used for ENUM attribute\u003a {0}.  Valid values are\u003a {2}.
  -
  -# INVALID NMTOKEN
  -WR0244=Illegal value\u003a {1} used for NMTOKEN attribute\u003a {0} 
  -
  -# INVALID_NCNAME
  -WR0245=Illegal value\u003a {1} used for NCNAME attribute\u003a {0} 
  -
  -# INVALID_BOOLEAN
  -WR0246=Illegal value\u003a {1} used for boolean attribute\u003a {0} 
  -
  -# INVALID_NUMBER
  -WR0247=Illegal value\u003a {1} used for number attribute\u003a {0} 
  -
   ui_language=en
   help_language=en
   language=en
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.11.2.1  +73 -56    xml-xalan/java/src/org/apache/xalan/serialize/Encodings.java
  
  Index: Encodings.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/serialize/Encodings.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- Encodings.java	25 Jul 2002 16:11:22 -0000	1.11
  +++ Encodings.java	14 Aug 2002 19:21:27 -0000	1.11.2.1
  @@ -197,11 +197,10 @@
      */
     public static int getLastPrintable(String encoding)
     {
  -
       for (int i = 0; i < _encodings.length; ++i)
       {
         if (_encodings[i].name.equalsIgnoreCase(encoding)
  -              || _encodings[i].javaName.equalsIgnoreCase(encoding))
  +        || _encodings[i].javaName.equalsIgnoreCase(encoding))
           return _encodings[i].lastPrintable;
       }
   
  @@ -341,78 +340,96 @@
     private static EncodingInfo[] loadEncodingInfo()
     {
       URL url = null;
  -    try {
  -      String urlString = null;
  -      try {
  -        urlString = System.getProperty("org.apache.xalan.serialize.encodings", "");
  -      }
  -      catch (SecurityException e) {}
  -      
  +    try
  +    {
  +      String urlString =
  +        System.getProperty("org.apache.xalan.serialize.encodings", "");
         if (urlString != null && urlString.length() > 0)
  -        url = new URL (urlString);
  -      if (url == null) {
  -        ClassLoader cl = null;          
  -        try{
  -          java.lang.reflect.Method getCCL = Thread.class.getMethod("getContextClassLoader", NO_CLASSES);
  -          if (getCCL != null) {
  +        url = new URL(urlString);
  +      if (url == null)
  +      {
  +        ClassLoader cl = null;
  +        try
  +        {
  +          java.lang.reflect.Method getCCL =
  +            Thread.class.getMethod("getContextClassLoader", NO_CLASSES);
  +          if (getCCL != null)
  +          {
               cl = (ClassLoader) getCCL.invoke(Thread.currentThread(), NO_OBJS);
             }
           }
  -        catch (Exception e) {}
  -        if (cl != null) {
  +        catch (Exception e)
  +        {
  +        }
  +        if (cl != null)
  +        {
             url = cl.getResource(ENCODINGS_FILE);
           }
         }
         if (url == null)
           url = ClassLoader.getSystemResource(ENCODINGS_FILE);
   
  -      Properties props = new Properties ();
  -      if (url != null) {
  +      Properties props = new Properties();
  +      if (url != null)
  +      {
           InputStream is = url.openStream();
           props.load(is);
           is.close();
         }
  -      else {
  -      // Seems to be no real need to force failure here, let the system
  -      //   do its best... The issue is not really very critical, and the
  -      //   output will be in any case _correct_ though maybe not always
  -      //   human-friendly... :)
  -      // But maybe report/log the resource problem?
  -      // Any standard ways to report/log errors in Xalan (in static context)?
  -      }
  -
  -      int totalEntries = props.size();
  -      EncodingInfo[] ret = new EncodingInfo[totalEntries];
  -      Enumeration keys = props.keys();
  -      for (int i = 0; i < totalEntries; ++i) {
  -        String mimeName = (String) keys.nextElement();
  -        String val = props.getProperty(mimeName);
  -        int pos = val.indexOf(' ');
  -        String javaName;
  -        int lastPrintable;
  -        if (pos < 0)
  -        {
  -          // Maybe report/log this problem?
  -          //  "Last printable character not defined for encoding " +
  -          //  mimeName + " (" + val + ")" ...
  -          javaName = val;
  -          lastPrintable = 0x00FF;
  -        }
  -        else
  -        {
  -          javaName = val.substring(0, pos);
  -          lastPrintable =
  -                         Integer.decode(val.substring(pos).trim()).intValue();
  -        }
  -        ret [i] = new EncodingInfo (mimeName, javaName, lastPrintable);
  +      else
  +      {
  +        // Seems to be no real need to force failure here, let the system
  +        //   do its best... The issue is not really very critical, and the
  +        //   output will be in any case _correct_ though maybe not always
  +        //   human-friendly... :)
  +        // But maybe report/log the resource problem?
  +        // Any standard ways to report/log errors in Xalan (in static context)?
         }
  -      return ret;
  -    } catch (java.net.MalformedURLException mue) {
  +
  +      return loadEncodingInfoFromProps(props);
  +    }
  +    catch (java.net.MalformedURLException mue)
  +    {
         throw new org.apache.xml.utils.WrappedRuntimeException(mue);
       }
  -    catch (java.io.IOException ioe) {
  +    catch (java.io.IOException ioe)
  +    {
         throw new org.apache.xml.utils.WrappedRuntimeException(ioe);
       }
  +    catch(Exception ex)
  +    {
  +      return loadEncodingInfoFromProps(new Properties());
  +    }
  +  }
  +
  +  private static EncodingInfo[] loadEncodingInfoFromProps(Properties props)
  +  {
  +    int totalEntries = props.size();
  +    EncodingInfo[] ret = new EncodingInfo[totalEntries];
  +    Enumeration keys = props.keys();
  +    for (int i = 0; i < totalEntries; ++i)
  +    {
  +      String mimeName = (String) keys.nextElement();
  +      String val = props.getProperty(mimeName);
  +      int pos = val.indexOf(' ');
  +      String javaName;
  +      int lastPrintable;
  +      if (pos < 0)
  +      {
  +        // Maybe report/log this problem?
  +        //  "Last printable character not defined for encoding " +
  +        //  mimeName + " (" + val + ")" ...
  +        javaName = val;
  +        lastPrintable = 0x00FF;
  +      }
  +      else
  +      {
  +        javaName = val.substring(0, pos);
  +        lastPrintable = Integer.decode(val.substring(pos).trim()).intValue();
  +      }
  +      ret[i] = new EncodingInfo(mimeName, javaName, lastPrintable);
  +    }
  +    return ret;
     }
   
     private static final EncodingInfo[] _encodings = loadEncodingInfo();
  
  
  
  1.4.12.1  +2 -2      xml-xalan/java/src/org/apache/xalan/serialize/HTMLEntities.res
  
  Index: HTMLEntities.res
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/serialize/HTMLEntities.res,v
  retrieving revision 1.4
  retrieving revision 1.4.12.1
  diff -u -r1.4 -r1.4.12.1
  
  
  
  1.16.2.1  +16 -6     xml-xalan/java/src/org/apache/xalan/serialize/SerializerToXML.java
  
  Index: SerializerToXML.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/serialize/SerializerToXML.java,v
  retrieving revision 1.16
  retrieving revision 1.16.2.1
  diff -u -r1.16 -r1.16.2.1
  --- SerializerToXML.java	21 Jun 2002 18:54:33 -0000	1.16
  +++ SerializerToXML.java	14 Aug 2002 19:21:27 -0000	1.16.2.1
  @@ -2005,12 +2005,22 @@
     
           m_inDoctype = false;
         }
  -
  -       
  -      writer.write("<!ATTLIST ");
  -      writer.write(eName);
  -      writer.write(" "); 
  -
  +  
  +      if (!eName.equals(m_elemName))
  +      {
  +        writer.write("<!ATTLIST ");
  +        writer.write(eName);
  +        writer.write(" ");
  +  
  +        m_elemName = eName;
  +      }
  +      else
  +      {
  +        m_pos -= 3;
  +  
  +        writer.write(m_lineSep, 0, m_lineSepLen);
  +      }
  +  
         writer.write(aName);
         writer.write(" ");
         writer.write(type);
  
  
  
  1.2.12.1  +2 -2      xml-xalan/java/src/org/apache/xalan/serialize/XMLEntities.res
  
  Index: XMLEntities.res
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/serialize/XMLEntities.res,v
  retrieving revision 1.2
  retrieving revision 1.2.12.1
  diff -u -r1.2 -r1.2.12.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.18.2.1  +5 -16     xml-xalan/java/src/org/apache/xalan/templates/AVT.java
  
  Index: AVT.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/AVT.java,v
  retrieving revision 1.18
  retrieving revision 1.18.2.1
  diff -u -r1.18 -r1.18.2.1
  --- AVT.java	10 Jul 2002 16:06:31 -0000	1.18
  +++ AVT.java	14 Aug 2002 19:21:28 -0000	1.18.2.1
  @@ -66,6 +66,7 @@
   
   import javax.xml.transform.TransformerException;
   
  +import org.apache.xpath.VariableComposeState;
   import org.apache.xpath.XPathContext;
   import org.apache.xpath.XPath;
   import org.apache.xalan.res.XSLTErrorResources;
  @@ -592,14 +593,9 @@
     /**
      * This function is used to fixup variables from QNames to stack frame 
      * indexes at stylesheet build time.
  -   * @param vars List of QNames that correspond to variables.  This list 
  -   * should be searched backwards for the first qualified name that 
  -   * corresponds to the variable reference qname.  The position of the 
  -   * QName in the vector from the start of the vector will be its position 
  -   * in the stack frame (but variables above the globalsTop value will need 
  -   * to be offset to the current stack frame).
  +   * @param vcs variable compose state.
      */
  -  public void fixupVariables(java.util.Vector vars, int globalsSize)
  +  public void fixupVariables(VariableComposeState vcs)
     {
       if (null != m_parts)
       {
  @@ -609,7 +605,7 @@
         {
           AVTPart part = (AVTPart) m_parts.elementAt(i);
   
  -        part.fixupVariables(vars, globalsSize);
  +        part.fixupVariables(vcs);
         }
       }
     }
  @@ -631,12 +627,5 @@
         }  		
     	}
     }
  -
  -
  -  /**
  -   * Returns true if this AVT is simple
  -   */
  -  public boolean isSimple() {
  -  	return m_simpleString != null;
  -  }
  +
   }
  
  
  
  1.11.4.1  +2 -1      xml-xalan/java/src/org/apache/xalan/templates/AVTPart.java
  
  Index: AVTPart.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/AVTPart.java,v
  retrieving revision 1.11
  retrieving revision 1.11.4.1
  diff -u -r1.11 -r1.11.4.1
  --- AVTPart.java	22 Mar 2002 01:04:40 -0000	1.11
  +++ AVTPart.java	14 Aug 2002 19:21:28 -0000	1.11.4.1
  @@ -59,6 +59,7 @@
   //import org.w3c.dom.*;
   import org.apache.xml.dtm.DTM;
   
  +import org.apache.xpath.VariableComposeState;
   import org.apache.xpath.XPathContext;
   import org.apache.xml.utils.FastStringBuffer;
   
  @@ -127,7 +128,7 @@
      * in the stack frame (but variables above the globalsTop value will need 
      * to be offset to the current stack frame).
      */
  -  public abstract void fixupVariables(java.util.Vector vars, int globalsSize);
  +  public abstract void fixupVariables(VariableComposeState vcs);
   
   
   }
  
  
  
  1.11.4.1  +3 -7      xml-xalan/java/src/org/apache/xalan/templates/AVTPartSimple.java
  
  Index: AVTPartSimple.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/AVTPartSimple.java,v
  retrieving revision 1.11
  retrieving revision 1.11.4.1
  diff -u -r1.11 -r1.11.4.1
  --- AVTPartSimple.java	22 Mar 2002 01:04:40 -0000	1.11
  +++ AVTPartSimple.java	14 Aug 2002 19:21:28 -0000	1.11.4.1
  @@ -58,6 +58,7 @@
   
   //import org.w3c.dom.*;
   
  +import org.apache.xpath.VariableComposeState;
   import org.apache.xpath.XPathContext;
   import org.apache.xml.utils.FastStringBuffer;
   
  @@ -96,14 +97,9 @@
     /**
      * This function is used to fixup variables from QNames to stack frame 
      * indexes at stylesheet build time.
  -   * @param vars List of QNames that correspond to variables.  This list 
  -   * should be searched backwards for the first qualified name that 
  -   * corresponds to the variable reference qname.  The position of the 
  -   * QName in the vector from the start of the vector will be its position 
  -   * in the stack frame (but variables above the globalsTop value will need 
  -   * to be offset to the current stack frame).
  +   * @param vars Variable compose state.
      */
  -  public void fixupVariables(java.util.Vector vars, int globalsSize)
  +  public void fixupVariables(VariableComposeState vcs)
     {
       // no-op
     }
  
  
  
  1.14.4.1  +7 -7      xml-xalan/java/src/org/apache/xalan/templates/AVTPartXPath.java
  
  Index: AVTPartXPath.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/AVTPartXPath.java,v
  retrieving revision 1.14
  retrieving revision 1.14.4.1
  diff -u -r1.14 -r1.14.4.1
  --- AVTPartXPath.java	22 Mar 2002 01:04:40 -0000	1.14
  +++ AVTPartXPath.java	14 Aug 2002 19:21:28 -0000	1.14.4.1
  @@ -60,7 +60,6 @@
   import org.apache.xpath.Expression;
   import org.apache.xpath.objects.XObject;
   import org.apache.xpath.XPathContext;
  -import org.apache.xpath.compiler.XPathParser;
   import org.apache.xml.utils.FastStringBuffer;
   import org.apache.xpath.ExpressionOwner;
   
  @@ -90,9 +89,9 @@
      * in the stack frame (but variables above the globalsTop value will need 
      * to be offset to the current stack frame).
      */
  -  public void fixupVariables(java.util.Vector vars, int globalsSize)
  +  public void fixupVariables(VariableComposeState vcs)
     {
  -    m_xpath.fixupVariables(vars, globalsSize);
  +    m_xpath.fixupVariables(vcs);
     }
     
     /**
  @@ -136,11 +135,12 @@
      */
     public AVTPartXPath(
             String val, org.apache.xml.utils.PrefixResolver nsNode, 
  -          XPathParser xpathProcessor, XPathFactory factory, 
  -          XPathContext liaison)
  +          Object xpathProcessor, XPathFactory factory, 
  +          XPathContext liaison, double version)
               throws javax.xml.transform.TransformerException
     {
  -    m_xpath = new XPath(val, null, nsNode, XPath.SELECT, liaison.getErrorListener());
  +    m_xpath = new XPath(val, null, nsNode, XPath.SELECT, 
  +      liaison.getErrorListener(), version);
     }
   
     /**
  @@ -172,7 +172,7 @@
               throws javax.xml.transform.TransformerException
     {
   
  -    XObject xobj = m_xpath.execute(xctxt, context, nsNode);
  +    XObject xobj = m_xpath.execute(xctxt, /* context, */ nsNode);
   
       if (null != xobj)
       {
  
  
  
  1.14.2.1  +27 -15    xml-xalan/java/src/org/apache/xalan/templates/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/Constants.java,v
  retrieving revision 1.14
  retrieving revision 1.14.2.1
  diff -u -r1.14 -r1.14.2.1
  --- Constants.java	10 Jul 2002 16:06:31 -0000	1.14
  +++ Constants.java	14 Aug 2002 19:21:28 -0000	1.14.2.1
  @@ -174,6 +174,7 @@
                                 ELEMNAME_STRIPSPACE = 32,
                                 ELEMNAME_STYLESHEET = 25, ELEMNAME_TEXT = 42,
                                 ELEMNAME_VALUEOF = 30, ELEMNAME_WHEN = 38,
  +		                          ELEMNAME_FOREACHGROUP = 94,
   
     // Pattern by example support  
     ELEMNAME_ROOT = 44, ELEMNAME_ANY = 45, ELEMNAME_ELEMENT = 46,
  @@ -196,7 +197,7 @@
     ELEMNAME_EXTENSIONSCRIPT = 86, ELEMNAME_OUTPUT = 80,
     ELEMNAME_COMPONENT = 81, ELEMNAME_SCRIPT = 82;
   
  -  // Next free number: 90 (88 and 89 used for EXSLT elements);
  +  // Next free number: 96 (88-93 used for XSLT2.0 and EXSLT elements);
   
     /**
      * Literals for XSL element names.  Note that there are more
  @@ -237,6 +238,7 @@
         ELEMNAME_EXTENSION_STRING = "functions",
         ELEMNAME_FALLBACK_STRING = "fallback",
         ELEMNAME_FOREACH_STRING = "for-each",
  +	  ELEMNAME_FOREACHGROUP_STRING = "for-each-group",
         ELEMNAME_IF_STRING = "if",
         ELEMNAME_IMPORT_STRING = "import",
         ELEMNAME_INCLUDE_STRING = "include",
  @@ -272,16 +274,32 @@
         ELEMNAME_WITHPARAM_STRING = "with-param";
     
     /**
  +   * Literals for XSLT 2.0 elements (stylesheet function; principal and 
  +   * secondary result documents).
  +   */
  +  public static final String
  +    ELEMNAME_FUNCTION_STRING = "function",
  +    ELEMNAME_FUNCRESULT_STRING = "result",
  +    ELEMNAME_PRINCIPALRESULTDOCUMENT_STRING = "principal-result-document",
  +    ELEMNAME_RESULTDOCUMENT_STRING = "result-document",
  +    ELEMNAME_NAMESPACE_STRING = "namespace";
  +  public static final int
  +    ELEMNAME_FUNCTION = 88,
  +    ELEMNAME_FUNCRESULT = 89,
  +    ELEMNAME_PRINCIPALRESULTDOCUMENT = 90,
  +    ELEMNAME_RESULTDOCUMENT = 91,
  +    ELEMNAME_NAMESPACE = 95;
  +  
  +  /**
      * Literals for EXSLT function elements.
      */
     public static final String
       EXSLT_ELEMNAME_FUNCTION_STRING = "function",
       EXSLT_ELEMNAME_FUNCRESULT_STRING = "result";
     public static final int
  -    EXSLT_ELEMNAME_FUNCTION = 88,
  -    EXSLT_ELEMNAME_FUNCRESULT = 89;
  -  
  -  
  +    EXSLT_ELEMNAME_FUNCTION = 92,
  +    EXSLT_ELEMNAME_FUNCRESULT = 93;
  +    
     /**
      * Literals for XSL attribute names.  Note that there may be more
      * names than IDs, because some names may map to the same ID.
  @@ -317,6 +335,10 @@
         ATTRNAME_FROM = "from",
         ATTRNAME_GROUPINGSEPARATOR = "grouping-separator",
         ATTRNAME_GROUPINGSIZE = "grouping-size",
  +		  ATTRNAME_GROUPBY = "group-by",
  +      ATTRNAME_GROUPADJACENT = "group-adjacent",
  +      ATTRNAME_GROUPSTARTING_WITH = "group-starting-with",
  +      ATTRNAME_GROUPENDING_WITH = "group-ending-with",
         ATTRNAME_HREF = "href",
         ATTRNAME_ID = "id",
         ATTRNAME_IMPORTANCE = "importance",
  @@ -463,8 +485,6 @@
     /** For Stylesheet-prefix and result-prefix in xsl:namespace-alias          */
     public static final String ATTRVAL_DEFAULT_PREFIX = "#default";
   
  - /** Integer equivalents for above        */
  -  public static final int NUMBERLETTER_ALPHABETIC = 1, NUMBERLETTER_TRADITIONAL = 2;
     
     /** Integer equivelents for above        */
     public static final int NUMBERLEVEL_SINGLE = 1, NUMBERLEVEL_MULTI = 2,
  @@ -484,14 +504,6 @@
                                ATTRVAL_CASEORDER_UPPER = "upper-first",
                                ATTRVAL_CASEORDER_LOWER = "lower-first";
   
  - /** Integer equivelents for DATATYPE attribute */
  -  public static final int SORTDATATYPE_TEXT = 1, SORTDATATYPE_NUMBER = 2;
  -
  -  /** Integer equivelents for ORDER attribute */
  -  public static final int SORTORDER_ASCENDING = 1, SORTORDER_DESCENDING = 2;
  -  
  -  /** Integer equivelents for CASE-ORDER attribute */
  -  public static final int SORTCASEORDER_UPPERFIRST = 1, SORTCASEORDER_LOWERFIRST = 2;
     
     /** some stuff for Decimal-format       */
     public static final String ATTRVAL_INFINITY = "Infinity",
  
  
  
  1.25.2.1  +8 -7      xml-xalan/java/src/org/apache/xalan/templates/ElemApplyTemplates.java
  
  Index: ElemApplyTemplates.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemApplyTemplates.java,v
  retrieving revision 1.25
  retrieving revision 1.25.2.1
  diff -u -r1.25 -r1.25.2.1
  --- ElemApplyTemplates.java	24 Jul 2002 17:06:46 -0000	1.25
  +++ ElemApplyTemplates.java	14 Aug 2002 19:21:28 -0000	1.25.2.1
  @@ -69,7 +69,9 @@
   import org.apache.xpath.VariableStack;
   import org.apache.xpath.XPath;
   import org.apache.xpath.XPathContext;
  +import org.apache.xpath.objects.XNodeSequenceSingleton;
   import org.apache.xpath.objects.XObject;
  +import org.apache.xpath.objects.XSequence;
   import org.xml.sax.ContentHandler;
   import org.xml.sax.SAXException;
   
  @@ -295,8 +297,8 @@
           vars.setStackFrame(argsFrame);
         }
         
  -      xctxt.pushCurrentNode(DTM.NULL);
  -      int[] currentNodes = xctxt.getCurrentNodeStack();
  +      xctxt.pushCurrentItem(XSequence.EMPTY);
  +      // XObject[] currentNodes = xctxt.getCurrentItemStack();
         int currentNodePos = xctxt.getCurrentNodeFirstFree() - 1;
         
         xctxt.pushCurrentExpressionNode(DTM.NULL);
  @@ -311,13 +313,12 @@
         int child;
         while (DTM.NULL != (child = sourceNodes.nextNode()))
         {
  -        currentNodes[currentNodePos] = child;
  -        currentExpressionNodes[currentExpressionNodePos] = child;
  -
           if(xctxt.getDTM(child) != dtm)
           {
             dtm = xctxt.getDTM(child);
           }
  +        xctxt.setCurrentNode(child);
  +        currentExpressionNodes[currentExpressionNodePos] = child;
           
           final int exNodeType = dtm.getExpandedTypeID(child);
           final int nodeType = dtm.getNodeType(child);
  @@ -364,8 +365,8 @@
           }
                   
           transformer.pushPairCurrentMatched(template, child);
  -        if (check)
  -	        guard.checkForInfinateLoop();
  +        if(check)
  +          guard.checkForInfinateLoop();
   
           int currentFrameBottom;  // See comment with unlink, below
           if(template.m_frameSize > 0)
  
  
  
  1.18.2.1  +0 -14     xml-xalan/java/src/org/apache/xalan/templates/ElemAttribute.java
  
  Index: ElemAttribute.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemAttribute.java,v
  retrieving revision 1.18
  retrieving revision 1.18.2.1
  diff -u -r1.18 -r1.18.2.1
  --- ElemAttribute.java	10 Jul 2002 16:06:31 -0000	1.18
  +++ ElemAttribute.java	14 Aug 2002 19:21:28 -0000	1.18.2.1
  @@ -293,18 +293,4 @@
   
       return super.appendChild(newChild);
     }
  -	/**
  -	 * @see ElemElement#setName(AVT)
  -	 */
  -	public void setName(AVT v) {
  -        if (v.isSimple())
  -        {
  -            if (v.getSimpleString().equals("xmlns"))
  -            {
  -                throw new IllegalArgumentException();
  -            }
  -        }
  -		super.setName(v);
  -	}
  -
   }
  
  
  
  1.14.4.1  +144 -47   xml-xalan/java/src/org/apache/xalan/templates/ElemCopyOf.java
  
  Index: ElemCopyOf.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemCopyOf.java,v
  retrieving revision 1.14
  retrieving revision 1.14.4.1
  diff -u -r1.14 -r1.14.4.1
  --- ElemCopyOf.java	24 Mar 2002 00:57:52 -0000	1.14
  +++ ElemCopyOf.java	14 Aug 2002 19:21:28 -0000	1.14.4.1
  @@ -60,15 +60,20 @@
   //import org.w3c.dom.traversal.NodeIterator;
   import org.apache.xml.dtm.DTM;
   import org.apache.xml.dtm.DTMIterator;
  +import org.apache.xml.dtm.XType;
   import org.apache.xml.dtm.ref.DTMTreeWalker;
   
   import org.xml.sax.*;
   
   import org.apache.xpath.*;
  +import org.apache.xpath.objects.XNodeSequenceSingleton;
   import org.apache.xpath.objects.XObject;
  +import org.apache.xpath.objects.XSequence;
  +import org.apache.xpath.objects.XString;
   import org.apache.xalan.trace.SelectionEvent;
   import org.apache.xalan.res.XSLTErrorResources;
   import org.apache.xml.utils.QName;
  +import org.apache.xml.utils.XMLString;
   import org.apache.xalan.transformer.TreeWalker2Result;
   import org.apache.xalan.transformer.TransformerImpl;
   import org.apache.xalan.transformer.ResultTreeHandler;
  @@ -86,6 +91,7 @@
    */
   public class ElemCopyOf extends ElemTemplateElement
   {
  +  AVT m_separator;
   
     /**
      * The required select attribute contains an expression.
  @@ -126,7 +132,9 @@
       super.compose(sroot);
       
       StylesheetRoot.ComposeState cstate = sroot.getComposeState();
  -    m_selectExpression.fixupVariables(cstate.getVariableNames(), cstate.getGlobalsSize());
  +    m_selectExpression.fixupVariables(cstate);
  +    if(null != m_separator)
  +      m_separator.fixupVariables(cstate);
     }
   
     /**
  @@ -162,41 +170,95 @@
      *
      * @throws TransformerException
      */
  -  public void execute(
  -          TransformerImpl transformer)
  -            throws TransformerException
  +  public void execute(TransformerImpl transformer) throws TransformerException
     {
       if (TransformerImpl.S_DEBUG)
  -    	transformer.getTraceManager().fireTraceEvent(this);
  +      transformer.getTraceManager().fireTraceEvent(this);
   
       try
       {
         XPathContext xctxt = transformer.getXPathContext();
  +      XObject value = m_selectExpression.execute(xctxt, this);
         int sourceNode = xctxt.getCurrentNode();
  -      XObject value = m_selectExpression.execute(xctxt, sourceNode, this);
   
         if (TransformerImpl.S_DEBUG)
  -        transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
  -                                                        "select", m_selectExpression, value);
  +        transformer.getTraceManager().fireSelectedEvent(
  +          sourceNode,
  +          this,
  +          "select",
  +          m_selectExpression,
  +          value);
   
         ResultTreeHandler handler = transformer.getResultTreeHandler();
   
         if (null != value)
  -                        {
  -        int type = value.getType();
  +      {
           String s;
   
  -        switch (type)
  +        if (value.isSequenceProper())
  +        {
  +          XSequence xseq = value.xseq();
  +          XObject xobj = xseq.next();
  +          String sep;
  +          if(null != m_separator)
  +            sep = m_separator.evaluate(xctxt, sourceNode, this);
  +          else
  +            sep = null;
  +          while (xobj != null)
  +          {
  +            executeToResultTree(transformer, xctxt, xobj, handler);
  +            xobj = xseq.next();
  +            if (null != xobj && null != sep)
  +              handler.characters(sep.toCharArray(), 0, sep.length());
  +          }
  +        }
  +        else
           {
  -        case XObject.CLASS_BOOLEAN :
  -        case XObject.CLASS_NUMBER :
  -        case XObject.CLASS_STRING :
  -          s = value.str();
   
  -          handler.characters(s.toCharArray(), 0, s.length());
  -          break;
  -        case XObject.CLASS_NODESET :
  +          executeToResultTree(transformer, xctxt, value, handler);
  +        }
  +      }
  +
  +      // I don't think we want this.  -sb
  +      //  if (TransformerImpl.S_DEBUG)
  +      //  transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
  +      //  "endSelect", m_selectExpression, value);
   
  +    }
  +    catch (org.xml.sax.SAXException se)
  +    {
  +      throw new TransformerException(se);
  +    }
  +    finally
  +    {
  +      if (TransformerImpl.S_DEBUG)
  +        transformer.getTraceManager().fireTraceEndEvent(this);
  +    }
  +
  +  }
  +
  +  public void executeToResultTree(
  +    TransformerImpl transformer,
  +    XPathContext xctxt,
  +    XObject value,
  +    ResultTreeHandler handler)
  +    throws SAXException, TransformerException
  +  {
  +
  +    int type = value.getType();
  +    String s;
  +
  +    switch (type)
  +    {
  +      case XObject.CLASS_BOOLEAN :
  +      case XObject.CLASS_NUMBER :
  +      case XObject.CLASS_STRING :
  +        value.dispatchCharactersEvents(handler);
  +        // s = value.str();
  +        // handler.characters(s.toCharArray(), 0, s.length());
  +        break;
  +      case XObject.CLASS_NODESET :
  +        {
             // System.out.println(value);
             DTMIterator nl = value.iter();
   
  @@ -213,13 +275,51 @@
               // generated, so we need to only walk the child nodes.
               if (t == DTM.DOCUMENT_NODE)
               {
  -              for (int child = dtm.getFirstChild(pos); child != DTM.NULL;
  -                   child = dtm.getNextSibling(child))
  +              for (int child = dtm.getFirstChild(pos);
  +                child != DTM.NULL;
  +                child = dtm.getNextSibling(child))
                 {
                   tw.traverse(child);
                 }
               }
  -            else if (t == DTM.ATTRIBUTE_NODE)
  +            else
  +              if (t == DTM.ATTRIBUTE_NODE)
  +              {
  +                handler.addAttribute(pos);
  +              }
  +              else
  +              {
  +                tw.traverse(pos);
  +              }
  +          }
  +        }
  +        // nl.detach();
  +        break;
  +      case XObject.CLASS_RTREEFRAG :
  +        handler.outputResultTreeFragment(value, transformer.getXPathContext());
  +        break;
  +      case XObject.CLASS_UNKNOWN :
  +        if (value instanceof XNodeSequenceSingleton)
  +        {
  +          XNodeSequenceSingleton xnss = (XNodeSequenceSingleton) value;
  +          int pos = xnss.getNodeHandle();
  +          DTM dtm = xnss.getDTM();
  +          short t = dtm.getNodeType(pos);
  +          DTMTreeWalker tw = new TreeWalker2Result(transformer, handler);
  +
  +          // If we just copy the whole document, a startDoc and endDoc get 
  +          // generated, so we need to only walk the child nodes.
  +          if (t == DTM.DOCUMENT_NODE)
  +          {
  +            for (int child = dtm.getFirstChild(pos);
  +              child != DTM.NULL;
  +              child = dtm.getNextSibling(child))
  +            {
  +              tw.traverse(child);
  +            }
  +          }
  +          else
  +            if (t == DTM.ATTRIBUTE_NODE)
               {
                 handler.addAttribute(pos);
               }
  @@ -227,36 +327,15 @@
               {
                 tw.traverse(pos);
               }
  -          }
  -          // nl.detach();
  -          break;
  -        case XObject.CLASS_RTREEFRAG :
  -          handler.outputResultTreeFragment(value,
  -                                           transformer.getXPathContext());
  -          break;
  -        default :
  -          
  -          s = value.str();
   
  -          handler.characters(s.toCharArray(), 0, s.length());
             break;
           }
  -      }
  -                        
  -      // I don't think we want this.  -sb
  -      //  if (TransformerImpl.S_DEBUG)
  -      //  transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
  -      //  "endSelect", m_selectExpression, value);
  +      default :
   
  -    }
  -    catch(org.xml.sax.SAXException se)
  -    {
  -      throw new TransformerException(se);
  -    }
  -    finally
  -    {
  -      if (TransformerImpl.S_DEBUG)
  -        transformer.getTraceManager().fireTraceEndEvent(this);
  +        s = value.str();
  +
  +        handler.characters(s.toCharArray(), 0, s.length());
  +        break;
       }
   
     }
  @@ -288,6 +367,24 @@
     	if(callAttrs)
     		m_selectExpression.getExpression().callVisitors(m_selectExpression, visitor);
       super.callChildVisitors(visitor, callAttrs);
  +  }
  +
  +  /**
  +   * Returns the separator.
  +   * @return String
  +   */
  +  public AVT getSeparator()
  +  {
  +    return m_separator;
  +  }
  +
  +  /**
  +   * Sets the separator.
  +   * @param separator The separator to set
  +   */
  +  public void setSeparator(AVT separator)
  +  {
  +    m_separator = separator;
     }
   
   }
  
  
  
  1.26.2.1  +5 -9      xml-xalan/java/src/org/apache/xalan/templates/ElemElement.java
  
  Index: ElemElement.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemElement.java,v
  retrieving revision 1.26
  retrieving revision 1.26.2.1
  diff -u -r1.26 -r1.26.2.1
  --- ElemElement.java	10 Jul 2002 16:06:31 -0000	1.26
  +++ ElemElement.java	14 Aug 2002 19:21:28 -0000	1.26.2.1
  @@ -168,11 +168,10 @@
       super.compose(sroot);
       
       StylesheetRoot.ComposeState cstate = sroot.getComposeState();
  -    java.util.Vector vnames = cstate.getVariableNames();
       if(null != m_name_avt)
  -      m_name_avt.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_name_avt.fixupVariables(cstate);
       if(null != m_namespace_avt)
  -      m_namespace_avt.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_namespace_avt.fixupVariables(cstate);
     }
   
   
  @@ -285,15 +284,12 @@
    	ResultTreeHandler rhandler = transformer.getResultTreeHandler();
       XPathContext xctxt = transformer.getXPathContext();
       int sourceNode = xctxt.getCurrentNode();
  -    
  -    
  -    String nodeName = m_name_avt == null ? null : m_name_avt.evaluate(xctxt, sourceNode, this);
  +    String nodeName = m_name_avt.evaluate(xctxt, sourceNode, this);
   
       String prefix = null;
       String nodeNamespace = "";
   
  -    // Only validate if an AVT was used.
  -    if ((nodeName != null) && (!m_name_avt.isSimple()) && (!validateNodeName(nodeName)))
  +    if (!validateNodeName(nodeName))
       {
         transformer.getMsgMgr().warn(
           this, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE,
  @@ -302,7 +298,7 @@
         nodeName = null;
       }
   
  -    else if (nodeName != null)
  +    else
       {
         prefix = QName.getPrefixPart(nodeName);
   
  
  
  
  1.29.2.1  +123 -63   xml-xalan/java/src/org/apache/xalan/templates/ElemForEach.java
  
  Index: ElemForEach.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemForEach.java,v
  retrieving revision 1.29
  retrieving revision 1.29.2.1
  diff -u -r1.29 -r1.29.2.1
  --- ElemForEach.java	24 Jul 2002 17:06:46 -0000	1.29
  +++ ElemForEach.java	14 Aug 2002 19:21:28 -0000	1.29.2.1
  @@ -70,16 +70,21 @@
   import org.apache.xpath.*;
   import org.apache.xpath.Expression;
   import org.apache.xpath.axes.ContextNodeList;
  +import org.apache.xpath.objects.XNodeSequenceSingleton;
  +import org.apache.xpath.objects.XNodeSet;
   import org.apache.xpath.objects.XObject;
  +import org.apache.xpath.objects.XSequence;
   
   import java.util.Vector;
   
   import org.apache.xml.utils.QName;
   import org.apache.xml.utils.PrefixResolver;
   import org.apache.xalan.res.XSLTErrorResources;
  +import org.apache.xalan.transformer.ItemSorter;
   import org.apache.xalan.transformer.TransformerImpl;
   import org.apache.xalan.transformer.NodeSorter;
   import org.apache.xalan.transformer.ResultTreeHandler;
  +import org.apache.xalan.transformer.StackGuard;
   import org.apache.xalan.transformer.ClonerToResultTree;
   
   import javax.xml.transform.SourceLocator;
  @@ -175,8 +180,7 @@
       java.util.Vector vnames = sroot.getComposeState().getVariableNames();
   
       if (null != m_selectExpression)
  -      m_selectExpression.fixupVariables(
  -        vnames, sroot.getComposeState().getGlobalsSize());
  +      m_selectExpression.fixupVariables(sroot.getComposeState());
       else
       {
         m_selectExpression =
  @@ -335,7 +339,7 @@
     {
   
       NodeSorter sorter = new NodeSorter(xctxt);
  -    sourceNodes.setShouldCacheNodes(true);
  +    sourceNodes.setShouldCache(true);
       sourceNodes.runTo(-1);
       xctxt.pushContextNodeList(sourceNodes);
   
  @@ -351,6 +355,42 @@
   
       return sourceNodes;
     }
  +  
  +  /**
  +   * Sort given nodes
  +   *
  +   *
  +   * @param xctxt The XPath runtime state for the sort.
  +   * @param keys Vector of sort keyx
  +   * @param sourceNodes Iterator of nodes to sort
  +   *
  +   * @return iterator of sorted nodes
  +   *
  +   * @throws TransformerException
  +   */
  +  public XSequence sortSequence(
  +          XPathContext xctxt, Vector keys, XSequence sequence)
  +            throws TransformerException
  +  {
  +
  +    ItemSorter sorter = new ItemSorter(xctxt);
  +    sequence.setShouldCache(true);
  +    sequence.getLength();  // force cache to fill up.
  +    xctxt.pushContextSequence(sequence);
  +
  +    try
  +    {
  +      sequence = sorter.sort(sequence, keys, xctxt);
  +      sequence.reset();
  +    }
  +    finally
  +    {
  +      xctxt.popContextSequence();
  +    }
  +
  +    return sequence;
  +  }
  +
   
     /**
      * <meta name="usage" content="advanced"/>
  @@ -362,132 +402,152 @@
      * @throws TransformerException Thrown in a variety of circumstances.
      */
     public void transformSelectedNodes(TransformerImpl transformer)
  -          throws TransformerException
  +    throws TransformerException
     {
   
       final XPathContext xctxt = transformer.getXPathContext();
       final int sourceNode = xctxt.getCurrentNode();
  -    DTMIterator sourceNodes = m_selectExpression.asIterator(xctxt,
  -            sourceNode);
  -
  +    // DTMIterator sourceNodes = m_selectExpression.asIterator(xctxt, sourceNode);
  +    XObject selectResult = m_selectExpression.execute(xctxt);
  +    XSequence xseq = selectResult.xseq();
  +    
       try
       {
   
  -      final Vector keys = (m_sortElems == null)
  -              ? null
  -              : transformer.processSortKeys(this, sourceNode);
  +      final Vector keys =
  +        (m_sortElems == null)
  +          ? null
  +          : transformer.processSortKeys(this, sourceNode);
   
         // Sort if we need to.
  +      // TBD: We have to adapt sortNodes to sequence sorting.
         if (null != keys)
  -        sourceNodes = sortNodes(xctxt, keys, sourceNodes);
  +      {
  +        xseq = sortSequence(xctxt, keys, xseq);
  +      }
   
         if (TransformerImpl.S_DEBUG)
         {
  -        transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
  -                "select", new XPath(m_selectExpression),
  -                new org.apache.xpath.objects.XNodeSet(sourceNodes));
  +        transformer.getTraceManager().fireSelectedEvent(
  +          sourceNode,
  +          this,
  +          "select",
  +          new XPath(m_selectExpression),
  +          (org.apache.xpath.objects.XNodeSet)xseq);
         }
   
         final ResultTreeHandler rth = transformer.getResultTreeHandler();
         ContentHandler chandler = rth.getContentHandler();
   
  -      xctxt.pushCurrentNode(DTM.NULL);
  +      xctxt.pushCurrentItem(XSequence.EMPTY);
   
  -      int[] currentNodes = xctxt.getCurrentNodeStack();
  +      // XObject[] currentItems = xctxt.getCurrentItemStack();
         int currentNodePos = xctxt.getCurrentNodeFirstFree() - 1;
   
         xctxt.pushCurrentExpressionNode(DTM.NULL);
   
         int[] currentExpressionNodes = xctxt.getCurrentExpressionNodeStack();
         int currentExpressionNodePos =
  -              xctxt.getCurrentExpressionNodesFirstFree() - 1;
  +        xctxt.getCurrentExpressionNodesFirstFree() - 1;
   
         xctxt.pushSAXLocatorNull();
  -      xctxt.pushContextNodeList(sourceNodes);
  +            
  +      // TBD: Check spec what we're supposed to do here. -sb
  +      xctxt.pushContextSequence(xseq);
         transformer.pushElemTemplateElement(null);
   
         // pushParams(transformer, xctxt);
         // Should be able to get this from the iterator but there must be a bug.
         DTM dtm = xctxt.getDTM(sourceNode);
         int docID = sourceNode & DTMManager.IDENT_DTM_DEFAULT;
  -      int child;
  +      XObject item;
   
  -      while (DTM.NULL != (child = sourceNodes.nextNode()))
  +      while (null != (item = xseq.next()))
         {
  -        currentNodes[currentNodePos] = child;
  -        currentExpressionNodes[currentExpressionNodePos] = child;
  -
  -        if ((child & DTMManager.IDENT_DTM_DEFAULT) != docID)
  +        xctxt.setCurrentItem(item);
  +        if(item instanceof XNodeSequenceSingleton)
           {
  -          dtm = xctxt.getDTM(child);
  -          docID = sourceNode & DTMManager.IDENT_DTM_DEFAULT;
  +          XNodeSequenceSingleton xnss = (XNodeSequenceSingleton)item;
  +          int nodeHandle = xnss.getNodeHandle();
  +          currentExpressionNodes[currentExpressionNodePos] = nodeHandle;
  +  
  +          if ((nodeHandle & DTMManager.IDENT_DTM_DEFAULT) != docID)
  +          {
  +            dtm = xnss.getDTM();
  +            docID = sourceNode & DTMManager.IDENT_DTM_DEFAULT;
  +          }
  +          //final int exNodeType = dtm.getExpandedTypeID(child);
  +          final int nodeType = dtm.getNodeType(nodeHandle);
           }
   
  -        //final int exNodeType = dtm.getExpandedTypeID(child);
  -        final int nodeType = dtm.getNodeType(child); 
  -
           // Fire a trace event for the template.
           if (TransformerImpl.S_DEBUG)
           {
  -           transformer.getTraceManager().fireTraceEvent(this);
  +          transformer.getTraceManager().fireTraceEvent(this);
           }
   
           // And execute the child templates.
           // Loop through the children of the template, calling execute on 
           // each of them.
  -        for (ElemTemplateElement t = this.m_firstChild; t != null;
  -             t = t.m_nextSibling)
  +        for (ElemTemplateElement t = this.m_firstChild;
  +          t != null;
  +          t = t.m_nextSibling)
           {
             xctxt.setSAXLocator(t);
             transformer.setCurrentElement(t);
             t.execute(transformer);
           }
  -        
  +
           if (TransformerImpl.S_DEBUG)
           {
  -         // We need to make sure an old current element is not 
  +          // We need to make sure an old current element is not 
             // on the stack.  See TransformerImpl#getElementCallstack.
             transformer.setCurrentElement(null);
             transformer.getTraceManager().fireTraceEndEvent(this);
           }
   
  -
  -	 	// KLUGE: Implement <?xalan:doc_cache_off?> 
  -	 	// ASSUMPTION: This will be set only when the XPath was indeed
  -	 	// a call to the Document() function. Calling it in other
  -	 	// situations is likely to fry Xalan.
  -	 	//
  -	 	// %REVIEW% We need a MUCH cleaner solution -- one that will
  -	 	// handle cleaning up after document() and getDTM() in other
  -		// contexts. The whole SourceTreeManager mechanism should probably
  -	 	// be moved into DTMManager rather than being explicitly invoked in
  -	 	// FuncDocument and here.
  -	 	if(m_doc_cache_off)
  -		{
  -	 	  if(DEBUG)
  -	 	    System.out.println("JJK***** CACHE RELEASE *****\n"+
  -				       "\tdtm="+dtm.getDocumentBaseURI());
  -	  	// NOTE: This will work because this is _NOT_ a shared DTM, and thus has
  -	  	// only a single Document node. If it could ever be an RTF or other
  -	 	// shared DTM, this would require substantial rework.
  -	 	  xctxt.getSourceTreeManager().removeDocumentFromCache(dtm.getDocument());
  -	 	  xctxt.release(dtm,false);
  -	 	}
  +        // KLUGE: Implement <?xalan:doc_cache_off?> 
  +        // ASSUMPTION: This will be set only when the XPath was indeed
  +        // a call to the Document() function. Calling it in other
  +        // situations is likely to fry Xalan.
  +        //
  +        // %REVIEW% We need a MUCH cleaner solution -- one that will
  +        // handle cleaning up after document() and getDTM() in other
  +        // contexts. The whole SourceTreeManager mechanism should probably
  +        // be moved into DTMManager rather than being explicitly invoked in
  +        // FuncDocument and here.
  +        if (m_doc_cache_off)
  +        {
  +          if (DEBUG)
  +            System.out.println(
  +              "JJK***** CACHE RELEASE *****\n"
  +                + "\tdtm="
  +                + dtm.getDocumentBaseURI());
  +          // NOTE: This will work because this is _NOT_ a shared DTM, and thus has
  +          // only a single Document node. If it could ever be an RTF or other
  +          // shared DTM, this would require substantial rework.
  +          xctxt.getSourceTreeManager().removeDocumentFromCache(
  +            dtm.getDocument());
  +          xctxt.release(dtm, false);
  +        }
         }
       }
       finally
       {
         if (TransformerImpl.S_DEBUG)
  -        transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this,
  -                "select", new XPath(m_selectExpression),
  -                new org.apache.xpath.objects.XNodeSet(sourceNodes));
  +        transformer.getTraceManager().fireSelectedEndEvent(
  +          sourceNode,
  +          this,
  +          "select",
  +          new XPath(m_selectExpression),
  +          (XNodeSet)xseq);
   
         xctxt.popSAXLocator();
  -      xctxt.popContextNodeList();
  +      xctxt.popContextSequence();
         transformer.popElemTemplateElement();
         xctxt.popCurrentExpressionNode();
  -      xctxt.popCurrentNode();
  -      sourceNodes.detach();
  +      xctxt.popCurrentItem();
  +      xseq.detach();
       }
     }
   
  @@ -553,5 +613,5 @@
     	exp.exprSetParent(this);
     	m_selectExpression = exp;
     }
  -
  +
   }
  
  
  
  1.12.4.1  +1 -3      xml-xalan/java/src/org/apache/xalan/templates/ElemIf.java
  
  Index: ElemIf.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemIf.java,v
  retrieving revision 1.12
  retrieving revision 1.12.4.1
  diff -u -r1.12 -r1.12.4.1
  --- ElemIf.java	24 Mar 2002 00:57:53 -0000	1.12
  +++ ElemIf.java	14 Aug 2002 19:21:28 -0000	1.12.4.1
  @@ -128,10 +128,8 @@
   
       super.compose(sroot);
   
  -    java.util.Vector vnames = sroot.getComposeState().getVariableNames();
  -
       if (null != m_test)
  -      m_test.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
  +      m_test.fixupVariables(sroot.getComposeState());
     }
   
     /**
  
  
  
  1.32.4.1  +3 -4      xml-xalan/java/src/org/apache/xalan/templates/ElemLiteralResult.java
  
  Index: ElemLiteralResult.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemLiteralResult.java,v
  retrieving revision 1.32
  retrieving revision 1.32.4.1
  diff -u -r1.32 -r1.32.4.1
  --- ElemLiteralResult.java	22 Mar 2002 01:04:40 -0000	1.32
  +++ ElemLiteralResult.java	14 Aug 2002 19:21:28 -0000	1.32.4.1
  @@ -140,7 +140,7 @@
         for (int i = (nAttrs - 1); i >= 0; i--)
         {
           AVT avt = (AVT) m_avts.elementAt(i);
  -        avt.fixupVariables(vnames, cstate.getGlobalsSize());
  +        avt.fixupVariables(cstate);
         } 
       }   
     }
  @@ -630,16 +630,15 @@
      *
      * @throws TransformerException
      */
  -  private boolean excludeResultNSDecl(String prefix, String uri)
  +  private boolean lreExcludeResultNSDecl(String prefix, String uri)
             throws TransformerException
     {
  -
       if (null != m_excludeResultPrefixes)
       {
         return containsExcludeResultPrefix(prefix, uri);
       }
  -
       return false;
  +
     }
     
     /**
  
  
  
  1.28.2.1  +111 -81   xml-xalan/java/src/org/apache/xalan/templates/ElemNumber.java
  
  Index: ElemNumber.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemNumber.java,v
  retrieving revision 1.28
  retrieving revision 1.28.2.1
  diff -u -r1.28 -r1.28.2.1
  --- ElemNumber.java	10 Jul 2002 16:06:31 -0000	1.28
  +++ ElemNumber.java	14 Aug 2002 19:21:28 -0000	1.28.2.1
  @@ -70,13 +70,11 @@
   
   import java.util.*;
   
  -import java.text.DecimalFormatSymbols;
   import java.text.NumberFormat;
   import java.text.DecimalFormat;
   
   import org.apache.xpath.*;
   import org.apache.xpath.objects.XObject;
  -import org.apache.xpath.compiler.XPathParser;
   import org.apache.xml.utils.PrefixResolver;
   import org.apache.xml.utils.PrefixResolverDefault;
   import org.apache.xml.utils.QName;
  @@ -85,7 +83,6 @@
   import org.apache.xalan.res.*;
   import org.apache.xalan.transformer.DecimalToRoman;
   import org.apache.xalan.transformer.CountersTable;
  -import org.apache.xalan.transformer.ResultTreeHandler;
   import org.apache.xalan.transformer.TransformerImpl;
   import org.apache.xml.utils.NodeVector;
   
  @@ -544,21 +541,21 @@
       StylesheetRoot.ComposeState cstate = sroot.getComposeState();
       java.util.Vector vnames = cstate.getVariableNames();
       if(null != m_countMatchPattern)
  -      m_countMatchPattern.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_countMatchPattern.fixupVariables(cstate);
       if(null != m_format_avt)
  -      m_format_avt.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_format_avt.fixupVariables(cstate);
       if(null != m_fromMatchPattern)
  -      m_fromMatchPattern.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_fromMatchPattern.fixupVariables(cstate);
       if(null != m_groupingSeparator_avt)
  -      m_groupingSeparator_avt.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_groupingSeparator_avt.fixupVariables(cstate);
       if(null != m_groupingSize_avt)
  -      m_groupingSize_avt.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_groupingSize_avt.fixupVariables(cstate);
       if(null != m_lang_avt)
  -      m_lang_avt.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_lang_avt.fixupVariables(cstate);
       if(null != m_lettervalue_avt)
  -      m_lettervalue_avt.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_lettervalue_avt.fixupVariables(cstate);
       if(null != m_valueExpr)
  -      m_valueExpr.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_valueExpr.fixupVariables(cstate);
     }
   
   
  @@ -598,7 +595,7 @@
               throws TransformerException
     {
   
  -     if (TransformerImpl.S_DEBUG)
  +    if (TransformerImpl.S_DEBUG)
         transformer.getTraceManager().fireTraceEvent(this);
   
       int sourceNode = transformer.getXPathContext().getCurrentNode();
  @@ -765,7 +762,7 @@
      * @throws javax.xml.transform.TransformerException
      */
     XPath getCountMatchPattern(XPathContext support, int contextNode)
  -          throws javax.xml.transform.TransformerException
  +    throws javax.xml.transform.TransformerException
     {
   
       XPath countMatchPattern = m_countMatchPattern;
  @@ -774,49 +771,101 @@
       {
         switch (dtm.getNodeType(contextNode))
         {
  -      case DTM.ELEMENT_NODE :
  -        MyPrefixResolver resolver;
  +        case DTM.ELEMENT_NODE :
  +          MyPrefixResolver resolver;
   
  -        if (dtm.getNamespaceURI(contextNode) == null) {
  -             resolver =  new MyPrefixResolver(dtm.getNode(contextNode), dtm,contextNode, false);
  -        } else {
  -            resolver = new MyPrefixResolver(dtm.getNode(contextNode), dtm,contextNode, true);
  -        }
  +          if (dtm.getNamespaceURI(contextNode) == null)
  +          {
  +            resolver =
  +              new MyPrefixResolver(
  +                dtm.getNode(contextNode),
  +                dtm,
  +                contextNode,
  +                false);
  +          }
  +          else
  +          {
  +            resolver =
  +              new MyPrefixResolver(
  +                dtm.getNode(contextNode),
  +                dtm,
  +                contextNode,
  +                true);
  +          }
  +
  +          countMatchPattern =
  +            new XPath(
  +              dtm.getNodeName(contextNode),
  +              this,
  +              resolver,
  +              XPath.MATCH,
  +              support.getErrorListener(),
  +              getStylesheetRoot().getVersionNumber());
  +          break;
  +
  +        case DTM.ATTRIBUTE_NODE :
  +
  +          // countMatchPattern = m_stylesheet.createMatchPattern("@"+contextNode.getNodeName(), this);
  +          countMatchPattern =
  +            new XPath(
  +              "@" + dtm.getNodeName(contextNode),
  +              this,
  +              this,
  +              XPath.MATCH,
  +              support.getErrorListener(),
  +              getStylesheetRoot().getVersionNumber());
  +          break;
  +        case DTM.CDATA_SECTION_NODE :
  +        case DTM.TEXT_NODE :
   
  -        countMatchPattern = new XPath(dtm.getNodeName(contextNode), this, resolver,
  -                                      XPath.MATCH, support.getErrorListener());
  -        break;
  -
  -      case DTM.ATTRIBUTE_NODE :
  -
  -        // countMatchPattern = m_stylesheet.createMatchPattern("@"+contextNode.getNodeName(), this);
  -        countMatchPattern = new XPath("@" + dtm.getNodeName(contextNode), this,
  -                                      this, XPath.MATCH, support.getErrorListener());
  -        break;
  -      case DTM.CDATA_SECTION_NODE :
  -      case DTM.TEXT_NODE :
  -
  -        // countMatchPattern = m_stylesheet.createMatchPattern("text()", this);
  -        countMatchPattern = new XPath("text()", this, this, XPath.MATCH, support.getErrorListener());
  -        break;
  -      case DTM.COMMENT_NODE :
  -
  -        // countMatchPattern = m_stylesheet.createMatchPattern("comment()", this);
  -        countMatchPattern = new XPath("comment()", this, this, XPath.MATCH, support.getErrorListener());
  -        break;
  -      case DTM.DOCUMENT_NODE :
  -
  -        // countMatchPattern = m_stylesheet.createMatchPattern("/", this);
  -        countMatchPattern = new XPath("/", this, this, XPath.MATCH, support.getErrorListener());
  -        break;
  -      case DTM.PROCESSING_INSTRUCTION_NODE :
  -
  -        // countMatchPattern = m_stylesheet.createMatchPattern("pi("+contextNode.getNodeName()+")", this);
  -        countMatchPattern = new XPath("pi(" + dtm.getNodeName(contextNode)
  -                                      + ")", this, this, XPath.MATCH, support.getErrorListener());
  -        break;
  -      default :
  -        countMatchPattern = null;
  +          // countMatchPattern = m_stylesheet.createMatchPattern("text()", this);
  +          countMatchPattern =
  +            new XPath(
  +              "text()",
  +              this,
  +              this,
  +              XPath.MATCH,
  +              support.getErrorListener(),
  +              getStylesheetRoot().getVersionNumber());
  +          break;
  +        case DTM.COMMENT_NODE :
  +
  +          // countMatchPattern = m_stylesheet.createMatchPattern("comment()", this);
  +          countMatchPattern =
  +            new XPath(
  +              "comment()",
  +              this,
  +              this,
  +              XPath.MATCH,
  +              support.getErrorListener(),
  +              getStylesheetRoot().getVersionNumber());
  +          break;
  +        case DTM.DOCUMENT_NODE :
  +
  +          // countMatchPattern = m_stylesheet.createMatchPattern("/", this);
  +          countMatchPattern =
  +            new XPath(
  +              "/",
  +              this,
  +              this,
  +              XPath.MATCH,
  +              support.getErrorListener(),
  +              getStylesheetRoot().getVersionNumber());
  +          break;
  +        case DTM.PROCESSING_INSTRUCTION_NODE :
  +
  +          // countMatchPattern = m_stylesheet.createMatchPattern("pi("+contextNode.getNodeName()+")", this);
  +          countMatchPattern =
  +            new XPath(
  +              "pi(" + dtm.getNodeName(contextNode) + ")",
  +              this,
  +              this,
  +              XPath.MATCH,
  +              support.getErrorListener(),
  +              getStylesheetRoot().getVersionNumber());
  +          break;
  +        default :
  +          countMatchPattern = null;
         }
       }
   
  @@ -1131,49 +1180,31 @@
       Locale locale = (Locale)getLocale(transformer, contextNode).clone();
   
       // Helper to format local specific numbers to strings.
  -    DecimalFormat formatter = null;
  +    DecimalFormat formatter;
   
       //synchronized (locale)
       //{
  -    //     formatter = (DecimalFormat) NumberFormat.getNumberInstance(locale);
  +      formatter = (DecimalFormat) NumberFormat.getNumberInstance(locale);
       //}
   
       String digitGroupSepValue =
         (null != m_groupingSeparator_avt)
         ? m_groupingSeparator_avt.evaluate(
         transformer.getXPathContext(), contextNode, this) : null;
  -      
  -      
  -    // Validate grouping separator if an AVT was used; otherwise this was 
  -    // validated statically in XSLTAttributeDef.java.
  -    if ((digitGroupSepValue != null) && (!m_groupingSeparator_avt.isSimple()) &&
  -        (digitGroupSepValue.length() != 1))
  -    {
  -            transformer.getMsgMgr().warn(
  -               this, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE,
  -               new Object[]{ Constants.ATTRNAME_NAME, m_groupingSeparator_avt.getName()});   
  -    }                  
  -      
  -      
       String nDigitsPerGroupValue =
         (null != m_groupingSize_avt)
         ? m_groupingSize_avt.evaluate(
         transformer.getXPathContext(), contextNode, this) : null;
   
       // TODO: Handle digit-group attributes
  -    if ((null != digitGroupSepValue) && (null != nDigitsPerGroupValue) &&
  -        // Ignore if separation value is empty string
  -        (digitGroupSepValue.length() > 0))
  +    if ((null != digitGroupSepValue) && (null != nDigitsPerGroupValue))
       {
         try
         {
  -        formatter = (DecimalFormat) NumberFormat.getNumberInstance(locale);
           formatter.setGroupingSize(
             Integer.valueOf(nDigitsPerGroupValue).intValue());
  -        
  -        DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols();
  -        symbols.setGroupingSeparator(digitGroupSepValue.charAt(0));
  -        formatter.setDecimalFormatSymbols(symbols);
  +        formatter.getDecimalFormatSymbols().setGroupingSeparator(
  +          digitGroupSepValue.charAt(0));
           formatter.setGroupingUsed(true);
         }
         catch (NumberFormatException ex)
  @@ -1363,7 +1394,8 @@
               throws javax.xml.transform.TransformerException
     {
   
  -
  +    DecimalFormat formatter = getNumberFormatter(transformer, contextNode);
  +    String padString = formatter.format(0);
       String letterVal =
         (m_lettervalue_avt != null)
         ? m_lettervalue_avt.evaluate(
  @@ -1619,9 +1651,7 @@
         break;
       }
       default :  // "1"
  -      DecimalFormat formatter = getNumberFormatter(transformer, contextNode);
  -      String padString = formatter == null ? String.valueOf(0) : formatter.format(0);    
  -      String numString = formatter == null ? String.valueOf(listElement) : formatter.format(listElement);
  +      String numString = formatter.format(listElement);
         int nPadding = numberWidth - numString.length();
   
         for (int k = 0; k < nPadding; k++)
  
  
  
  1.14.2.1  +6 -18     xml-xalan/java/src/org/apache/xalan/templates/ElemPI.java
  
  Index: ElemPI.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemPI.java,v
  retrieving revision 1.14
  retrieving revision 1.14.2.1
  diff -u -r1.14 -r1.14.2.1
  --- ElemPI.java	24 Jul 2002 14:15:03 -0000	1.14
  +++ ElemPI.java	14 Aug 2002 19:21:28 -0000	1.14.2.1
  @@ -125,7 +125,7 @@
       super.compose(sroot);
       java.util.Vector vnames = sroot.getComposeState().getVariableNames();
       if(null != m_name_atv)
  -      m_name_atv.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
  +      m_name_atv.fixupVariables(sroot.getComposeState());
     }
   
   
  @@ -173,28 +173,16 @@
   
       XPathContext xctxt = transformer.getXPathContext();
       int sourceNode = xctxt.getCurrentNode();
  -    
  -    String piName = m_name_atv == null ? null : m_name_atv.evaluate(xctxt, sourceNode, this);
  -    
  -    // Ignore processing instruction if name is null
  -    if (piName == null) return;
  +    String piName = m_name_atv.evaluate(xctxt, sourceNode, this);
   
       if (piName.equalsIgnoreCase("xml"))
       {
  -     	transformer.getMsgMgr().warn(
  -        this, XSLTErrorResources.WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
  -              new Object[]{ Constants.ATTRNAME_NAME, piName });
  -		return;
  +      error(XSLTErrorResources.ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML);  //"processing-instruction name can not be 'xml'");
       }
  -    
  -    // Only check if an avt was used (ie. this wasn't checked at compose time.)
  -    // Ignore processing instruction, if invalid
  -    else if ((!m_name_atv.isSimple()) && (!isValidNCName(piName)))
  +    else if (!isValidNCName(piName))
       {
  -     	transformer.getMsgMgr().warn(
  -        this, XSLTErrorResources.WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
  -              new Object[]{ Constants.ATTRNAME_NAME, piName });
  -		return;    	
  +      error(XSLTErrorResources.ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
  +            new Object[]{ piName });  //"processing-instruction name must be a valid NCName: "+piName);
       }
   
       // Note the content model is:
  
  
  
  1.7.14.1  +5 -5      xml-xalan/java/src/org/apache/xalan/templates/ElemSort.java
  
  Index: ElemSort.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemSort.java,v
  retrieving revision 1.7
  retrieving revision 1.7.14.1
  diff -u -r1.7 -r1.7.14.1
  --- ElemSort.java	12 Jun 2001 19:15:11 -0000	1.7
  +++ ElemSort.java	14 Aug 2002 19:21:28 -0000	1.7.14.1
  @@ -373,14 +373,14 @@
       StylesheetRoot.ComposeState cstate = sroot.getComposeState();
       java.util.Vector vnames = cstate.getVariableNames();
       if(null != m_caseorder_avt)
  -      m_caseorder_avt.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_caseorder_avt.fixupVariables(cstate);
       if(null != m_dataType_avt)
  -      m_dataType_avt.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_dataType_avt.fixupVariables(cstate);
       if(null != m_lang_avt)
  -      m_lang_avt.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_lang_avt.fixupVariables(cstate);
       if(null != m_order_avt)
  -      m_order_avt.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_order_avt.fixupVariables(cstate);
       if(null != m_selectExpression)
  -      m_selectExpression.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_selectExpression.fixupVariables(cstate);
     }
   }
  
  
  
  1.16.2.1  +1 -2      xml-xalan/java/src/org/apache/xalan/templates/ElemTemplate.java
  
  Index: ElemTemplate.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemTemplate.java,v
  retrieving revision 1.16
  retrieving revision 1.16.2.1
  diff -u -r1.16 -r1.16.2.1
  --- ElemTemplate.java	8 Jun 2002 20:41:00 -0000	1.16
  +++ ElemTemplate.java	14 Aug 2002 19:21:28 -0000	1.16.2.1
  @@ -385,9 +385,8 @@
     {
       super.compose(sroot);
       StylesheetRoot.ComposeState cstate = sroot.getComposeState();
  -    java.util.Vector vnames = cstate.getVariableNames();
       if(null != m_matchPattern)
  -      m_matchPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
  +      m_matchPattern.fixupVariables(sroot.getComposeState());
         
       cstate.resetStackFrameSize();
       m_inArgsSize = 0;
  
  
  
  1.53.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/templates/ElemTemplateElement.java
  
  Index: ElemTemplateElement.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemTemplateElement.java,v
  retrieving revision 1.53
  retrieving revision 1.53.2.1
  diff -u -r1.53 -r1.53.2.1
  --- ElemTemplateElement.java	10 Jun 2002 21:34:40 -0000	1.53
  +++ ElemTemplateElement.java	14 Aug 2002 19:21:28 -0000	1.53.2.1
  @@ -1050,7 +1050,7 @@
      *
      * @throws TransformerException
      */
  -  private boolean excludeResultNSDecl(String prefix, String uri)
  +   boolean excludeResultNSDecl(String prefix, String uri)
             throws TransformerException
     {
   
  
  
  
  1.19.2.1  +84 -39    xml-xalan/java/src/org/apache/xalan/templates/ElemValueOf.java
  
  Index: ElemValueOf.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemValueOf.java,v
  retrieving revision 1.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- ElemValueOf.java	9 Aug 2002 16:26:38 -0000	1.19
  +++ ElemValueOf.java	14 Aug 2002 19:21:28 -0000	1.19.2.1
  @@ -57,24 +57,17 @@
   package org.apache.xalan.templates;
   
   //import org.w3c.dom.*;
  -import org.apache.xml.dtm.DTM;
  -import org.apache.xml.dtm.DTMIterator;
  -
  -import org.xml.sax.*;
  +import javax.xml.transform.TransformerException;
   
  -import org.apache.xpath.*;
  -import org.apache.xpath.objects.XString;
  -import org.apache.xpath.objects.XObject;
  -import org.apache.xpath.objects.XNodeSet;
  -import org.apache.xalan.trace.SelectionEvent;
   import org.apache.xalan.res.XSLTErrorResources;
  -import org.apache.xalan.transformer.TransformerImpl;
   import org.apache.xalan.transformer.ResultTreeHandler;
  -import org.apache.xml.utils.PrefixResolver;
  -import org.apache.xml.utils.QName;
  -import org.apache.xml.utils.XMLString;
  -
  -import javax.xml.transform.TransformerException;
  +import org.apache.xalan.transformer.TransformerImpl;
  +import org.apache.xpath.Expression;
  +import org.apache.xpath.XPath;
  +import org.apache.xpath.XPathContext;
  +import org.apache.xpath.objects.XObject;
  +import org.apache.xpath.objects.XSequence;
  +import org.xml.sax.SAXException;
   
   /**
    * <meta name="usage" content="advanced"/>
  @@ -102,6 +95,12 @@
      * @serial
      */
     private boolean m_isDot = false;
  +  
  +  /**
  +   * Seperator attribute.
  +   * @serial
  +   */
  +  private AVT m_separator;
   
     /**
      * Set the "select" attribute.
  @@ -192,6 +191,24 @@
     {
       return m_disableOutputEscaping;
     }
  +  
  +  /**
  +   * Returns the separator.
  +   * @return String
  +   */
  +  public AVT getSeparator()
  +  {
  +    return m_separator;
  +  }
  +
  +  /**
  +   * Sets the separator.
  +   * @param separator The separator to set
  +   */
  +  public void setSeparator(AVT separator)
  +  {
  +    m_separator = separator;
  +  }
   
     /**
      * Get an integer representation of the element type.
  @@ -220,11 +237,8 @@
   
       super.compose(sroot);
   
  -    java.util.Vector vnames = sroot.getComposeState().getVariableNames();
  -
       if (null != m_selectExpression)
  -      m_selectExpression.fixupVariables(
  -        vnames, sroot.getComposeState().getGlobalsSize());
  +      m_selectExpression.fixupVariables(sroot.getComposeState());
     }
   
     /**
  @@ -266,12 +280,12 @@
       try
       {
         // Optimize for "."
  -      if (false && m_isDot && !TransformerImpl.S_DEBUG)
  +      if (m_isDot && !TransformerImpl.S_DEBUG)
         {
  -        int child = xctxt.getCurrentNode();
  -        DTM dtm = xctxt.getDTM(child);
  +        XObject item = xctxt.getCurrentItem();
  +        // DTM dtm = xctxt.getDTM(child);
   
  -        xctxt.pushCurrentNode(child);
  +        // xctxt.pushCurrentNode(child);
   
           if (m_disableOutputEscaping)
             rth.processingInstruction(
  @@ -279,7 +293,8 @@
   
           try
           {
  -          dtm.dispatchCharactersEvents(child, rth, false);
  +          item.dispatchCharactersEvents(rth);
  +          // dtm.dispatchCharactersEvents(child, rth, false);
           }
           finally
           {
  @@ -287,7 +302,7 @@
               rth.processingInstruction(
                 javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
   
  -          xctxt.popCurrentNode();
  +          // xctxt.popCurrentNode();
           }
         }
         else
  @@ -296,7 +311,8 @@
   
           int current = xctxt.getCurrentNode();
   
  -        xctxt.pushCurrentNodeAndExpression(current, current);
  +        xctxt.pushCurrentNode(current);
  +        xctxt.pushCurrentExpressionNode(current);
   
           if (m_disableOutputEscaping)
             rth.processingInstruction(
  @@ -305,18 +321,51 @@
           try
           {
             Expression expr = m_selectExpression.getExpression();
  +          String sep;
  +          if(null != m_separator)
  +            sep = m_separator.evaluate(xctxt, current, this);
  +          else
  +            sep = null;
   
  -          if (TransformerImpl.S_DEBUG)
  +         if (sep != null)
             {
  -            XObject obj = expr.execute(xctxt);
  -
  -            transformer.getTraceManager().fireSelectedEvent(current, this,
  -                    "select", m_selectExpression, obj);
  -            obj.dispatchCharactersEvents(rth);
  +          	XObject value = expr.execute(xctxt);
  +           if (value.isSequenceProper())
  +            {
  +              XSequence xseq = value.xseq();
  +              XObject xobj = xseq.next();
  +            
  +             while (xobj != null)
  +              {
  +             	xobj.dispatchCharactersEvents(rth);
  +                xobj = xseq.next();
  +              if (null != xobj)
  +                  rth.characters(sep.toCharArray(), 0, sep.length());
  +            
  +            // %Review% Not sure this is correct. Should the sequence object
  +            // be what is passed to the trace manager here?? 
  +              if (TransformerImpl.S_DEBUG)
  +                {
  +                  transformer.getTraceManager().fireSelectedEvent(current, this,
  +                    "select", m_selectExpression, xobj);
  +                }
  +              }
  +            }
             }
             else
  -          {
  -            expr.executeCharsToContentHandler(xctxt, rth);
  +         {
  +           if (TransformerImpl.S_DEBUG)
  +            {
  +              XObject obj = expr.execute(xctxt);
  +
  +              transformer.getTraceManager().fireSelectedEvent(current, this,
  +                    "select", m_selectExpression, obj);
  +              obj.dispatchCharactersEvents(rth);
  +            }
  +           else
  +            {
  +              expr.executeCharsToContentHandler(xctxt, rth);
  +            }
             }
           }
           finally
  @@ -334,17 +383,13 @@
       {
         throw new TransformerException(se);
       }
  -    catch (RuntimeException re) {
  -    	TransformerException te = new TransformerException(re);
  -    	te.setLocator(this);
  -    	throw te;
  -    }
       finally
       {
         if (TransformerImpl.S_DEBUG)
   	    transformer.getTraceManager().fireTraceEndEvent(this); 
       }
     }
  +  
   
     /**
      * Add a child to the child list.
  
  
  
  1.20.2.1  +12 -2     xml-xalan/java/src/org/apache/xalan/templates/ElemVariable.java
  
  Index: ElemVariable.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemVariable.java,v
  retrieving revision 1.20
  retrieving revision 1.20.2.1
  diff -u -r1.20 -r1.20.2.1
  --- ElemVariable.java	6 Jun 2002 20:25:17 -0000	1.20
  +++ ElemVariable.java	14 Aug 2002 19:21:28 -0000	1.20.2.1
  @@ -393,13 +393,13 @@
       // to the variable now being defined.
       java.util.Vector vnames = cstate.getVariableNames();
       if(null != m_selectPattern)
  -      m_selectPattern.fixupVariables(vnames, cstate.getGlobalsSize());
  +      m_selectPattern.fixupVariables(cstate);
         
       // Only add the variable if this is not a global.  If it is a global, 
       // it was already added by stylesheet root.
       if(!(m_parentNode instanceof Stylesheet))
       {
  -      m_index = cstate.addVariableName(m_qname) - cstate.getGlobalsSize();
  +      addVariableName(cstate);
       }
       else
       {
  @@ -412,6 +412,16 @@
       // This has to be done after the addVariableName, so that the variable 
       // pushed won't be immediately popped again in endCompose.
       super.compose(sroot);
  +  }
  +
  +
  +  /**
  +   * Mainly for ElemFuncResult to override.
  +   * @param cstate
  +   */
  +  protected void addVariableName(StylesheetRoot.ComposeState cstate)
  +  {
  +    m_index = cstate.addVariableName(m_qname) - cstate.getGlobalsSize();
     }
     
     /**
  
  
  
  1.7.4.1   +1 -1      xml-xalan/java/src/org/apache/xalan/templates/ElemWhen.java
  
  Index: ElemWhen.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemWhen.java,v
  retrieving revision 1.7
  retrieving revision 1.7.4.1
  diff -u -r1.7 -r1.7.4.1
  --- ElemWhen.java	22 Mar 2002 01:04:40 -0000	1.7
  +++ ElemWhen.java	14 Aug 2002 19:21:28 -0000	1.7.4.1
  @@ -134,7 +134,7 @@
       super.compose(sroot);
       java.util.Vector vnames = sroot.getComposeState().getVariableNames();
       if(null != m_test)
  -      m_test.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
  +      m_test.fixupVariables(sroot.getComposeState());
     }
   
     /**
  
  
  
  1.9.4.1   +1 -1      xml-xalan/java/src/org/apache/xalan/templates/ElemWithParam.java
  
  Index: ElemWithParam.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemWithParam.java,v
  retrieving revision 1.9
  retrieving revision 1.9.4.1
  diff -u -r1.9 -r1.9.4.1
  --- ElemWithParam.java	29 Mar 2002 15:22:12 -0000	1.9
  +++ ElemWithParam.java	14 Aug 2002 19:21:28 -0000	1.9.4.1
  @@ -198,7 +198,7 @@
       
       java.util.Vector vnames = sroot.getComposeState().getVariableNames();
       if(null != m_selectPattern)
  -      m_selectPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
  +      m_selectPattern.fixupVariables(sroot.getComposeState());
         
       // m_index must be resolved by ElemApplyTemplates and ElemCallTemplate!
     }
  
  
  
  1.27.2.1  +8 -0      xml-xalan/java/src/org/apache/xalan/templates/FuncDocument.java
  
  Index: FuncDocument.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/FuncDocument.java,v
  retrieving revision 1.27
  retrieving revision 1.27.2.1
  diff -u -r1.27 -r1.27.2.1
  --- FuncDocument.java	10 Jun 2002 20:47:44 -0000	1.27
  +++ FuncDocument.java	14 Aug 2002 19:21:28 -0000	1.27.2.1
  @@ -503,4 +503,12 @@
       return true;
     }
   
  +  /**
  +   * @see org.apache.xpath.ExpressionNode#exprGetNumChildren()
  +   */
  +  public int exprGetNumChildren()
  +  {
  +    return ((getArg0() == null) ? 0 : 1) + ((getArg1() == null) ? 0 : 1);
  +  }
  +
   }
  
  
  
  1.14.4.1  +7 -2      xml-xalan/java/src/org/apache/xalan/templates/FuncKey.java
  
  Index: FuncKey.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/FuncKey.java,v
  retrieving revision 1.14
  retrieving revision 1.14.4.1
  diff -u -r1.14 -r1.14.4.1
  --- FuncKey.java	22 Mar 2002 01:04:40 -0000	1.14
  +++ FuncKey.java	14 Aug 2002 19:21:28 -0000	1.14.4.1
  @@ -64,6 +64,7 @@
   import org.apache.xpath.XPath;
   import org.apache.xpath.objects.XObject;
   import org.apache.xpath.objects.XNodeSet;
  +import org.apache.xpath.objects.XSequence;
   import org.apache.xpath.XPathContext;
   import org.apache.xpath.axes.LocPathIterator;
   import org.apache.xpath.axes.UnionPathIterator;
  @@ -84,6 +85,10 @@
    */
   public class FuncKey extends Function2Args
   {
  +  public FuncKey()
  +  {
  +    super();
  +  }
   
     /** Dummy value to be used in usedrefs hashtable           */
     static private Boolean ISTRUE = new Boolean(true);
  @@ -121,8 +126,8 @@
       // Don't bother with nodeset logic if the thing is only one node.
       if(argIsNodeSetDTM)
       {
  -    	XNodeSet ns = (XNodeSet)arg;
  -    	ns.setShouldCacheNodes(true);
  +    	XSequence ns = arg.xseq();
  +    	ns.setShouldCache(true);
       	int len = ns.getLength();
       	if(len <= 1)
       		argIsNodeSetDTM = false;
  
  
  
  1.8.14.1  +2 -3      xml-xalan/java/src/org/apache/xalan/templates/KeyDeclaration.java
  
  Index: KeyDeclaration.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/KeyDeclaration.java,v
  retrieving revision 1.8
  retrieving revision 1.8.14.1
  diff -u -r1.8 -r1.8.14.1
  --- KeyDeclaration.java	12 Jun 2001 19:15:13 -0000	1.8
  +++ KeyDeclaration.java	14 Aug 2002 19:21:28 -0000	1.8.14.1
  @@ -191,11 +191,10 @@
       throws javax.xml.transform.TransformerException
     {
       super.compose(sroot);
  -    java.util.Vector vnames = sroot.getComposeState().getVariableNames();
       if(null != m_matchPattern)
  -      m_matchPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
  +      m_matchPattern.fixupVariables(sroot.getComposeState());
       if(null != m_use)
  -      m_use.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
  +      m_use.fixupVariables(sroot.getComposeState());
     }
   
     /**
  
  
  
  1.20.12.1 +13 -0     xml-xalan/java/src/org/apache/xalan/templates/OutputProperties.java
  
  Index: OutputProperties.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/OutputProperties.java,v
  retrieving revision 1.20
  retrieving revision 1.20.12.1
  diff -u -r1.20 -r1.20.12.1
  --- OutputProperties.java	28 Jul 2001 00:25:58 -0000	1.20
  +++ OutputProperties.java	14 Aug 2002 19:21:28 -0000	1.20.12.1
  @@ -878,6 +878,15 @@
       return m_properties;
     }
     
  +
  +  /**
  +   * Get the name property (XSLT 2.0).
  +   */
  +  public QName getName()
  +  {
  +    return getQNameProperty("name");
  +  }
  +  
     /**
      * Copy the keys and values from the source to this object.  This will
      * not copy the default values.  This is meant to be used by going from
  @@ -985,6 +994,10 @@
         {
           String oldValue = (String) this.m_properties.get(key);
           String newValue = (String) newProps.m_properties.get(key);
  +        // add name QName prop to the test?
  +        //QName oldName = this.getQNameProperty("name");
  +        //QName newName = newProps.getQNameProperty("name");
  +        //if ( ((oldName.equals(newName) &&  oldValue == null) 
           if ( ((oldValue == null) && (newValue != null)) || !oldValue.equals(newValue) )
           {
             String msg = key + " can not be multiply defined at the same "
  
  
  
  1.4.2.1   +9 -9      xml-xalan/java/src/org/apache/xalan/templates/RedundentExprEliminator.java
  
  Index: RedundentExprEliminator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/RedundentExprEliminator.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- RedundentExprEliminator.java	22 Jul 2002 18:34:15 -0000	1.4
  +++ RedundentExprEliminator.java	14 Aug 2002 19:21:28 -0000	1.4.2.1
  @@ -407,7 +407,7 @@
     		}
     	}
     	
  -  	assertion(false, "Could not find common ancestor!!!");
  +  	assert(false, "Could not find common ancestor!!!");
     	return null;
     }
     
  @@ -497,7 +497,7 @@
     	AxesWalker walker = wi.getFirstWalker();
     	for(int i = 0; i < numSteps; i++)
     	{
  -  		assertion(null != walker, "Walker should not be null!");
  +  		assert(null != walker, "Walker should not be null!");
     		walker = walker.getNextWalker();
     	}
     	
  @@ -579,7 +579,7 @@
     		aw2 = aw2.getNextWalker();
     	}
     	
  -  	assertion((null != aw1) || (null != aw2), "Total match is incorrect!");
  +  	assert((null != aw1) || (null != aw2), "Total match is incorrect!");
     	
     	return true;
     }
  @@ -1311,21 +1311,21 @@
                                             LocPathIterator path) 
   		throws RuntimeException 
     {
  -  	assertion(owner.getExpression() == path, "owner.getExpression() != path!!!");
  +  	assert(owner.getExpression() == path, "owner.getExpression() != path!!!");
   	int n = paths.size();
   	// There should never be any duplicates in the list!
   	for(int i = 0; i < n; i++)
   	{
   		ExpressionOwner ew = (ExpressionOwner)paths.elementAt(i);
  -		assertion(ew != owner, "duplicate owner on the list!!!");
  -		assertion(ew.getExpression() != path, "duplicate expression on the list!!!");
  +		assert(ew != owner, "duplicate owner on the list!!!");
  +		assert(ew.getExpression() != path, "duplicate expression on the list!!!");
   	}
     }
     
     /**
      * Simple assertion.
      */
  -  protected static void assertion(boolean b, String msg)
  +  protected static void assert(boolean b, String msg)
     {
     	if(!b)
     	{
  @@ -1363,7 +1363,7 @@
     	MultistepExprHolder(ExpressionOwner exprOwner, int stepCount, MultistepExprHolder next)
     	{
     		m_exprOwner = exprOwner;
  -  		assertion(null != m_exprOwner, "exprOwner can not be null!");
  +  		assert(null != m_exprOwner, "exprOwner can not be null!");
     		m_stepCount = stepCount;
     		m_next = next;
     	}
  @@ -1433,7 +1433,7 @@
   			next = next.m_next;
   		}
   		
  -		assertion(false, "unlink failed!!!");
  +		assert(false, "unlink failed!!!");
   		return null;
   	}
   		
  
  
  
  1.25.4.1  +41 -15    xml-xalan/java/src/org/apache/xalan/templates/Stylesheet.java
  
  Index: Stylesheet.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/Stylesheet.java,v
  retrieving revision 1.25
  retrieving revision 1.25.4.1
  diff -u -r1.25 -r1.25.4.1
  --- Stylesheet.java	22 Mar 2002 01:04:40 -0000	1.25
  +++ Stylesheet.java	14 Aug 2002 19:21:28 -0000	1.25.4.1
  @@ -393,28 +393,35 @@
      *
      * @return true if the prefix should normally be excluded.>
      */
  -  public boolean containsExcludeResultPrefix(String prefix, String uri) 
  +  public boolean containsExcludeResultPrefix(String prefix, String uri)
     {
   
  -    if (null == m_ExcludeResultPrefixs || uri == null )
  -      return false;
  -    
  -    // This loop is ok here because this code only runs during
  -    // stylesheet compile time.
  -    for (int i =0; i< m_ExcludeResultPrefixs.size(); i++)
  +    if (null != m_ExcludeResultPrefixs && uri != null)
       {
  -      if (uri.equals(getNamespaceForPrefix(m_ExcludeResultPrefixs.elementAt(i))))
  -        return true;
  +
  +      // This loop is ok here because this code only runs during
  +      // stylesheet compile time.
  +      for (int i = 0; i < m_ExcludeResultPrefixs.size(); i++)
  +      {
  +        if (uri
  +          .equals(getNamespaceForPrefix(m_ExcludeResultPrefixs.elementAt(i))))
  +          return true;
  +      }
       }
  -    
  -    return false;
   
  -  /*  if (prefix.length() == 0)
  -      prefix = Constants.ATTRVAL_DEFAULT_PREFIX;
  +    // Go up the parent chain to see if any of them might want to exclude.
  +    // Note that the parent may not be a parent as regards XML, but may 
  +    // be another stylesheet.
  +    return (null != m_parentNode)
  +      ? m_parentNode.containsExcludeResultPrefix(prefix, uri)
  +      : false;
   
  -    return m_ExcludeResultPrefixs.contains(prefix); */
  +    /*  if (prefix.length() == 0)
  +        prefix = Constants.ATTRVAL_DEFAULT_PREFIX;
  +    
  +      return m_ExcludeResultPrefixs.contains(prefix); */
     }
  -
  +  
     /**
      * The "id" property.
      * @serial
  @@ -470,6 +477,25 @@
     {
       return m_Version;
     }
  +  
  +  /**
  +   * Get the "version" property as a double.  If no version information can 
  +   * be found, revert to 1.0.
  +   * @see <a href="http://www.w3.org/TR/xslt#forwards">forwards in XSLT Specification</a>
  +   *
  +   * @return The value of the "version" property as a double.
  +   */
  +  public double getVersionNumber()
  +  {
  +    if(null == m_Version)
  +      return 1.0;
  +    else
  +    {
  +      return Double.valueOf(m_Version).doubleValue();
  +      // return Double.parseDouble(m_Version);
  +    }
  +  }
  +
   
     /**
      * The "xsl:import" list.
  
  
  
  1.47.2.1  +90 -22    xml-xalan/java/src/org/apache/xalan/templates/StylesheetRoot.java
  
  Index: StylesheetRoot.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/StylesheetRoot.java,v
  retrieving revision 1.47
  retrieving revision 1.47.2.1
  diff -u -r1.47 -r1.47.2.1
  --- StylesheetRoot.java	10 Jun 2002 19:24:42 -0000	1.47
  +++ StylesheetRoot.java	14 Aug 2002 19:21:28 -0000	1.47.2.1
  @@ -74,7 +74,6 @@
   import org.apache.xalan.serialize.*;
   import org.apache.xml.utils.*;
   import org.apache.xpath.*;
  -import org.apache.xpath.compiler.XPathParser;
   import org.apache.xalan.trace.*;
   import org.apache.xalan.res.XSLTErrorResources;
   import org.apache.xalan.res.XSLMessages;
  @@ -116,7 +115,7 @@
   
       try
       {
  -      m_selectDefault = new XPath("node()", this, this, XPath.SELECT, errorListener);
  +      m_selectDefault = new XPath("node()", this, this, XPath.SELECT, errorListener, getVersionNumber());
   
         initDefaultRule(errorListener);
       }
  @@ -483,7 +482,14 @@
      * will be set as stylesheets are encountered.
      * @serial
      */
  -  private OutputProperties m_outputProperties;
  +  private OutputProperties m_outputProperties; // Keep for time being?? 
  +  // Can set from ElemPrincipalResultDocument.
  +  protected void setOutputProperties(OutputProperties primaryProps)
  +  {
  +    m_outputProperties = primaryProps;
  +  }
  +  
  +  private Hashtable m_outputPropertiesTable = new Hashtable();
   
     /**
      * Recompose the output format object from the included elements.
  @@ -492,9 +498,30 @@
      */
     void recomposeOutput(OutputProperties oprops)
       throws TransformerException
  -  {
  -    
  -    m_outputProperties.copyFrom(oprops);
  +  { 
  +      // code commented out because of regressions. -sb   
  +      // //System.out.println("StylesheetRoot.recomposeOutput() " + oprops.getName());
  +      // // put into m_outputPropertiesTable
  +      // 
  +      // Object key = (oprops.getName() != null)
  +      //               ? (Object)oprops.getName(): (Object)new String("") ;
  +      // 
  +      // if (m_outputPropertiesTable.containsKey(key))
  +      // {
  +      //   //System.out.println("has key " + key);
  +      //   ((OutputProperties)m_outputPropertiesTable.get(key)).copyFrom(oprops);
  +      // }
  +      // else
  +      // { 
  +      //   //System.out.println("new key " + key);
  +      //   OutputProperties outputProps = new OutputProperties(Method.XML);
  +      //   outputProps.copyFrom(oprops);
  +      //   m_outputPropertiesTable.put(key, outputProps);
  +      // }
  +      //m_outputProperties.copyFrom(oprops); 
  +       
  +      // Code restored from Xalan main branch.   
  +      m_outputProperties.copyFrom(oprops);
     }
   
     /**
  @@ -515,7 +542,19 @@
       // System.out.println("getOutputComposed.getIndenting: "+m_outputProperties.getIndenting());
       return m_outputProperties;
     }
  +  
  +  //dml
  +  public OutputProperties getOutputComposed(QName qname)
  +  {
  +    Object key = (qname != null)
  +                  ? (Object)qname : (Object)new String("") ;
  +    OutputProperties oprops = (OutputProperties)m_outputPropertiesTable.get(key);
  +    
  +    return oprops;
  +  }
   
  +  // following flag must be changed to include QName param.
  +  
     /** Flag indicating whether an output method has been set by the user.
      *  @serial           */
     private boolean m_outputMethodSet = false;
  @@ -1059,7 +1098,8 @@
      *
      * @throws TransformerException
      */
  -  private void initDefaultRule(ErrorListener errorListener) throws TransformerException
  +  private void initDefaultRule(ErrorListener errorListener)
  +    throws TransformerException
     {
   
       // Then manufacture a default
  @@ -1067,7 +1107,14 @@
   
       m_defaultRule.setStylesheet(this);
   
  -    XPath defMatch = new XPath("*", this, this, XPath.MATCH, errorListener);
  +    XPath defMatch =
  +      new XPath(
  +        "*",
  +        this,
  +        this,
  +        XPath.MATCH,
  +        errorListener,
  +        getVersionNumber());
   
       m_defaultRule.setMatch(defMatch);
   
  @@ -1076,7 +1123,7 @@
       childrenElement.setIsDefaultTemplate(true);
       childrenElement.setSelect(m_selectDefault);
       m_defaultRule.appendChild(childrenElement);
  -    
  +
       m_startRule = m_defaultRule;
   
       // -----------------------------
  @@ -1084,7 +1131,14 @@
   
       m_defaultTextRule.setStylesheet(this);
   
  -    defMatch = new XPath("text() | @*", this, this, XPath.MATCH, errorListener);
  +    defMatch =
  +      new XPath(
  +        "text() | @*",
  +        this,
  +        this,
  +        XPath.MATCH,
  +        errorListener,
  +        getVersionNumber());
   
       m_defaultTextRule.setMatch(defMatch);
   
  @@ -1092,7 +1146,14 @@
   
       m_defaultTextRule.appendChild(elemValueOf);
   
  -    XPath selectPattern = new XPath(".", this, this, XPath.SELECT, errorListener);
  +    XPath selectPattern =
  +      new XPath(
  +        ".",
  +        this,
  +        this,
  +        XPath.SELECT,
  +        errorListener,
  +        getVersionNumber());
   
       elemValueOf.setSelect(selectPattern);
   
  @@ -1101,7 +1162,14 @@
   
       m_defaultRootRule.setStylesheet(this);
   
  -    defMatch = new XPath("/", this, this, XPath.MATCH, errorListener);
  +    defMatch =
  +      new XPath(
  +        "/",
  +        this,
  +        this,
  +        XPath.MATCH,
  +        errorListener,
  +        getVersionNumber());
   
       m_defaultRootRule.setMatch(defMatch);
   
  @@ -1216,7 +1284,7 @@
       /**
        * Class to track state global state during the compose() operation.
        */
  -    class ComposeState
  +    class ComposeState implements VariableComposeState
       {
         ComposeState()
         {
  @@ -1261,7 +1329,7 @@
          * @param qname A qualified name of a param or variable, should be non-null.
          * @return the index where the variable was added.
          */
  -      int addVariableName(final org.apache.xml.utils.QName qname)
  +      public int addVariableName(final org.apache.xml.utils.QName qname)
         {
           int pos = m_variableNames.size();
           m_variableNames.addElement(qname);
  @@ -1271,12 +1339,12 @@
           return pos;
         }
         
  -      void resetStackFrameSize()
  +      public void resetStackFrameSize()
         {
           m_maxStackFrameSize = 0;
         }
         
  -      int getFrameSize()
  +      public int getFrameSize()
         {
           return m_maxStackFrameSize;
         }
  @@ -1286,7 +1354,7 @@
          * in a template element at startElement, so that it can be popped 
          * at endElement.
          */
  -      int getCurrentStackFrameSize()
  +      public int getCurrentStackFrameSize()
         {
           return m_variableNames.size();
         }
  @@ -1294,24 +1362,24 @@
         /**
          * Set the current size of the stack frame.
          */
  -      void setCurrentStackFrameSize(int sz)
  +      public void setCurrentStackFrameSize(int sz)
         {
           m_variableNames.setSize(sz);
         }
         
  -      int getGlobalsSize()
  +      public int getGlobalsSize()
         {
           return m_variables.size();
         }
         
         IntStack m_marks = new IntStack();
         
  -      void pushStackMark()
  +      public void pushStackMark()
         {
           m_marks.push(getCurrentStackFrameSize());
         }
         
  -      void popStackMark()
  +      public void popStackMark()
         {
           int mark = m_marks.pop();
           setCurrentStackFrameSize(mark);
  @@ -1324,7 +1392,7 @@
          * returned is owned by this class, and so should not really be mutated, or 
          * stored anywhere.
          */
  -      java.util.Vector getVariableNames()
  +      public java.util.Vector getVariableNames()
         {
           return m_variableNames;
         }
  
  
  
  1.33.4.1  +16 -21    xml-xalan/java/src/org/apache/xalan/templates/TemplateList.java
  
  Index: TemplateList.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/TemplateList.java,v
  retrieving revision 1.33
  retrieving revision 1.33.4.1
  diff -u -r1.33 -r1.33.4.1
  --- TemplateList.java	10 Apr 2002 20:33:58 -0000	1.33
  +++ TemplateList.java	14 Aug 2002 19:21:29 -0000	1.33.4.1
  @@ -56,27 +56,20 @@
    */
   package org.apache.xalan.templates;
   
  +import java.io.Serializable;
  +import java.util.Enumeration;
   import java.util.Hashtable;
   import java.util.Vector;
  -import java.util.Enumeration;
  -
  -import java.io.Serializable;
  -
  -//import org.w3c.dom.Node;
  -import org.apache.xml.dtm.DTM;
  -
  -import org.apache.xml.dtm.ref.ExpandedNameTable;
   
   import javax.xml.transform.TransformerException;
  -
  +import org.apache.xalan.res.XSLTErrorResources;
  +import org.apache.xml.dtm.DTM;
   import org.apache.xml.utils.QName;
  -import org.apache.xml.utils.PrefixResolver;
  -import org.apache.xpath.XPath;
  -import org.apache.xpath.compiler.PsuedoNames;
  -import org.apache.xpath.patterns.NodeTest;
   import org.apache.xpath.Expression;
  -import org.apache.xalan.res.XSLTErrorResources;
  +import org.apache.xpath.ExpressionNode;
  +import org.apache.xpath.XPath;
   import org.apache.xpath.XPathContext;
  +import org.apache.xpath.patterns.NodeTest;
   import org.apache.xpath.patterns.StepPattern;
   import org.apache.xpath.patterns.UnionPattern;
   
  @@ -141,12 +134,12 @@
         else if (matchExpr instanceof UnionPattern)
         {
           UnionPattern upat = (UnionPattern) matchExpr;
  -        StepPattern[] pats = upat.getPatterns();
  +        ExpressionNode[] pats = upat.getPatterns();
           int n = pats.length;
   
           for (int i = 0; i < n; i++)
           {
  -          insertPatternInTable(pats[i], template);
  +          insertPatternInTable((StepPattern)pats[i], template);
           }
         }
         else
  @@ -640,7 +633,8 @@
         // current ElemTemplateElement via a cast to the prefix resolver.
         // Setting this fixes bug idkey03.
         xctxt.pushNamespaceContextNull();
  -      xctxt.pushCurrentNodeAndExpression(targetNode, targetNode);
  +      xctxt.pushCurrentNode(targetNode);
  +      xctxt.pushCurrentExpressionNode(targetNode);
         try
         {
           do
  @@ -705,7 +699,8 @@
         // current ElemTemplateElement via a cast to the prefix resolver.
         // Setting this fixes bug idkey03.
         xctxt.pushNamespaceContextNull();
  -      xctxt.pushCurrentNodeAndExpression(targetNode, targetNode);
  +      xctxt.pushCurrentNode(targetNode);
  +      xctxt.pushCurrentExpressionNode(targetNode);
         try
         {
           do
  @@ -876,11 +871,11 @@
     private void putHead(String key, TemplateSubPatternAssociation assoc)
     {
   
  -    if (key.equals(PsuedoNames.PSEUDONAME_TEXT))
  +    if (key.equals(StepPattern.PSEUDONAME_TEXT))
         m_textPatterns = assoc;
  -    else if (key.equals(PsuedoNames.PSEUDONAME_ROOT))
  +    else if (key.equals(StepPattern.PSEUDONAME_ROOT))
         m_docPatterns = assoc;
  -    else if (key.equals(PsuedoNames.PSEUDONAME_COMMENT))
  +    else if (key.equals(StepPattern.PSEUDONAME_COMMENT))
         m_commentPatterns = assoc;
   
       m_patternTable.put(key, assoc);
  
  
  
  1.7.2.1   +12 -6     xml-xalan/java/src/org/apache/xalan/templates/XUnresolvedVariable.java
  
  Index: XUnresolvedVariable.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/XUnresolvedVariable.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- XUnresolvedVariable.java	6 Jun 2002 20:25:17 -0000	1.7
  +++ XUnresolvedVariable.java	14 Aug 2002 19:21:29 -0000	1.7.2.1
  @@ -77,6 +77,8 @@
    */
   public class XUnresolvedVariable extends XObject
   {  
  +	ElemVariable m_elemVariable;
  +	
     /** The node context for execution. */
     transient private int m_context;
     
  @@ -122,7 +124,8 @@
                                int varStackPos, int varStackContext,
                                boolean isGlobal)
     {
  -    super(obj);
  +    //super(obj);
  +    m_elemVariable=obj;
       m_context = sourceNode;
       m_transformer = transformer;
       
  @@ -160,13 +163,12 @@
       //// vars.setStackFrame(m_varStackPos);
      
   
  -    ElemVariable velem = (ElemVariable)m_obj;
       try
       {
         m_doneEval = false;
  -      if(-1 != velem.m_frameSize)
  -      	vars.link(velem.m_frameSize);
  -      XObject var = velem.getValue(m_transformer, m_context);
  +      if(-1 != m_elemVariable.m_frameSize)
  +      	vars.link(m_elemVariable.m_frameSize);
  +      XObject var = m_elemVariable.getValue(m_transformer, m_context);
         m_doneEval = true;
         return var;
       }
  @@ -175,7 +177,7 @@
         // These two statements need to be combined into one operation.
         // vars.setStackFrame(currentFrame);
         
  -      if(-1 != velem.m_frameSize)
  +      if(-1 != m_elemVariable.m_frameSize)
   	  	vars.unlink(currentFrame);
       }
     }
  @@ -227,4 +229,8 @@
     }
   
   
  +  public Object object()
  +  {
  +  	return m_elemVariable;
  +  }
   }
  
  
  
  1.2.4.1   +9 -2      xml-xalan/java/src/org/apache/xalan/templates/XUnresolvedVariableSimple.java
  
  Index: XUnresolvedVariableSimple.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/XUnresolvedVariableSimple.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- XUnresolvedVariableSimple.java	22 Mar 2002 01:04:40 -0000	1.2
  +++ XUnresolvedVariableSimple.java	14 Aug 2002 19:21:29 -0000	1.2.4.1
  @@ -15,9 +15,12 @@
    */
   public class XUnresolvedVariableSimple extends XObject
   {
  +	ElemVariable m_elemVariable;
  +	
     public XUnresolvedVariableSimple(ElemVariable obj)
     {
  -    super(obj);
  +    //super(obj);
  +	m_elemVariable=obj; 
     }
       
   	
  @@ -32,7 +35,7 @@
      */
     public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
     {
  -  	Expression expr = ((ElemVariable)m_obj).getSelect().getExpression();
  +  	Expression expr = m_elemVariable.getSelect().getExpression();
       XObject xobj = expr.execute(xctxt);
       xobj.allowDetachToRelease(false);
       return xobj;
  @@ -59,6 +62,10 @@
       return "XUnresolvedVariableSimple (" + object().getClass().getName() + ")";
     }
   
  +	public Object object()
  +	{
  +		return m_elemVariable;
  +	}
   
   }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +1052 -0   xml-xalan/java/src/org/apache/xalan/templates/Attic/ElemForEachGroup.java
  
  
  
  
  1.1.4.1   +83 -0     xml-xalan/java/src/org/apache/xalan/templates/Attic/ElemFuncResult.java
  
  
  
  
  1.1.4.1   +261 -0    xml-xalan/java/src/org/apache/xalan/templates/Attic/ElemFunction.java
  
  
  
  
  1.1.2.1   +235 -0    xml-xalan/java/src/org/apache/xalan/templates/Attic/ElemNamespace.java
  
  
  
  
  1.1.4.1   +299 -0    xml-xalan/java/src/org/apache/xalan/templates/Attic/ElemPrincipalResultDocument.java
  
  
  
  
  1.1.4.1   +278 -0    xml-xalan/java/src/org/apache/xalan/templates/Attic/ElemResultDocument.java
  
  
  
  
  1.1.2.1   +170 -0    xml-xalan/java/src/org/apache/xalan/templates/Attic/FuncCurrentGroup.java
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.14.4.1  +38 -8     xml-xalan/java/src/org/apache/xalan/transformer/NodeSorter.java
  
  Index: NodeSorter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/NodeSorter.java,v
  retrieving revision 1.14
  retrieving revision 1.14.4.1
  diff -u -r1.14 -r1.14.4.1
  --- NodeSorter.java	22 Mar 2002 01:04:41 -0000	1.14
  +++ NodeSorter.java	14 Aug 2002 19:21:30 -0000	1.14.4.1
  @@ -71,7 +71,9 @@
   import org.apache.xpath.NodeSetDTM;
   import org.apache.xpath.objects.XObject;
   import org.apache.xpath.objects.XNodeSet;
  +import org.apache.xpath.objects.XSequence;
   import org.apache.xml.utils.NodeVector;
  +import org.apache.xml.utils.WrappedRuntimeException;
   
   import javax.xml.transform.TransformerException;
   
  @@ -173,7 +175,7 @@
     {
   
       int result = 0;
  -    NodeSortKey k = (NodeSortKey) m_keys.elementAt(kIndex);
  +    SortKey k = (SortKey) m_keys.elementAt(kIndex);
   
       if (k.m_treatAsNumbers)
       {
  @@ -532,6 +534,17 @@
        *
        * @throws javax.xml.transform.TransformerException
        */
  +    NodeCompareElem() 
  +    {}
  +		
  +		/**
  +     * Constructor NodeCompareElem
  +     *
  +     *
  +     * @param node Current node
  +     *
  +     * @throws javax.xml.transform.TransformerException
  +     */
       NodeCompareElem(int node) throws javax.xml.transform.TransformerException
       {
   
  @@ -541,7 +554,7 @@
   
         if (!m_keys.isEmpty())
         {
  -        NodeSortKey k1 = (NodeSortKey) m_keys.elementAt(0);
  +        SortKey k1 = (SortKey) m_keys.elementAt(0);
           XObject r = k1.m_selectPat.execute(m_execContext, node,
                                              k1.m_namespaceContext);
   
  @@ -561,14 +574,31 @@
           {
             m_key1Value = k1.m_col.getCollationKey(r.str());
           }
  +//        if (r.getType() == XObject.CLASS_NODESET)
  +//        {
  +//          // %REVIEW%
  +//          DTMIterator ni = ((XNodeSet)r).iterRaw();
  +//          int current = ni.getCurrentNode();
  +//          if(DTM.NULL == current)
  +//            current = ni.nextNode();
  +//
  +//          // if (ni instanceof ContextNodeList) // %REVIEW%
  +//          tryNextKey = (DTM.NULL != current);
  +//
  +//          // else abdicate... should never happen, but... -sb
  +//        }
   
           if (r.getType() == XObject.CLASS_NODESET)
           {
  -          // %REVIEW%
  -          DTMIterator ni = ((XNodeSet)r).iterRaw();
  -          int current = ni.getCurrentNode();
  -          if(DTM.NULL == current)
  -            current = ni.nextNode();
  +          
  +          int current = r.getNodeHandle();
  +          if (DTM.NULL == current)
  +          {
  +            XSequence xseq = (XSequence) r.xseq();
  +            XObject next = xseq.next();
  +            if (null != next)
  +              current = next.getNodeHandle();
  +          }
   
             // if (ni instanceof ContextNodeList) // %REVIEW%
             tryNextKey = (DTM.NULL != current);
  @@ -578,7 +608,7 @@
   
           if (m_keys.size() > 1)
           {
  -          NodeSortKey k2 = (NodeSortKey) m_keys.elementAt(1);
  +          SortKey k2 = (SortKey) m_keys.elementAt(1);
   
             if (!tryNextKey)
             {
  
  
  
  1.56.2.1  +2 -4      xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeHandler.java
  
  Index: ResultTreeHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeHandler.java,v
  retrieving revision 1.56
  retrieving revision 1.56.2.1
  diff -u -r1.56 -r1.56.2.1
  --- ResultTreeHandler.java	19 Jul 2002 19:57:54 -0000	1.56
  +++ ResultTreeHandler.java	14 Aug 2002 19:21:30 -0000	1.56.2.1
  @@ -1210,10 +1210,9 @@
   
         m_attributes.addAttribute("http://www.w3.org/2000/xmlns/", 
                                   prefix, name, "CDATA", uri);
  -      
  -      m_nsDeclsHaveBeenAdded = true;        
       }
   
  +    m_nsDeclsHaveBeenAdded = true;
     }
   
     /**
  @@ -1432,8 +1431,7 @@
       if (m_elemIsPending)
       {
         // %REVIEW% %OPT% Is this ever needed?????
  -      // The check is not needed. See Bugzilla 10306. 
  -      // if (!m_nsDeclsHaveBeenAdded)
  +      if (!m_nsDeclsHaveBeenAdded)
   	addNSDeclsToAttrs();
   
         if (null == uri)  // defensive, should not really need this.
  
  
  
  1.6.12.1  +2 -2      xml-xalan/java/src/org/apache/xalan/transformer/TransformSnapshotImpl.java
  
  Index: TransformSnapshotImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformSnapshotImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.6.12.1
  diff -u -r1.6 -r1.6.12.1
  --- TransformSnapshotImpl.java	3 Aug 2001 17:06:05 -0000	1.6
  +++ TransformSnapshotImpl.java	14 Aug 2002 19:21:30 -0000	1.6.12.1
  @@ -201,7 +201,7 @@
         XPathContext xpc = transformer.getXPathContext();
   
         m_variableStacks = (VariableStack) xpc.getVarStack().clone();
  -      m_currentNodes = (int[]) xpc.getCurrentNodeStack().clone();
  +//      m_currentNodes = (int[]) xpc.getCurrentNodeStack().clone();
         m_currentExpressionNodes =
           (int[]) xpc.getCurrentExpressionNodeStack().clone();
         m_contextNodeLists = (Stack) xpc.getContextNodeListsStack().clone();
  @@ -269,7 +269,7 @@
         XPathContext xpc = transformer.getXPathContext();
   
         xpc.setVarStack((VariableStack) m_variableStacks.clone());
  -      xpc.setCurrentNodeStack((int[]) m_currentNodes.clone());
  +//      xpc.setCurrentNodeStack((int[]) m_currentNodes.clone());
         xpc.setCurrentExpressionNodeStack(
           (int[]) m_currentExpressionNodes.clone());
         xpc.setContextNodeListsStack((Stack) m_contextNodeLists.clone());
  
  
  
  1.133.2.1 +32 -18    xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java
  
  Index: TransformerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java,v
  retrieving revision 1.133
  retrieving revision 1.133.2.1
  diff -u -r1.133 -r1.133.2.1
  --- TransformerImpl.java	10 Jun 2002 19:24:42 -0000	1.133
  +++ TransformerImpl.java	14 Aug 2002 19:21:30 -0000	1.133.2.1
  @@ -114,7 +114,6 @@
   import org.apache.xml.utils.SAXSourceLocator;
   import org.apache.xml.utils.WrappedRuntimeException;
   import org.apache.xpath.Arg;
  -import org.apache.xpath.DOMHelper;
   import org.apache.xpath.VariableStack;
   import org.apache.xpath.XPathContext;
   import org.apache.xpath.objects.XObject;
  @@ -411,7 +410,7 @@
     private ExtensionsTable m_extensionsTable = null;
   
     /**
  -   * Get the extensions table object. 
  +   * Get the extensions table object.
      *
      * @return The extensions table.
      */
  @@ -505,7 +504,7 @@
         
         m_currentMatchTemplates.removeAllElements();
         m_currentMatchedNodes.removeAllElements();
  -      
  +
         m_resultTreeHandler = null;
         m_outputTarget = null;
         m_keyManager = new KeyManager();
  @@ -679,19 +678,7 @@
   
         if (null != e)
         {
  -        if (e instanceof javax.xml.transform.TransformerException)
  -        {
  -          throw (javax.xml.transform.TransformerException) e;
  -        }
  -        else if (e instanceof org.apache.xml.utils.WrappedRuntimeException)
  -        {
  -          fatalError(
  -              ((org.apache.xml.utils.WrappedRuntimeException) e).getException());
  -        }
  -        else
  -        {
  -          throw new javax.xml.transform.TransformerException(e);
  -        }
  +        fatalError(e);
         }
         else if (null != m_resultTreeHandler)
         {
  @@ -734,6 +721,8 @@
     {
       if (throwable instanceof org.xml.sax.SAXParseException)
         m_errorHandler.fatalError(new TransformerException(throwable.getMessage(),new SAXSourceLocator((org.xml.sax.SAXParseException)throwable)));
  +    if (throwable instanceof TransformerException)
  +      m_errorHandler.fatalError((TransformerException)throwable);
       else
         m_errorHandler.fatalError(new TransformerException(throwable));
       
  @@ -1095,7 +1084,7 @@
             throws TransformerException
     {
                   transform(xmlSource, outputTarget, true);
  -        }
  +  }
   
     /**
      * Process the source tree to the output result.
  @@ -1371,6 +1360,30 @@
   
       return format;
     }
  +  
  +  private org.apache.xml.utils.StringVector fileOutVector = null;
  +  
  +  /**
  +   * XSLT 2.0 -- cannot output to same file more than once during a transformation.
  +   * @param fileName Absolute file pathname.
  +   * @returns true if this fileName has already been used.
  +   */
  +  public boolean OutputFileAlreadyUsed(String fileName)
  +  {
  +    if (null == fileOutVector)
  +      fileOutVector = new org.apache.xml.utils.StringVector();
  +    
  +    if (fileOutVector.contains(fileName))
  +    {
  +      // System.out.println("OutputFileAlreadyUsed " + fileName);
  +      return true;
  +    }
  +    else
  +    {
  +      fileOutVector.addElement(fileName);
  +      return false;
  +    }
  +  }
   
     /**
      * <meta name="usage" content="internal"/>
  @@ -2429,7 +2442,7 @@
           caseOrderUpper = false;
         }
   
  -      keys.addElement(new NodeSortKey(this, sort.getSelect(), treatAsNumbers,
  +      keys.addElement(new SortKey(this, sort.getSelect(), treatAsNumbers,
                                         descending, langString, caseOrderUpper,
                                         foreach));
         if (TransformerImpl.S_DEBUG)
  @@ -2486,6 +2499,7 @@
     {
     	return m_currentTemplateElements;
     }
  +  
   
     /**
      * Push the current template element.
  
  
  
  1.12.12.1 +0 -1      xml-xalan/java/src/org/apache/xalan/transformer/TreeWalker2Result.java
  
  Index: TreeWalker2Result.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TreeWalker2Result.java,v
  retrieving revision 1.12
  retrieving revision 1.12.12.1
  diff -u -r1.12 -r1.12.12.1
  --- TreeWalker2Result.java	20 Jul 2001 12:42:31 -0000	1.12
  +++ TreeWalker2Result.java	14 Aug 2002 19:21:31 -0000	1.12.12.1
  @@ -64,7 +64,6 @@
   import org.apache.xml.dtm.ref.DTMTreeWalker;
   import org.apache.xml.utils.MutableAttrListImpl;
   import org.apache.xalan.templates.ElemTemplateElement;
  -import org.apache.xpath.DOMHelper;
   import org.apache.xpath.XPathContext;
   
   /**
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +462 -0    xml-xalan/java/src/org/apache/xalan/transformer/Attic/GroupSorter.java
  
  
  
  
  1.1.2.1   +524 -0    xml-xalan/java/src/org/apache/xalan/transformer/Attic/GroupingIterator.java
  
  
  
  
  1.1.2.1   +649 -0    xml-xalan/java/src/org/apache/xalan/transformer/Attic/ItemSorter.java
  
  
  
  
  1.1.2.1   +167 -0    xml-xalan/java/src/org/apache/xalan/transformer/Attic/SortKey.java
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.12.2.1  +3 -3      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.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.10.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/DOM.java
  
  Index: DOM.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/DOM.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  
  
  
  1.2.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/DOMCache.java
  
  Index: DOMCache.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/DOMCache.java,v
  retrieving revision 1.2
  retrieving revision 1.2.12.1
  diff -u -r1.2 -r1.2.12.1
  
  
  
  1.2.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/NodeIterator.java
  
  Index: NodeIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/NodeIterator.java,v
  retrieving revision 1.2
  retrieving revision 1.2.12.1
  diff -u -r1.2 -r1.2.12.1
  
  
  
  1.1.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/ProcessorVersion.java
  
  Index: ProcessorVersion.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/ProcessorVersion.java,v
  retrieving revision 1.1
  retrieving revision 1.1.12.1
  diff -u -r1.1 -r1.1.12.1
  
  
  
  1.1.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/StripFilter.java
  
  Index: StripFilter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/StripFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.1.12.1
  diff -u -r1.1 -r1.1.12.1
  
  
  
  1.4.2.1   +1 -3      xml-xalan/java/src/org/apache/xalan/xsltc/Translet.java
  
  Index: Translet.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/Translet.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- Translet.java	25 Jul 2002 11:44:19 -0000	1.4
  +++ Translet.java	14 Aug 2002 19:21:31 -0000	1.4.2.1
  @@ -80,6 +80,4 @@
   	throws TransletException;
       public void addAuxiliaryClass(Class auxClass);
       public Class getAuxiliaryClass(String className);
  -    public String[] getNamesArray();
  -    public String[] getNamespaceArray();
   }
  
  
  
  1.2.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/TransletException.java
  
  Index: TransletException.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/TransletException.java,v
  retrieving revision 1.2
  retrieving revision 1.2.12.1
  diff -u -r1.2 -r1.2.12.1
  
  
  
  1.10.2.1  +1 -3      xml-xalan/java/src/org/apache/xalan/xsltc/TransletOutputHandler.java
  
  Index: TransletOutputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/TransletOutputHandler.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- TransletOutputHandler.java	12 Aug 2002 19:33:55 -0000	1.10
  +++ TransletOutputHandler.java	14 Aug 2002 19:21:31 -0000	1.10.2.1
  @@ -82,8 +82,6 @@
       public void comment(String comment) throws TransletException;
       public void processingInstruction(String target, String data)
   	throws TransletException;
  -    public void startCDATA() throws TransletException;
  -    public void endCDATA() throws TransletException;
       public void setType(int type);
       public void setIndent(boolean indent);
       public void omitHeader(boolean value);
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.11.2.1  +2 -2      xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/Compile.java
  
  Index: Compile.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/Compile.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- Compile.java	9 Jul 2002 15:31:24 -0000	1.11
  +++ Compile.java	14 Aug 2002 19:21:32 -0000	1.11.2.1
  @@ -82,7 +82,7 @@
   
       // Versioning numbers  for the compiler -v option output
       private static int VERSION_MAJOR = 1;
  -    private static int VERSION_MINOR = 1;
  +    private static int VERSION_MINOR = 0;
       private static int VERSION_DELTA = 0;
    
   
  
  
  
  1.20.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/Transform.java
  
  Index: Transform.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/Transform.java,v
  retrieving revision 1.20
  retrieving revision 1.20.2.1
  diff -u -r1.20 -r1.20.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.java
  
  Index: GetOpt.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.java,v
  retrieving revision 1.1
  retrieving revision 1.1.12.1
  diff -u -r1.1 -r1.1.12.1
  
  
  
  1.1.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/getopt/GetOptsException.java
  
  Index: GetOptsException.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/getopt/GetOptsException.java,v
  retrieving revision 1.1
  retrieving revision 1.1.12.1
  diff -u -r1.1 -r1.1.12.1
  
  
  
  1.1.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/getopt/IllegalArgumentException.java
  
  Index: IllegalArgumentException.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/getopt/IllegalArgumentException.java,v
  retrieving revision 1.1
  retrieving revision 1.1.12.1
  diff -u -r1.1 -r1.1.12.1
  
  
  
  1.1.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/getopt/MissingOptArgException.java
  
  Index: MissingOptArgException.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/getopt/MissingOptArgException.java,v
  retrieving revision 1.1
  retrieving revision 1.1.12.1
  diff -u -r1.1 -r1.1.12.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.5.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AbsoluteLocationPath.java
  
  Index: AbsoluteLocationPath.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AbsoluteLocationPath.java,v
  retrieving revision 1.5
  retrieving revision 1.5.8.1
  diff -u -r1.5 -r1.5.8.1
  
  
  
  1.6.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AbsolutePathPattern.java
  
  Index: AbsolutePathPattern.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AbsolutePathPattern.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AlternativePattern.java
  
  Index: AlternativePattern.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AlternativePattern.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.6.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AncestorPattern.java
  
  Index: AncestorPattern.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AncestorPattern.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  
  
  
  1.10.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ApplyImports.java
  
  Index: ApplyImports.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ApplyImports.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  
  
  
  1.14.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ApplyTemplates.java
  
  Index: ApplyTemplates.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ApplyTemplates.java,v
  retrieving revision 1.14
  retrieving revision 1.14.2.1
  diff -u -r1.14 -r1.14.2.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ArgumentList.java
  
  Index: ArgumentList.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ArgumentList.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.4.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Attribute.java
  
  Index: Attribute.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Attribute.java,v
  retrieving revision 1.4
  retrieving revision 1.4.12.1
  diff -u -r1.4 -r1.4.12.1
  
  
  
  1.12.2.1  +30 -21    xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AttributeSet.java
  
  Index: AttributeSet.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AttributeSet.java,v
  retrieving revision 1.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  --- AttributeSet.java	9 Jul 2002 15:33:56 -0000	1.12
  +++ AttributeSet.java	14 Aug 2002 19:21:32 -0000	1.12.2.1
  @@ -84,7 +84,6 @@
       // Element contents
       private QName            _name;
       private UseAttributeSets _useSets;
  -    private AttributeSet     _mergeSet;
       private String           _method;
       private boolean          _ignore = false;
       
  @@ -162,10 +161,15 @@
   
   	if (_ignore) return (Type.Void);
   
  -        // _mergeSet Point to any previous definition of this attribute set
  -	_mergeSet = stable.addAttributeSet(this);
  -
  -	_method = AttributeSetPrefix + getXSLTC().nextAttributeSetSerial();
  +	final AttributeSet other = stable.addAttributeSet(this);
  +	if (other != null) {
  +	    _method = other.getMethodName();
  +	    merge(other);
  +	    other.ignore();
  +	}
  +	else {
  +	    _method = AttributeSetPrefix + getXSLTC().nextAttributeSetSerial();
  +	}
   
   	if (_useSets != null) _useSets.typeCheck(stable);
   	typeCheckContents(stable);
  @@ -173,6 +177,26 @@
       }
   
       /**
  +     * Merge this attribute set with some other one
  +     */
  +    private void merge(AttributeSet other) {
  +	// Both attribute sets may inherit from other sets...
  +	if (_useSets == null)
  +	    _useSets = other._useSets;
  +	else
  +	    _useSets.addAttributeSets(other.getAttribute("use-attribute-sets"));
  +
  +	// Merge the contents of the two attribute sets...
  +	final Enumeration attributes = other.elements();
  +	while (attributes.hasMoreElements()) {
  +	    SyntaxTreeNode element = (SyntaxTreeNode)attributes.nextElement();
  +	    if (element instanceof XslAttribute) {
  +		setFirstElement((XslAttribute)element);
  +	    }
  +	}
  +    }
  +
  +    /**
        * Compile a method that outputs the attributes in this set
        */
       public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  @@ -181,21 +205,6 @@
   
   	// Create a new method generator for an attribute set method
   	methodGen = new AttributeSetMethodGenerator(_method, classGen);
  -
  -        // Generate a reference to previous attribute-set definitions with the
  -        // same name first.  Those later in the stylesheet take precedence.
  -        if (_mergeSet != null) {
  -            final ConstantPoolGen cpg = classGen.getConstantPool();
  -            final InstructionList il = methodGen.getInstructionList();
  -            final String methodName = _mergeSet.getMethodName();
  -
  -            il.append(classGen.loadTranslet());
  -            il.append(methodGen.loadHandler());
  -            il.append(methodGen.loadIterator());
  -            final int method = cpg.addMethodref(classGen.getClassName(),
  -                                                methodName, ATTR_SET_SIG);
  -            il.append(new INVOKESPECIAL(method));
  -        }
   
   	// Translate other used attribute sets first, as local attributes
   	// take precedence (last attributes overrides first)
  
  
  
  1.2.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AttributeValue.java
  
  Index: AttributeValue.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AttributeValue.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  
  
  
  1.6.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AttributeValueTemplate.java
  
  Index: AttributeValueTemplate.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/AttributeValueTemplate.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  
  
  
  1.7.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/BinOpExpr.java
  
  Index: BinOpExpr.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/BinOpExpr.java,v
  retrieving revision 1.7
  retrieving revision 1.7.8.1
  diff -u -r1.7 -r1.7.8.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/BooleanCall.java
  
  Index: BooleanCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/BooleanCall.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/BooleanExpr.java
  
  Index: BooleanExpr.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/BooleanExpr.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.10.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CallTemplate.java
  
  Index: CallTemplate.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CallTemplate.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  
  
  
  1.14.2.1  +11 -8     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CastExpr.java
  
  Index: CastExpr.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CastExpr.java,v
  retrieving revision 1.14
  retrieving revision 1.14.2.1
  diff -u -r1.14 -r1.14.2.1
  --- CastExpr.java	30 Jul 2002 22:07:52 -0000	1.14
  +++ CastExpr.java	14 Aug 2002 19:21:32 -0000	1.14.2.1
  @@ -88,16 +88,25 @@
   
   	InternalTypeMap.put(Type.Real, Type.Real);
   	InternalTypeMap.put(Type.Real, Type.Int);
  +	InternalTypeMap.put(Type.Real, Type.Lng);
   	InternalTypeMap.put(Type.Real, Type.Boolean);
   	InternalTypeMap.put(Type.Real, Type.String);
   	InternalTypeMap.put(Type.Real, Type.Reference);
   
   	InternalTypeMap.put(Type.Int, Type.Int);
   	InternalTypeMap.put(Type.Int, Type.Real);
  +	InternalTypeMap.put(Type.Int, Type.Lng);
   	InternalTypeMap.put(Type.Int, Type.Boolean);
   	InternalTypeMap.put(Type.Int, Type.String);
   	InternalTypeMap.put(Type.Int, Type.Reference);
   
  +	// GTM, bug 3592 fix. 
  +	InternalTypeMap.put(Type.Lng, Type.Int);
  +	InternalTypeMap.put(Type.Lng, Type.Real);
  +	InternalTypeMap.put(Type.Lng, Type.Boolean);
  +	InternalTypeMap.put(Type.Lng, Type.String);
  +	InternalTypeMap.put(Type.Lng, Type.Reference);
  +
   	InternalTypeMap.put(Type.String, Type.String);
   	InternalTypeMap.put(Type.String, Type.Boolean);
   	InternalTypeMap.put(Type.String, Type.Real);
  @@ -109,7 +118,6 @@
   	InternalTypeMap.put(Type.NodeSet, Type.String);
   	InternalTypeMap.put(Type.NodeSet, Type.Node);
   	InternalTypeMap.put(Type.NodeSet, Type.Reference);
  -	InternalTypeMap.put(Type.NodeSet, Type.Object);
   
   	InternalTypeMap.put(Type.Node, Type.Node);
   	InternalTypeMap.put(Type.Node, Type.Boolean);
  @@ -117,7 +125,6 @@
   	InternalTypeMap.put(Type.Node, Type.String);
   	InternalTypeMap.put(Type.Node, Type.NodeSet);
   	InternalTypeMap.put(Type.Node, Type.Reference);
  -	InternalTypeMap.put(Type.Node, Type.Object);
   
   	InternalTypeMap.put(Type.ResultTree, Type.ResultTree);
   	InternalTypeMap.put(Type.ResultTree, Type.Boolean);
  @@ -125,7 +132,6 @@
   	InternalTypeMap.put(Type.ResultTree, Type.String);
   	InternalTypeMap.put(Type.ResultTree, Type.NodeSet);
   	InternalTypeMap.put(Type.ResultTree, Type.Reference);
  -	InternalTypeMap.put(Type.ResultTree, Type.Object);
   
   	InternalTypeMap.put(Type.Reference, Type.Reference);
   	InternalTypeMap.put(Type.Reference, Type.Boolean);
  @@ -135,9 +141,6 @@
   	InternalTypeMap.put(Type.Reference, Type.Node);
   	InternalTypeMap.put(Type.Reference, Type.NodeSet);
   	InternalTypeMap.put(Type.Reference, Type.ResultTree);
  -	InternalTypeMap.put(Type.Reference, Type.Object);
  -
  -	InternalTypeMap.put(Type.Object, Type.String);
   
   	InternalTypeMap.put(Type.Void, Type.String);
       }
  @@ -202,7 +205,7 @@
   	else if (tleft instanceof ResultTreeType) {
   	    tleft = Type.ResultTree; // multiple instances
   	}
  -	if (InternalTypeMap.maps(tleft, _type) != null) {
  +	if (InternalTypeMap.maps(tleft, _type)) {
   	    return _type;
   	}
   	throw new TypeCheckError(this);	
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CeilingCall.java
  
  Index: CeilingCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CeilingCall.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.6.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Choose.java
  
  Index: Choose.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Choose.java,v
  retrieving revision 1.6
  retrieving revision 1.6.8.1
  diff -u -r1.6 -r1.6.8.1
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Comment.java
  
  Index: Comment.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Comment.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CompilerException.java
  
  Index: CompilerException.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CompilerException.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ConcatCall.java
  
  Index: ConcatCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ConcatCall.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.24.2.1  +7 -3      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Constants.java,v
  retrieving revision 1.24
  retrieving revision 1.24.2.1
  diff -u -r1.24 -r1.24.2.1
  --- Constants.java	9 Jul 2002 17:40:17 -0000	1.24
  +++ Constants.java	14 Aug 2002 19:21:32 -0000	1.24.2.1
  @@ -127,8 +127,6 @@
   	= org.apache.bcel.Constants.ACC_PRIVATE;
       public static final int ACC_PROTECTED 
   	= org.apache.bcel.Constants.ACC_PROTECTED;
  -    public static final int ACC_STATIC
  -	= org.apache.bcel.Constants.ACC_STATIC;
   
       public static final String STRING_SIG         
   	= "Ljava/lang/String;";
  @@ -286,6 +284,8 @@
   	= "java.lang.Double";
       public static final String INTEGER_CLASS      
   	= "java.lang.Integer";
  +    public static final String LONG_CLASS      
  +	= "java.lang.Long";
       public static final String RUNTIME_NODE_CLASS 
   	= "org.apache.xalan.xsltc.runtime.Node";
       public static final String MATH_CLASS         
  @@ -299,6 +299,10 @@
   	= "intValue";
       public static final String INT_VALUE_SIG      
   	= "()I";
  +    public static final String LONG_VALUE          
  +	= "longValue";
  +    public static final String LONG_VALUE_SIG      
  +	= "()J";
       public static final String DOUBLE_VALUE       
   	= "doubleValue";
       public static final String DOUBLE_VALUE_SIG   
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ContainsCall.java
  
  Index: ContainsCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ContainsCall.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.7.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Copy.java
  
  Index: Copy.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Copy.java,v
  retrieving revision 1.7
  retrieving revision 1.7.8.1
  diff -u -r1.7 -r1.7.8.1
  
  
  
  1.10.8.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CopyOf.java
  
  Index: CopyOf.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CopyOf.java,v
  retrieving revision 1.10
  retrieving revision 1.10.8.1
  diff -u -r1.10 -r1.10.8.1
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CurrentCall.java
  
  Index: CurrentCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CurrentCall.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.9.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/DecimalFormatting.java
  
  Index: DecimalFormatting.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/DecimalFormatting.java,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  
  
  
  1.13.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/DocumentCall.java
  
  Index: DocumentCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/DocumentCall.java,v
  retrieving revision 1.13
  retrieving revision 1.13.2.1
  diff -u -r1.13 -r1.13.2.1
  
  
  
  1.7.2.1   +6 -22     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java
  
  Index: ElementAvailableCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- ElementAvailableCall.java	28 Jun 2002 19:58:54 -0000	1.7
  +++ ElementAvailableCall.java	14 Aug 2002 19:21:32 -0000	1.7.2.1
  @@ -88,30 +88,14 @@
       }
   
       /**
  -     * Returns an object representing the compile-time evaluation 
  -     * of an expression. We are only using this for function-available
  -     * and element-available at this time.
  -     */
  -    public Object evaluateAtCompileTime() {
  -	return getResult() ? Boolean.TRUE : Boolean.FALSE;
  -    }
  -
  -    /**
        * Returns the result that this function will return
        */
       public boolean getResult() {
  -	try {
  -	    final LiteralExpr arg = (LiteralExpr) argument();
  -	    final String qname = arg.getValue();
  -	    final int index = qname.indexOf(':');
  -	    final String localName = (index > 0) ? 
  -		qname.substring(index + 1) : qname;
  -	    return getParser().elementSupported(arg.getNamespace(), 
  -					        localName);
  -	}
  -	catch (ClassCastException e) {
  -	    return false;
  -	}
  +	final LiteralExpr arg = (LiteralExpr) argument();
  +	final String qname = arg.getValue();
  +	final int index = qname.indexOf(':');
  +	final String localName = (index > 0) ? qname.substring(index + 1) : qname;
  +	return getParser().elementSupported(arg.getNamespace(), localName);
       }
   
       /**
  
  
  
  1.9.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/EqualityExpr.java
  
  Index: EqualityExpr.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/EqualityExpr.java,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  
  
  
  1.15.2.1  +10 -19    xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Expression.java
  
  Index: Expression.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Expression.java,v
  retrieving revision 1.15
  retrieving revision 1.15.2.1
  diff -u -r1.15 -r1.15.2.1
  --- Expression.java	13 Aug 2002 19:12:32 -0000	1.15
  +++ Expression.java	14 Aug 2002 19:21:32 -0000	1.15.2.1
  @@ -111,15 +111,6 @@
       }
   		
       /**
  -     * Returns an object representing the compile-time evaluation 
  -     * of an expression. We are only using this for function-available
  -     * and element-available at this time.
  -     */
  -    public Object evaluateAtCompileTime() {
  -	return null;
  -    }
  -
  -    /**
        * Type check all the children of this node.
        */
       public Type typeCheck(SymbolTable stable) throws TypeCheckError {
  @@ -180,7 +171,15 @@
   	    return;		// nothing to do
   	}
   
  -	if ( (this instanceof VariableRefBase) == false ) {
  +	if (this instanceof VariableRefBase) {
  +	    // The method cloneIterator() also does resetting
  +	    final int clone =
  +		cpg.addInterfaceMethodref(NODE_ITERATOR,
  +					  "cloneIterator",
  +					  "()" + NODE_ITERATOR_SIG);
  +	    il.append(new INVOKEINTERFACE(clone, 1));
  +	}
  +	else {
   	    il.append(methodGen.loadContextNode());
   	    il.append(methodGen.setStartNode());
   	}
  @@ -204,14 +203,6 @@
   			     MethodGenerator methodGen) {
   	final InstructionList il = methodGen.getInstructionList();
   	_falseList.add(il.append(new IFEQ(null)));
  -    }
  -
  -    public FlowList getFalseList() {
  -	return _falseList;
  -    }
  -
  -    public FlowList getTrueList() {
  -	return _trueList;
       }
   
       public void backPatchFalseList(InstructionHandle ih) {
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Fallback.java
  
  Index: Fallback.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Fallback.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.6.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FilterExpr.java
  
  Index: FilterExpr.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FilterExpr.java,v
  retrieving revision 1.6
  retrieving revision 1.6.8.1
  diff -u -r1.6 -r1.6.8.1
  
  
  
  1.10.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FilterParentPath.java
  
  Index: FilterParentPath.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FilterParentPath.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FilteredAbsoluteLocationPath.java
  
  Index: FilteredAbsoluteLocationPath.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FilteredAbsoluteLocationPath.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FloorCall.java
  
  Index: FloorCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FloorCall.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.3.2.1   +1 -31     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FlowList.java
  
  Index: FlowList.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FlowList.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- FlowList.java	29 Jul 2002 21:30:51 -0000	1.3
  +++ FlowList.java	14 Aug 2002 19:21:32 -0000	1.3.2.1
  @@ -64,7 +64,6 @@
   package org.apache.xalan.xsltc.compiler;
   
   import java.util.Vector;
  -import java.util.Iterator;
   import org.apache.bcel.generic.*;
   
   public final class FlowList {
  @@ -119,34 +118,5 @@
   	    }
   	    _elements.clear();		// avoid backpatching more than once
   	}
  -    }
  -
  -    /**
  -     * Redirect the handles from oldList to newList. "This" flow list
  -     * is assumed to be relative to oldList.
  -     */
  -    public FlowList copyAndRedirect(InstructionList oldList, 
  -	InstructionList newList) 
  -    {
  -	final FlowList result = new FlowList();
  -	if (_elements == null) {
  -	    return result;
  -	}
  -
  -	final int n = _elements.size();
  -	final Iterator oldIter = oldList.iterator();
  -	final Iterator newIter = newList.iterator();
  -	
  -	while (oldIter.hasNext()) {
  -	    final InstructionHandle oldIh = (InstructionHandle) oldIter.next();
  -	    final InstructionHandle newIh = (InstructionHandle) newIter.next();
  -
  -	    for (int i = 0; i < n; i++) {
  -		if (_elements.elementAt(i) == oldIh) {
  -		    result.add(newIh);
  -		}
  -	    }
  -	}
  -	return result;
       }
   }
  
  
  
  1.12.8.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ForEach.java
  
  Index: ForEach.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ForEach.java,v
  retrieving revision 1.12
  retrieving revision 1.12.8.1
  diff -u -r1.12 -r1.12.8.1
  
  
  
  1.8.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FormatNumberCall.java
  
  Index: FormatNumberCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FormatNumberCall.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  
  
  
  1.11.2.1  +62 -67    xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java
  
  Index: FunctionAvailableCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- FunctionAvailableCall.java	12 Aug 2002 11:33:59 -0000	1.11
  +++ FunctionAvailableCall.java	14 Aug 2002 19:21:32 -0000	1.11.2.1
  @@ -73,34 +73,39 @@
   
   final class FunctionAvailableCall extends FunctionCall {
   
  -    private Expression _arg; 
  -    private String     _nameOfFunct = null; 
  -    private String     _namespaceOfFunct = null; 	
       private boolean    _isFunctionAvailable = false; 
  +    private Expression _arg; 
  +    private String     _namespaceOfFunct =null; 	
  +    private String     _nameOfFunct =null; 
  +
   
       /**
        * Constructs a FunctionAvailableCall FunctionCall. Takes the
  -     * function name qname, for example, 'function-available', and 
  -     * a list of arguments where the arguments must be instances of 
  -     * LiteralExpression. 
  +     * function name qname, for example, 'function-available', and a list
  +     * of arguments where the arguments must be instances of 
  +     * LiteralExpression. The test for availability considers
  +     * internal xsl functions such as 'floor' as well as external
  +     * Java functions, such as 'java.lang.Math.sin'.  The case of
  +     * external functions is handled here, the case of internal
  +     * functions is handled in getResult. 
        */
       public FunctionAvailableCall(QName fname, Vector arguments) {
   	super(fname, arguments);
   	_arg = (Expression)arguments.elementAt(0);
   	_type = null; 
  -
           if (_arg instanceof LiteralExpr) {
  -	    LiteralExpr arg = (LiteralExpr) _arg;
  +	    LiteralExpr arg = (LiteralExpr)_arg;
               _namespaceOfFunct = arg.getNamespace();
               _nameOfFunct = arg.getValue();
  -
  -            if (_namespaceOfFunct != null &&
  -	        (_namespaceOfFunct.startsWith(JAVA_EXT_XSLTC) ||
  -		 _namespaceOfFunct.startsWith(JAVA_EXT_XALAN))) 
  +            if ((_namespaceOfFunct != null) && 
  +                (!_namespaceOfFunct.equals(Constants.EMPTYSTRING)))
   	    {
  +		// the function is external, such as a java function
                   _isFunctionAvailable = hasMethods();
               }
  +	    // the case of internal function is handled in getResult.
           }
  +	// case where _arg is not instanceof LiteralExpr can not be handled.
       }
   
       /**
  @@ -108,11 +113,13 @@
        * returns the type of function-available to be boolean.  
        */
       public Type typeCheck(SymbolTable stable) throws TypeCheckError {
  -	if (_type != null) {
  +	// may be already set
  +	if ( _type != null ) {
   	   return _type;
   	}
   	if (_arg instanceof LiteralExpr) {
  -	    return _type = Type.Boolean;
  +	    _type = Type.Boolean;
  +	    return Type.Boolean;	
   	}
   	ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR,
   			"function-available", this);
  @@ -120,15 +127,6 @@
       }
   
       /**
  -     * Returns an object representing the compile-time evaluation 
  -     * of an expression. We are only using this for function-available
  -     * and element-available at this time.
  -     */
  -    public Object evaluateAtCompileTime() {
  -	return getResult() ? Boolean.TRUE : Boolean.FALSE;
  -    }
  -
  -    /**
        * (For ext. java functions only)
        * Parses the argument to function-available to extract the package 
        * qualified class name, for example, given the argument 
  @@ -188,68 +186,65 @@
        * the specified method is found in the specifed class. 
        */
       private boolean hasMethods() {
  +        
   	LiteralExpr arg = (LiteralExpr)_arg;
   	final String externalFunctName = getExternalFunctionName();
  -
   	if (externalFunctName == null) {
   	    return false;
   	}
  -
   	final String className = getClassName(externalFunctName);
   
  -	try {
  -	    TransletLoader loader = new TransletLoader();
  -	    final Class clazz = loader.loadClass(className);
  -
  -	    if (clazz == null) {
  -		final ErrorMsg msg =
  -		    new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, className);
  -		getParser().reportError(Constants.ERROR, msg);
  -	    }
  -	    else {
  -		final String methodName = getMethodName(externalFunctName);
  -		final Method[] methods = clazz.getDeclaredMethods();
  -
  -		for (int i = 0; i < methods.length; i++) {
  -		    final int mods = methods[i].getModifiers();
  -
  -		    if (Modifier.isPublic(mods)
  -			&& Modifier.isStatic(mods)
  -			&& methods[i].getName().equals(methodName))
  -		    {
  -			return true;
  -		    }
  -		}
  -	    }
  -	}
  -	catch (ClassNotFoundException e) {
  -	    final ErrorMsg msg =
  -		new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, className);
  -		    getParser().reportError(Constants.ERROR, msg);
  -	}
  +        if (_namespaceOfFunct.startsWith(JAVA_EXT_XSLTC) ||
  +            _namespaceOfFunct.startsWith(JAVA_EXT_XALAN)) {
  +            try {
  +                TransletLoader loader = new TransletLoader();
  +                final Class clazz = loader.loadClass(className);
  +
  +                if (clazz == null) {
  +                    final ErrorMsg msg =
  +                        new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, className);
  +                    getParser().reportError(Constants.ERROR, msg);
  +                }
  +                else {
  +                    final String methodName = getMethodName(externalFunctName);
  +                    final Method[] methods = clazz.getDeclaredMethods();
  +
  +                    for (int i = 0; i < methods.length; i++) {
  +                        final int mods = methods[i].getModifiers();
  +
  +                        if (Modifier.isPublic(mods)
  +                            && Modifier.isStatic(mods)
  +                            && methods[i].getName().equals(methodName))
  +                        {
  +			    return true;
  +                        }
  +                    }
  +                }
  +            }
  +            catch (ClassNotFoundException e) {
  +                final ErrorMsg msg =
  +                    new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, className);
  +                getParser().reportError(Constants.ERROR, msg);
  +            }
  +        }
           return false;   
       }
   
       /**
  -     * Reports on whether the function specified in the argument to
  +     * reports on whether the function specified in the argument to
        * xslt function 'function-available' was found.
        */
       public boolean getResult() {
  -	if (_nameOfFunct == null) { 
  -	    return false;
  -	}
  -
  -        if (_namespaceOfFunct == null ||
  -            _namespaceOfFunct.equals(EMPTYSTRING) ||
  -	    _namespaceOfFunct.equals(EXT_XALAN) ||
  -	    _namespaceOfFunct.equals(TRANSLET_URI))
  +        if ((_namespaceOfFunct == null) ||
  +           (_namespaceOfFunct.equals(Constants.EMPTYSTRING)))
           {
  +            // no namespace, so the function is an internal xslt function.
               final Parser parser = getParser();
  -            _isFunctionAvailable = 
  -		parser.functionSupported(Util.getLocalName(_nameOfFunct));
  +            _isFunctionAvailable = parser.functionSupported(_nameOfFunct);
           }
    	return _isFunctionAvailable;
       }
  +
   
       /**
        * Calls to 'function-available' are resolved at compile time since 
  
  
  
  1.22.2.1  +80 -322   xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FunctionCall.java
  
  Index: FunctionCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FunctionCall.java,v
  retrieving revision 1.22
  retrieving revision 1.22.2.1
  diff -u -r1.22 -r1.22.2.1
  --- FunctionCall.java	30 Jul 2002 22:07:52 -0000	1.22
  +++ FunctionCall.java	14 Aug 2002 19:21:32 -0000	1.22.2.1
  @@ -60,7 +60,6 @@
    * @author Santiago Pericas-Geertsen
    * @author Morten Jorgensen
    * @author Erwin Bolwidt <ej...@klomp.org>
  - * @author Todd Miller
    *
    */
   
  @@ -72,18 +71,8 @@
   
   import java.lang.reflect.*;
   
  -import org.apache.bcel.generic.NEW;
  -import org.apache.bcel.generic.IFEQ;
  -import org.apache.bcel.generic.PUSH;
  -import org.apache.bcel.generic.INVOKESTATIC;
  -import org.apache.bcel.generic.INVOKEVIRTUAL;
  -import org.apache.bcel.generic.INVOKESPECIAL;
  -import org.apache.bcel.generic.ConstantPoolGen;
  -import org.apache.bcel.generic.InstructionList;
  -import org.apache.bcel.generic.InstructionConstants;
  -import org.apache.bcel.generic.InvokeInstruction;
  -
   import org.apache.xalan.xsltc.compiler.util.Type;
  +import org.apache.bcel.generic.*;
   import org.apache.xalan.xsltc.compiler.util.*;
   import org.apache.xalan.xsltc.runtime.TransletLoader;
   
  @@ -109,23 +98,15 @@
       protected final static String JAVA_EXT_XALAN =
   	"http://xml.apache.org/xslt/java";
   
  -    /**
  -     * Stores reference to object for non-static Java calls
  -     */
  -    Expression _thisArgument = null;
   
       // External Java function's class/method/signature
  -    private String      _className;
  -    private Method      _chosenMethod;
  -    private Constructor _chosenConstructor;
  -    private MethodType  _chosenMethodType;
  +    private String     _className;
  +    private Method     _chosenMethod;
  +    private MethodType _chosenMethodType;
   
       // Encapsulates all unsupported external function calls
       private boolean    unresolvedExternal;
   
  -    // If FunctionCall is a external java constructor 
  -    private boolean     _isExtConstructor = false; 
  -
       // Legal conversions between internal and Java types.
       private static final MultiHashtable _internal2Java = new MultiHashtable();
   
  @@ -133,31 +114,12 @@
       private static final Hashtable _java2Internal = new Hashtable();
   
       /**
  -     * inner class to used in internal2Java mappings, contains
  -     * the Java type and the distance between the internal type and
  -     * the Java type. 
  -     */
  -    static class JavaType {
  -	public Class  type;
  -	public int distance;
  -	
  -	public JavaType(Class type, int distance){
  -	    this.type = type;
  -	    this.distance = distance;
  -	}
  -	public boolean equals(Object query){
  -	    return query.equals(type);
  -	}
  -    } 
  -
  -    /**
        * Defines 2 conversion tables:
        * 1. From internal types to Java types and
        * 2. From Java types to internal types.
        * These two tables are used when calling external (Java) functions.
        */
       static {
  -
   	try {
   	    final Class objectClass   = Class.forName("java.lang.Object");
   	    final Class stringClass   = Class.forName("java.lang.String");
  @@ -165,43 +127,42 @@
   	    final Class nodeListClass = Class.forName("org.w3c.dom.NodeList");
   
   	    // Possible conversions between internal and Java types
  -	    _internal2Java.put(Type.Boolean, new JavaType(Boolean.TYPE,0));
  +	    _internal2Java.put(Type.Boolean, Boolean.TYPE);
   
  -	    _internal2Java.put(Type.Int, new JavaType(Character.TYPE, 6)); 
  -	    _internal2Java.put(Type.Int, new JavaType(Byte.TYPE, 5));
  -	    _internal2Java.put(Type.Int, new JavaType(Short.TYPE, 4));
  -	    _internal2Java.put(Type.Int, new JavaType(Integer.TYPE, 0));
  -	    _internal2Java.put(Type.Int, new JavaType(Long.TYPE, 1));
  -	    _internal2Java.put(Type.Int, new JavaType(Float.TYPE, 2));
  -	    _internal2Java.put(Type.Int, new JavaType(Double.TYPE, 3));
  -
  -	    _internal2Java.put(Type.Real, new JavaType(Character.TYPE, 6)); 
  -	    _internal2Java.put(Type.Real, new JavaType(Byte.TYPE, 5));
  -	    _internal2Java.put(Type.Real, new JavaType(Short.TYPE, 4));
  -	    _internal2Java.put(Type.Real, new JavaType(Integer.TYPE, 3));
  -	    _internal2Java.put(Type.Real, new JavaType(Long.TYPE, 2));
  -	    _internal2Java.put(Type.Real, new JavaType(Float.TYPE, 1));
  -	    _internal2Java.put(Type.Real, new JavaType(Double.TYPE, 0));
  -
  -	    _internal2Java.put(Type.String, new JavaType(stringClass, 0)); 
  -
  -	    _internal2Java.put(Type.Node, new JavaType(nodeClass, 0));  
  -	    _internal2Java.put(Type.Node, new JavaType(nodeListClass, 1));
  -
  -	    _internal2Java.put(Type.NodeSet, new JavaType(Integer.TYPE, 10)); 
  -	    _internal2Java.put(Type.NodeSet, new JavaType(nodeClass, 1)); 
  -	    _internal2Java.put(Type.NodeSet, new JavaType(nodeListClass,0)); 
  -
  -	    _internal2Java.put(Type.ResultTree, new JavaType(nodeClass, 1)); 
  -	    _internal2Java.put(Type.ResultTree, new JavaType(nodeListClass,0));
  -	    _internal2Java.put(Type.ResultTree, new JavaType(objectClass,2));
  +	    _internal2Java.put(Type.Int, Character.TYPE);
  +	    _internal2Java.put(Type.Int, Byte.TYPE);
  +	    _internal2Java.put(Type.Int, Short.TYPE);
  +	    _internal2Java.put(Type.Int, Integer.TYPE);
  +	    _internal2Java.put(Type.Int, Long.TYPE);
  +	    _internal2Java.put(Type.Int, Float.TYPE);
  +	    _internal2Java.put(Type.Int, Double.TYPE);
  +
  +	    _internal2Java.put(Type.Real, Character.TYPE);
  +	    _internal2Java.put(Type.Real, Byte.TYPE);
  +	    _internal2Java.put(Type.Real, Short.TYPE);
  +	    _internal2Java.put(Type.Real, Integer.TYPE);
  +	    _internal2Java.put(Type.Real, Long.TYPE);
  +	    _internal2Java.put(Type.Real, Float.TYPE);
  +	    _internal2Java.put(Type.Real, Double.TYPE);
  +
  +	    _internal2Java.put(Type.String, stringClass);
  +
  +	    _internal2Java.put(Type.Node, nodeClass);
  +	    _internal2Java.put(Type.Node, nodeListClass);
  +
  +	    _internal2Java.put(Type.NodeSet, Integer.TYPE);
  +	    _internal2Java.put(Type.NodeSet, nodeClass);
  +	    _internal2Java.put(Type.NodeSet, nodeListClass);
   
  -	    _internal2Java.put(Type.Reference, new JavaType(objectClass,0));
  +	    _internal2Java.put(Type.ResultTree, nodeClass);
  +	    _internal2Java.put(Type.ResultTree, nodeListClass);
  +
  +	    _internal2Java.put(Type.Reference, objectClass);
   
   	    // Possible conversions between Java and internal types
  -	    _java2Internal.put(Boolean.TYPE, Type.Boolean); 
  +	    _java2Internal.put(Boolean.TYPE, Type.Boolean);
   
  -	    _java2Internal.put(Character.TYPE, Type.Real); 
  +	    _java2Internal.put(Character.TYPE, Type.Real);
   	    _java2Internal.put(Byte.TYPE, Type.Real);
   	    _java2Internal.put(Short.TYPE, Type.Real);
   	    _java2Internal.put(Integer.TYPE, Type.Real);
  @@ -214,8 +175,6 @@
   	    _java2Internal.put(objectClass, Type.Reference);
   
   	    // Conversions from org.w3c.dom.Node/NodeList are not supported
  -	    // GTM
  -	    _java2Internal.put(nodeListClass, Type.NodeSet);
   	}
   	catch (ClassNotFoundException e) {
   	    System.err.println(e);
  @@ -283,29 +242,36 @@
   	// Handle extension functions (they all have a namespace)
   	else {
   	    try {
  -		// GTM: namespace = http://xml.apache.org/xslt/java
   		_className = getClassNameFromUri(namespace);
   
   		final int pos = local.lastIndexOf('.');
   		if (pos > 0) {
   		    _className = _className + local.substring(0, pos);
  -		    _fname = new QName(namespace, null, 
  -			local.substring(pos + 1));
  +		    _fname = new QName(namespace, null, local.substring(pos + 1));
   		}
   		else {
   		    _fname = new QName(namespace, null, local);
   		}
  -		return typeCheckExternal(stable);
  -	    } 
  -	    catch (TypeCheckError e) {
  -		ErrorMsg errorMsg = e.getErrorMsg();
  -		if (errorMsg == null) {
  -		    final String name = _fname.getLocalPart();
  -		    errorMsg = new ErrorMsg(ErrorMsg.METHOD_NOT_FOUND_ERR, name);
  +		if (_className.length() > 0) {
  +		    return typeCheckExternal(stable);
   		}
  -		getParser().reportError(ERROR, errorMsg);
  -		return _type = Type.Void;
  +	    } catch (TypeCheckError e) {
  +		// Falls through
  +	    }
  +
  +	    /*
  +	     * Warn user if external function could not be resolved.
  +	     * Warning will _NOT_ be issued is the call is properly
  +	     * wrapped in an <xsl:if> or <xsl:when> element. For details
  +	     * see If.parserContents() and When.parserContents()
  +	     */
  +	    final Parser parser = getParser();
  +	    if (parser != null) {
  +		reportWarning(this, parser, ErrorMsg.FUNCTION_RESOLVE_ERR,
  +			      _fname.toString());
   	    }
  +	    unresolvedExternal = true;
  +	    return _type = Type.Void;
   	}
       }
   
  @@ -342,72 +308,6 @@
   	throw new TypeCheckError(this);
       }
   
  -   
  -
  -    public Type typeCheckConstructor(SymbolTable stable) throws TypeCheckError{
  -        final Vector constructors = findConstructors();
  -	if (constructors == null) {
  -            // Constructor not found in this class
  -            throw new TypeCheckError(ErrorMsg.CONSTRUCTOR_NOT_FOUND, 
  -		_className);
  -        
  -	}
  -
  -	final int nConstructors = constructors.size();
  -	final int nArgs = _arguments.size();
  -	final Vector argsType = typeCheckArgs(stable);
  -
  -	// Try all constructors 
  -	int bestConstrDistance = Integer.MAX_VALUE;
  -	_type = null;			// reset
  -	for (int j, i = 0; i < nConstructors; i++) {
  -	    // Check if all parameters to this constructor can be converted
  -	    final Constructor constructor = 
  -		(Constructor)constructors.elementAt(i);
  -	    final Class[] paramTypes = constructor.getParameterTypes();
  -
  -	    Class extType = null;
  -	    int currConstrDistance = 0;
  -	    for (j = 0; j < nArgs; j++) {
  -		// Convert from internal (translet) type to external (Java) type
  -		extType = paramTypes[j];
  -		final Type intType = (Type)argsType.elementAt(j);
  -		Object match = _internal2Java.maps(intType, extType);
  -		if (match != null) {
  -		    currConstrDistance += ((JavaType)match).distance;
  -		}
  -		else {
  -		    // no mapping available
  -		    currConstrDistance = Integer.MAX_VALUE;
  -		    break;
  -		} 
  -	    }
  -
  -	    if (j == nArgs && currConstrDistance < bestConstrDistance ) {
  -	        _chosenConstructor = constructor;
  -	        _isExtConstructor = true;
  -		bestConstrDistance = currConstrDistance;
  -		_type = new ObjectType(_className);
  -	    }
  -	}
  -
  -	if (_type != null) {
  -	    return _type;
  -	}
  -
  -	final StringBuffer buf = new StringBuffer(_className);
  -	buf.append('.').append(_fname.getLocalPart()).append('(');
  -	for (int i = 0; i < nArgs; i++) {
  -	    final Type intType = (Type)argsType.elementAt(i);
  -	    buf.append(intType.toString());
  -	    if (i < nArgs - 1) buf.append(", ");
  -	}
  -	buf.append(')');
  -	throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, 
  -	    buf.toString());
  -    }
  -
  -
       /**
        * Type check a call to an external (Java) method.
        * The method must be static an public, and a legal type conversion
  @@ -416,113 +316,58 @@
        * as a possible candidate.
        */
       public Type typeCheckExternal(SymbolTable stable) throws TypeCheckError {
  -	int nArgs = _arguments.size();
  -	final String name = _fname.getLocalPart();
  -
  -	// check if we are calling an instance method
  -	if (_className.length() == 0) {
  -	    if (nArgs > 0) {
  -		_thisArgument = (Expression) _arguments.elementAt(0);
  -		_arguments.remove(0); nArgs--;  
  -		Type type = _thisArgument.typeCheck(stable);	
  -		if (type instanceof ObjectType) {
  -		    _className = ((ObjectType) type).getJavaClassName();
  -		}
  -		else {
  -		    // TODO: define a new error message
  -                    throw new TypeCheckError(ErrorMsg.NO_JAVA_FUNCT_THIS_REF, 
  -			name);
  -		}
  -            }
  -            else {
  -		/*
  -		 * Warn user if external function could not be resolved.
  -		 * Warning will _NOT_ be issued is the call is properly
  -		 * wrapped in an <xsl:if> or <xsl:when> element. For details
  -		 * see If.parserContents() and When.parserContents()
  -		 */
  -		final Parser parser = getParser();
  -		if (parser != null) {
  -		    reportWarning(this, parser, ErrorMsg.FUNCTION_RESOLVE_ERR,
  -				  _fname.toString());
  -		}
  -		unresolvedExternal = true;
  -		return _type = Type.Int;	// use "Int" as "unknown"
  -            }	     
  -	}
  - 	// check if function is a contructor 'new'
  -	else if (_fname.getLocalPart().equals("new")) {
  -	    return typeCheckConstructor(stable);
  -	}
  -
   	final Vector methods = findMethods();
   	
   	if (methods == null) {
   	    // Method not found in this class
  +	    final String name = _fname.getLocalPart();
   	    throw new TypeCheckError(ErrorMsg.METHOD_NOT_FOUND_ERR, name);
   	}
   
  -	Class extType = null;
   	final int nMethods = methods.size();
  +	final int nArgs = _arguments.size();
   	final Vector argsType = typeCheckArgs(stable);
   
  -	// Try all methods to identify the best fit 
  -	int bestMethodDistance  = Integer.MAX_VALUE;
  -	_type = null;                       // reset internal type 
  +	// Try all methods with the same name as this function
   	for (int j, i = 0; i < nMethods; i++) {
   
   	    // Check if all paramteters to this method can be converted
   	    final Method method = (Method)methods.elementAt(i);
   	    final Class[] paramTypes = method.getParameterTypes();
  -	    
  -	    int currMethodDistance = 0;
   	    for (j = 0; j < nArgs; j++) {
   		// Convert from internal (translet) type to external (Java) type
  -		extType = paramTypes[j];
   		final Type intType = (Type)argsType.elementAt(j);
  -		Object match = _internal2Java.maps(intType, extType);
  -		if (match != null) {
  -		   currMethodDistance += 
  -			((JavaType)match).distance; 
  -		}
  -		else {
  -		    // no mapping available
  -		    currMethodDistance = Integer.MAX_VALUE;
  -		    break;
  -		}
  +		final Class extType = paramTypes[j];
  +		if (!_internal2Java.maps(intType, extType)) break;
   	    }
   
   	    if (j == nArgs) {
   		// Check if the return type can be converted
  -		extType = method.getReturnType();
  -		_type = extType.getName().equals("void") ? Type.Void
  -		    : (Type) _java2Internal.get(extType);
  -
  +		final Class extType = method.getReturnType();
  +		if (extType.getName().equals("void"))
  +		    _type = Type.Void;
  +		else
  +		    _type = (Type)_java2Internal.get(extType);
   		// Use this method if all parameters & return type match
  -		if (_type != null && currMethodDistance < bestMethodDistance) {
  +		if (_type != null) {
   		    _chosenMethod = method;
  -		    bestMethodDistance = currMethodDistance;
  +		    return _type;
   		}
   	    }
   	}
   
  -	if (_type != null) {
  -	    if (_type == Type.NodeSet){
  -                getXSLTC().setMultiDocument(true);
  -            }
  -	    return _type;
  -	}
  -
   	final StringBuffer buf = new StringBuffer(_className);
  -	buf.append('.').append(_fname.getLocalPart()).append('(');
  -	for (int i = 0; i < nArgs; i++) {
  -	    final Type intType = (Type)argsType.elementAt(i);
  +	buf.append('.');
  +	buf.append(_fname.getLocalPart());
  +	buf.append('(');
  +	for (int a=0; a<nArgs; a++) {
  +	    final Type intType = (Type)argsType.elementAt(a);
   	    buf.append(intType.toString());
  -	    if (i < nArgs - 1) buf.append(", ");
  +	    if (a < (nArgs-1)) buf.append(", ");
   	}
  -	buf.append(')');
  -	throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, 
  -	    buf.toString());
  +	buf.append(");");
  +	final String args = buf.toString();
  +	throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, args);
       }
   
       /**
  @@ -624,50 +469,11 @@
   	    il.append(new PUSH(cpg, _fname.toString()));
   	    il.append(new INVOKESTATIC(index));
   	}
  -	else if (_isExtConstructor) {
  -	    final String clazz = 
  -		_chosenConstructor.getDeclaringClass().getName();
  -	    Class[] paramTypes = _chosenConstructor.getParameterTypes();
  -	    
  -	    il.append(new NEW(cpg.addClass(_className)));
  -	    il.append(InstructionConstants.DUP);
  -
  -	    for (int i = 0; i < n; i++) {
  -		final Expression exp = argument(i);
  -		exp.translate(classGen, methodGen);
  -		// Convert the argument to its Java type
  -		exp.startResetIterator(classGen, methodGen);
  -		exp.getType().translateTo(classGen, methodGen, paramTypes[i]);
  -	    }
  -
  -	    final StringBuffer buffer = new StringBuffer();
  -	    buffer.append('(');
  -	    for (int i = 0; i < paramTypes.length; i++) {
  -		buffer.append(getSignature(paramTypes[i]));
  -	    }
  -	    buffer.append(')');
  -	    buffer.append("V");
  -
  -	    index = cpg.addMethodref(clazz,
  -				     "<init>", 
  -				     buffer.toString());
  -	    il.append(new INVOKESPECIAL(index));
  -
  -	    // Convert the return type back to our internal type
  -	    (Type.Object).translateFrom(classGen, methodGen, 
  -				_chosenConstructor.getDeclaringClass());
  -	    
  -	}
   	// Invoke function calls that are handled in separate classes
   	else {
   	    final String clazz = _chosenMethod.getDeclaringClass().getName();
   	    Class[] paramTypes = _chosenMethod.getParameterTypes();
   
  -	    // Push "this" if it is an instance method
  -	    if (_thisArgument != null) {
  -		_thisArgument.translate(classGen, methodGen);
  -	    }
  -
   	    for (int i = 0; i < n; i++) {
   		final Expression exp = argument(i);
   		exp.translate(classGen, methodGen);
  @@ -687,9 +493,7 @@
   	    index = cpg.addMethodref(clazz,
   				     _fname.getLocalPart(),
   				     buffer.toString());
  -	    il.append(_thisArgument != null ?
  -		(InvokeInstruction) new INVOKEVIRTUAL(index) : 
  -                (InvokeInstruction) new INVOKESTATIC(index));
  +	    il.append(new INVOKESTATIC(index));
   
   	    // Convert the return type back to our internal type
   	    _type.translateFrom(classGen, methodGen,
  @@ -739,8 +543,10 @@
   
   		    for (int i = 0; i < methods.length; i++) {
   			final int mods = methods[i].getModifiers();
  -			// Is it public and same number of args ?
  +
  +			// Is it public, static and same number of args ?
   			if (Modifier.isPublic(mods)
  +			    && Modifier.isStatic(mods)
   			    && methods[i].getName().equals(methodName)
   			    && methods[i].getParameterTypes().length == nArgs)
   			    {
  @@ -760,54 +566,6 @@
   	}
   	return result;
       }
  -
  -    /**
  -     * Returns a vector with all constructors named <code>_fname</code>
  -     * after stripping its namespace or <code>null</code>
  -     * if no such methods exist.
  -     */
  -    private Vector findConstructors() {
  -        Vector result = null;
  -        final String namespace = _fname.getNamespace();
  -
  -        if (namespace.startsWith(JAVA_EXT_XSLTC) ||
  -            namespace.startsWith(JAVA_EXT_XALAN)) {
  -            final int nArgs = _arguments.size();
  -            try {
  -                TransletLoader loader = new TransletLoader();
  -                final Class clazz = loader.loadClass(_className);
  -
  -                if (clazz == null) {
  -                    final ErrorMsg msg =
  -                        new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className);
  -                    getParser().reportError(Constants.ERROR, msg);
  -                }
  -                else {
  -                    final Constructor[] constructors = clazz.getConstructors();
  -
  -                    for (int i = 0; i < constructors.length; i++) {
  -                        final int mods = constructors[i].getModifiers();
  -                        // Is it public, static and same number of args ?
  -                        if (Modifier.isPublic(mods) &&
  -                           constructors[i].getParameterTypes().length == nArgs)
  -                        {
  -                            if (result == null) {
  -                                result = new Vector();
  -                            }
  -                            result.addElement(constructors[i]);
  -                        }
  -                    }
  -                }
  -            }
  -            catch (ClassNotFoundException e) {
  -                final ErrorMsg msg =
  -                    new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className);
  -                getParser().reportError(Constants.ERROR, msg);
  -            }
  -        }
  -        return result;
  -    }
  -
   
       /**
        * Compute the JVM signature for the class.
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/GenerateIdCall.java
  
  Index: GenerateIdCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/GenerateIdCall.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.6.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/IdKeyPattern.java
  
  Index: IdKeyPattern.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/IdKeyPattern.java,v
  retrieving revision 1.6
  retrieving revision 1.6.8.1
  diff -u -r1.6 -r1.6.8.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/IdPattern.java
  
  Index: IdPattern.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/IdPattern.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.10.2.1  +12 -6     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/If.java
  
  Index: If.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/If.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- If.java	26 Jun 2002 21:25:35 -0000	1.10
  +++ If.java	14 Aug 2002 19:21:32 -0000	1.10.2.1
  @@ -102,11 +102,17 @@
   	    return;
           }
   
  -	// Ignore xsl:if when test is false (function-available() and
  -	// element-available())
  -	Object result = _test.evaluateAtCompileTime();
  -	if (result != null && result instanceof Boolean) {
  -	    _ignore = !((Boolean) result).booleanValue();
  +	// We will ignore the contents of this <xsl:if> if we know that the
  +	// test will always return 'false'.
  +	if (_test instanceof ElementAvailableCall) {
  +	    ElementAvailableCall call = (ElementAvailableCall)_test;
  +	    _ignore = !call.getResult();
  +	    return;
  +	}
  +	if (_test instanceof FunctionAvailableCall) {
  +	    FunctionAvailableCall call = (FunctionAvailableCall)_test;
  +	    _ignore = !call.getResult();
  +	    return;
   	}
   
   	parseChildren(parser);
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/IllegalCharException.java
  
  Index: IllegalCharException.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/IllegalCharException.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.16.2.1  +10 -21    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.16
  retrieving revision 1.16.2.1
  diff -u -r1.16 -r1.16.2.1
  --- Import.java	20 Jul 2002 23:55:48 -0000	1.16
  +++ Import.java	14 Aug 2002 19:21:32 -0000	1.16.2.1
  @@ -84,12 +84,11 @@
       private Stylesheet _imported = null;
   
       public Stylesheet getImportedStylesheet() {
  -	return _imported;
  +	return(_imported);
       }
   
       public void parseContents(final Parser parser) {
   	final Stylesheet context = parser.getCurrentStylesheet();
  -
   	try {
   	    String docToLoad = getAttribute("href");
   	    if (context.checkForLoop(docToLoad)) {
  @@ -115,18 +114,10 @@
   		input = new InputSource(docToLoad);
   	    }
   
  -	    // Return if we could not resolve the URL
  -	    if (input == null) {
  -		final ErrorMsg msg = 
  -		    new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, docToLoad, this);
  -		parser.reportError(Constants.FATAL, msg);
  -		return;
  -	    }
  -
   	    SyntaxTreeNode root = parser.parse(input);
   
   	    if (root == null) return;
  -	    _imported = parser.makeStylesheet(root);
  +	    final Stylesheet _imported = parser.makeStylesheet(root);
   	    if (_imported == null) return;
   
   	    _imported.setSourceLoader(loader);
  @@ -147,16 +138,14 @@
   	    while (elements.hasMoreElements()) {
   		final Object element = elements.nextElement();
   		if (element instanceof TopLevelElement) {
  -		    if (element instanceof Variable) {
  -			topStylesheet.addVariable((Variable) element);
  -		    }
  -		    else if (element instanceof Param) {
  -			topStylesheet.addParam((Param) element);
  -		    }
  -		    else {
  -			topStylesheet.addElement((TopLevelElement) element);
  -		    }
  +		    if (element instanceof Variable)
  +			topStylesheet.addVariable((Variable)element);
  +		    else if (element instanceof Param)
  +			topStylesheet.addParam((Param)element);
  +		    else
  +			topStylesheet.addElement((TopLevelElement)element);
   		}
  +		
   	    }
   	}
   	catch (Exception e) {
  
  
  
  1.19.2.1  +10 -21    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.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- Include.java	20 Jul 2002 23:55:48 -0000	1.19
  +++ Include.java	14 Aug 2002 19:21:32 -0000	1.19.2.1
  @@ -84,12 +84,11 @@
       private Stylesheet _included = null;
   
       public Stylesheet getIncludedStylesheet() {
  -	return _included;
  +	return(_included);
       }
   
       public void parseContents(final Parser parser) {
   	final Stylesheet context = parser.getCurrentStylesheet();
  -
   	String docToLoad = getAttribute("href");
   	try {
   	    if (context.checkForLoop(docToLoad)) {
  @@ -132,17 +131,9 @@
   		}
   	    }
   
  -	    // Return if we could not resolve the URL
  -	    if (input == null) {
  -		final ErrorMsg msg = 
  -		    new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, docToLoad, this);
  -		parser.reportError(Constants.FATAL, msg);
  -		return;
  -	    }
  -
   	    final SyntaxTreeNode root = parser.parse(input);
   	    if (root == null) return;
  -	    _included = parser.makeStylesheet(root);
  +	    final Stylesheet _included = parser.makeStylesheet(root);
   	    if (_included == null) return;
   
   	    _included.setSourceLoader(loader);
  @@ -155,6 +146,7 @@
   	    // as the stylesheet that included it.
   	    final int precedence = context.getImportPrecedence();
   	    _included.setImportPrecedence(precedence);
  +
   	    parser.setCurrentStylesheet(_included);
   	    _included.parseContents(parser);
   
  @@ -163,15 +155,12 @@
   	    while (elements.hasMoreElements()) {
   		final Object element = elements.nextElement();
   		if (element instanceof TopLevelElement) {
  -		    if (element instanceof Variable) {
  -			topStylesheet.addVariable((Variable) element);
  -		    }
  -		    else if (element instanceof Param) {
  -			topStylesheet.addParam((Param) element);
  -		    }
  -		    else {
  -			topStylesheet.addElement((TopLevelElement) element);
  -		    }
  +		    if (element instanceof Variable)
  +			topStylesheet.addVariable((Variable)element);
  +		    else if (element instanceof Param)
  +			topStylesheet.addParam((Param)element);
  +		    else
  +			topStylesheet.addElement((TopLevelElement)element);
   		}
   	    }
   	}
  
  
  
  1.2.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Instruction.java
  
  Index: Instruction.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Instruction.java,v
  retrieving revision 1.2
  retrieving revision 1.2.12.1
  diff -u -r1.2 -r1.2.12.1
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/IntExpr.java
  
  Index: IntExpr.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/IntExpr.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.11.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Key.java
  
  Index: Key.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Key.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  
  
  
  1.8.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/KeyCall.java
  
  Index: KeyCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/KeyCall.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/KeyPattern.java
  
  Index: KeyPattern.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/KeyPattern.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LangCall.java
  
  Index: LangCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LangCall.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.7.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LastCall.java
  
  Index: LastCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LastCall.java,v
  retrieving revision 1.7
  retrieving revision 1.7.8.1
  diff -u -r1.7 -r1.7.8.1
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LiteralAttribute.java
  
  Index: LiteralAttribute.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LiteralAttribute.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.18.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LiteralElement.java
  
  Index: LiteralElement.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LiteralElement.java,v
  retrieving revision 1.18
  retrieving revision 1.18.2.1
  diff -u -r1.18 -r1.18.2.1
  
  
  
  1.5.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LiteralExpr.java
  
  Index: LiteralExpr.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LiteralExpr.java,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LocalNameCall.java
  
  Index: LocalNameCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LocalNameCall.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.2.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LocationPathPattern.java
  
  Index: LocationPathPattern.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LocationPathPattern.java,v
  retrieving revision 1.2
  retrieving revision 1.2.16.1
  diff -u -r1.2 -r1.2.16.1
  
  
  
  1.10.2.1  +4 -26     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LogicalExpr.java
  
  Index: LogicalExpr.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LogicalExpr.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- LogicalExpr.java	26 Jun 2002 21:25:35 -0000	1.10
  +++ LogicalExpr.java	14 Aug 2002 19:21:33 -0000	1.10.2.1
  @@ -96,31 +96,9 @@
        * needed for context changes in node steps containing multiple predicates.
        */
       public boolean hasPositionCall() {
  -	return (_left.hasPositionCall() || _right.hasPositionCall());
  -    }
  -
  -    /**
  -     * Returns an object representing the compile-time evaluation 
  -     * of an expression. We are only using this for function-available
  -     * and element-available at this time.
  -     */
  -    public Object evaluateAtCompileTime() {
  -	final Object leftb = _left.evaluateAtCompileTime();
  -	final Object rightb = _right.evaluateAtCompileTime();
  -
  -	// Return null if we can't evaluate at compile time
  -	if (leftb == null || rightb == null) {
  -	    return null;
  -	}
  -
  -	if (_op == AND) {
  -	    return (leftb == Boolean.TRUE && rightb == Boolean.TRUE) ?
  -		Boolean.TRUE : Boolean.FALSE;
  -	}
  -	else {
  -	    return (leftb == Boolean.TRUE || rightb == Boolean.TRUE) ?
  -		Boolean.TRUE : Boolean.FALSE;
  -	}
  +	if (_left.hasPositionCall()) return true;
  +	if (_right.hasPositionCall()) return true;
  +	return false;
       }
   
       /**
  
  
  
  1.6.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Message.java
  
  Index: Message.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Message.java,v
  retrieving revision 1.6
  retrieving revision 1.6.8.1
  diff -u -r1.6 -r1.6.8.1
  
  
  
  1.24.2.1  +80 -181   xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Mode.java
  
  Index: Mode.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Mode.java,v
  retrieving revision 1.24
  retrieving revision 1.24.2.1
  diff -u -r1.24 -r1.24.2.1
  --- Mode.java	30 Jul 2002 12:46:14 -0000	1.24
  +++ Mode.java	14 Aug 2002 19:21:33 -0000	1.24.2.1
  @@ -77,9 +77,8 @@
   import org.apache.xalan.xsltc.DOM;
   
   /**
  - * Mode gathers all the templates belonging to a given mode; 
  - * it is responsible for generating an appropriate 
  - * applyTemplates + (mode name) method in the translet.
  + * Mode gathers all the templates belonging to a given mode; it is responsible
  + * for generating an appropriate applyTemplates + (mode name) function
    */
   final class Mode implements Constants {
   
  @@ -121,67 +120,32 @@
       /**
        * Test sequence for patterns with id() or key()-type kernel.
        */
  -    private TestSeq _idxTestSeq = null;
  +    private TestSeq  _idxTestSeq = null;
   
       /**
        * Group for patterns with any other kernel type.
        */
  -    private Vector[] _patternGroups;
  +    private Vector[]  _patternGroups;
   
       /**
        * Test sequence for patterns with any other kernel type.
        */
       private TestSeq[] _testSeq;
   
  -    /**
  -     * A mapping between patterns and instruction lists used by 
  -     * test sequences to avoid compiling the same pattern multiple 
  -     * times. Note that patterns whose kernels are "*", "node()" 
  -     * and "@*" can between shared by test sequences.
  -     */
  -    private Hashtable _preCompiled = new Hashtable();
  -
  -    /**
  -     * A mapping between templates and test sequences.
  -     */
       private Hashtable _neededTemplates = new Hashtable();
  -
  -    /**
  -     * A mapping between named templates and Mode objects.
  -     */
       private Hashtable _namedTemplates = new Hashtable();
  -
  -    /**
  -     * A mapping between templates and instruction handles.
  -     */
       private Hashtable _templateIHs = new Hashtable();
  -
  -    /**
  -     * A mapping between templates and instruction lists.
  -     */
       private Hashtable _templateILs = new Hashtable();
  -
  -    /**
  -     * A reference to the pattern matching the root node.
  -     */
       private LocationPathPattern _rootPattern = null;
   
  -    /**
  -     * Stores ranges of template precendences for the compilation 
  -     * of apply-imports (a Hashtable for historical reasons).
  -     */
       private Hashtable _importLevels = null;
   
  -    /**
  -     * A mapping between key names and keys.
  -     */
       private Hashtable _keys = null;
   
  -    /**
  -     * Variable index for the current node used in code generation.
  -     */
  +    // Variable index for the current node - used in code generation
       private int _currentIndex;
   
  +
       /**
        * Creates a new Mode.
        *
  @@ -191,18 +155,19 @@
        *               (normally a sequence number - still in a String).
        */
       public Mode(QName name, Stylesheet stylesheet, String suffix) {
  +	// Save global info
   	_name = name;
   	_stylesheet = stylesheet;
   	_methodName = APPLY_TEMPLATES + suffix;
  +	// Initialise some data structures
   	_templates = new Vector();
   	_patternGroups = new Vector[32];
       }
   
       /**
  -     * Returns the name of the method (_not_ function) that will be 
  -     * compiled for this mode. Normally takes the form 'applyTemplates()' 
  -     * or * 'applyTemplates2()'.
  -     *
  +     * Returns the name of the method (_not_ function) that will be compiled
  +     * for this mode. Normally takes the form 'applyTemplates()' or
  +     * 'applyTemplates2()'.
        * @return Method name for this mode
        */
       public String functionName() {
  @@ -210,28 +175,9 @@
       }
   
       public String functionName(int min, int max) {
  -	if (_importLevels == null) {
  -	    _importLevels = new Hashtable();
  -	}
  +	if (_importLevels == null) _importLevels = new Hashtable();
   	_importLevels.put(new Integer(max), new Integer(min));
  -	return _methodName + '_' + max;
  -    }
  -
  -    /**
  -     * Add a pre-compiled pattern to this mode. 
  -     */
  -    public void addInstructionList(Pattern pattern, 
  -	InstructionList ilist) 
  -    {
  -	_preCompiled.put(pattern, ilist);
  -    }
  -
  -    /**
  -     * Get the instruction list for a pre-compiled pattern. Used by 
  -     * test sequences to avoid compiling patterns more than once.
  -     */
  -    public InstructionList getInstructionList(Pattern pattern) {
  -	return (InstructionList) _preCompiled.get(pattern);
  +	return _methodName+'_'+max;
       }
   
       /**
  @@ -241,10 +187,10 @@
   	return _stylesheet.getClassName();
       }
   
  -    public Stylesheet getStylesheet() {
  -	return _stylesheet;
  -    }
  -
  +    /**
  +     * Add a template to this mode
  +     * @param template The template to add
  +     */
       public void addTemplate(Template template) {
   	_templates.addElement(template);
       }
  @@ -358,32 +304,10 @@
       }
   
       /**
  -     * Group patterns by NodeTests of their last Step
  -     * Keep them sorted by priority within group
  -     */
  -    private void addPatternToGroup(final LocationPathPattern lpp) {
  -	// id() and key()-type patterns do not have a kernel type
  -	if (lpp instanceof IdKeyPattern) {
  -	    addPattern(-1, lpp);
  -	}
  -	// Otherwise get the kernel pattern from the LPP
  -	else {
  -	    // kernel pattern is the last (maybe only) Step
  -	    final StepPattern kernel = lpp.getKernelPattern();
  -	    if (kernel != null) {
  -		addPattern(kernel.getNodeType(), lpp);
  -	    }
  -	    else if (_rootPattern == null ||
  -		     lpp.noSmallerThan(_rootPattern)) {
  -		_rootPattern = lpp;
  -	    }
  -	}
  -    }
  -
  -    /**
        * Adds a pattern to a pattern group
        */
       private void addPattern(int kernelType, LocationPathPattern pattern) {
  +
   	// Make sure the array of pattern groups is long enough
   	final int oldLength = _patternGroups.length;
   	if (kernelType >= oldLength) {
  @@ -402,13 +326,10 @@
   	if (patterns == null) {
   	    patterns = new Vector(2);
   	    patterns.addElement(pattern);
  -
  -	    if (kernelType == -1) {
  +	    if (kernelType == -1)
   		_nodeGroup = patterns;
  -	    }
  -	    else {
  +	    else
   		_patternGroups[kernelType] = patterns;
  -	    }
   	}
   	// Otherwise make sure patterns are ordered by precedence/priorities
   	else {
  @@ -429,58 +350,40 @@
       }
       
       /**
  -     * Build test sequences. The first step is to complete the test sequences 
  -     * by including patterns of "*" and "node()" kernel to all element test 
  -     * sequences, and of "@*" to all attribute test sequences.
  +     * Group patterns by NodeTests of their last Step
  +     * Keep them sorted by priority within group
        */
  -    private void prepareTestSequences() {
  -	final Vector names = _stylesheet.getXSLTC().getNamesIndex();
  -
  -	final Vector starGroup = _patternGroups[DOM.ELEMENT];
  -	final Vector atStarGroup = _patternGroups[DOM.ATTRIBUTE];
  -
  -	// Complete test sequences with "*", "@*" and "node()"
  -	if (starGroup != null || atStarGroup != null || _nodeGroup != null) {
  -	    final int n = _patternGroups.length;
  -
  -	    for (int m, i = DOM.NTYPES; i < n; i++) {
  -		if (_patternGroups[i] == null) continue;
  -
  -		final String name = (String) names.elementAt(i - DOM.NTYPES);
  -
  -		if (isAttributeName(name)) {
  -		    // If an attribute then copy "@*" to its test sequence
  -		    m = (atStarGroup != null) ? atStarGroup.size() : 0;
  -		    for (int j = 0; j < m; j++) {
  -			addPattern(i, 
  -			    (LocationPathPattern) atStarGroup.elementAt(j));
  -		    }
  -		}
  -		else {
  -		    // If an element then copy "*" to its test sequence
  -		    m = (starGroup != null) ? starGroup.size() : 0;
  -		    for (int j = 0; j < m; j++) {
  -			addPattern(i, 
  -			    (LocationPathPattern) starGroup.elementAt(j));
  -		    }
  -
  -		    // And also copy "node()" to its test sequence
  -		    m = (_nodeGroup != null) ? _nodeGroup.size() : 0;
  -		    for (int j = 0; j < m; j++) {
  -			addPattern(i, 
  -			    (LocationPathPattern) _nodeGroup.elementAt(j));
  -		    }
  -		}
  +    private void addPatternToGroup(final LocationPathPattern lpp) {
  +	// id() and key()-type patterns do not have a kernel type
  +	if (lpp instanceof IdKeyPattern) {
  +	    addPattern(-1, lpp);
  +	}
  +	// Otherwise get the kernel pattern from the LPP
  +	else {
  +	    // kernel pattern is the last (maybe only) Step
  +	    final StepPattern kernel = lpp.getKernelPattern();
  +	    if (kernel != null) {
  +		addPattern(kernel.getNodeType(), lpp);
  +	    }
  +	    else if (_rootPattern == null ||
  +		     lpp.noSmallerThan(_rootPattern)) {
  +		_rootPattern = lpp;
   	    }
   	}
  +    }
   
  +    /**
  +     * Build test sequences
  +     */
  +    private void prepareTestSequences() {
  +	final Vector names = _stylesheet.getXSLTC().getNamesIndex();
   	_testSeq = new TestSeq[DOM.NTYPES + names.size()];
   	
   	final int n = _patternGroups.length;
   	for (int i = 0; i < n; i++) {
   	    final Vector patterns = _patternGroups[i];
   	    if (patterns != null) {
  -		final TestSeq testSeq = new TestSeq(patterns, i, this);
  +		final TestSeq testSeq = new TestSeq(patterns, this);
   		testSeq.reduce();
   		_testSeq[i] = testSeq;
   		testSeq.findTemplates(_neededTemplates);
  @@ -488,7 +391,7 @@
   	}
   
   	if ((_nodeGroup != null) && (_nodeGroup.size() > 0)) {
  -	    _nodeTestSeq = new TestSeq(_nodeGroup, -1, this);
  +	    _nodeTestSeq = new TestSeq(_nodeGroup, this);
   	    _nodeTestSeq.reduce();
   	    _nodeTestSeq.findTemplates(_neededTemplates);
   	}
  @@ -716,7 +619,20 @@
   	}
       }
   
  -   /**
  +    /**
  +     * Auxiliary method to determine if a qname describes an attribute/element
  +     */
  +    private static boolean isAttributeName(String qname) {
  +	final int col = qname.lastIndexOf(':') + 1;
  +	return (qname.charAt(col) == '@');
  +    }
  +
  +    private static boolean isNamespaceName(String qname) {
  +	final int col = qname.lastIndexOf(':');
  +	return (col > -1 && qname.charAt(qname.length()-1) == '*');
  +    }
  +
  +    /**
        * Compiles the applyTemplates() method and adds it to the translet.
        * This is the main dispatch method.
        */
  @@ -826,6 +742,7 @@
   	// If there is a match on node() we need to replace ihElem
   	// and ihText if the priority of node() is higher
   	if (_nodeTestSeq != null) {
  +
   	    // Compare priorities of node() and "*"
   	    double nodePrio = _nodeTestSeq.getPriority();
   	    int    nodePos  = _nodeTestSeq.getPosition();
  @@ -898,7 +815,6 @@
   	    }
   	}
   
  -
   	// Handle pattern with match on root node - default: traverse children
   	targets[DOM.ROOT] = _rootPattern != null
   	    ? getTemplateInstructionHandle(_rootPattern.getTemplate())
  @@ -1080,7 +996,20 @@
   				classGen.getConstantPool());
   	methodGen.addException("org.apache.xalan.xsltc.TransletException");
   
  -	// Create the local variable to hold the current node
  +	// No templates? Then just stuff in a single 'return' instruction
  +	if (_neededTemplates.size() == 0) {
  +	    mainIL.append(new RETURN());
  +	    methodGen.stripAttributes(true);
  +	    methodGen.setMaxLocals();
  +	    methodGen.setMaxStack();
  +	    methodGen.removeNOPs();
  +	    classGen.addMethod(methodGen.getMethod());
  +	    // Restore original/complete set of templates for the transformation
  +	    _templates = oldTemplates;
  +	    return;
  +	}
  +
  +	// Create the local variablea
   	final LocalVariableGen current;
   	current = methodGen.addLocalVariable2("current",
   					      org.apache.bcel.generic.Type.INT,
  @@ -1107,16 +1036,6 @@
   	ifeq.setTarget(ilLoop.append(RETURN)); // applyTemplates() ends here!
   	final InstructionHandle ihLoop = ilLoop.getStart();
   
  -	// Compile default handling of elements (traverse children)
  -	InstructionList ilRecurse =
  -	    compileDefaultRecursion(classGen, methodGen, ihLoop);
  -	InstructionHandle ihRecurse = ilRecurse.getStart();
  -
  -	// Compile default handling of text/attribute nodes (output text)
  -	InstructionList ilText =
  -	    compileDefaultText(classGen, methodGen, ihLoop);
  -	InstructionHandle ihText = ilText.getStart();
  -
   	// Distinguish attribute/element/namespace tests for further processing
   	final int[] types = new int[DOM.NTYPES + names.size()];
   	for (int i = 0; i < types.length; i++) {
  @@ -1136,7 +1055,7 @@
   
   	// Handle template with explicit "*" pattern
   	final TestSeq elemTest = _testSeq[DOM.ELEMENT];
  -	InstructionHandle ihElem = ihRecurse;
  +	InstructionHandle ihElem = ihLoop;
   	if (elemTest != null) {
   	    ihElem = elemTest.compile(classGen, methodGen, ihLoop);
   	}
  @@ -1160,7 +1079,9 @@
   
   	// If there is a match on node() we need to replace ihElem
   	// and ihText if the priority of node() is higher
  +	InstructionHandle ihText = ihLoop;
   	if (_nodeTestSeq != null) {
  +
   	    // Compare priorities of node() and "*"
   	    double nodePrio = _nodeTestSeq.getPriority();
   	    int    nodePos  = _nodeTestSeq.getPosition();
  @@ -1235,10 +1156,10 @@
   	    }
   	}
   
  -	// Handle pattern with match on root node - default: traverse children
  +	// Handle pattern with match on root node - default: loop
   	targets[DOM.ROOT] = _rootPattern != null
   	    ? getTemplateInstructionHandle(_rootPattern.getTemplate())
  -	    : ihRecurse;
  +	    : ihLoop;
   	
   	// Handle any pattern with match on text nodes - default: loop
   	targets[DOM.TEXT] = _testSeq[DOM.TEXT] != null
  @@ -1316,11 +1237,6 @@
   	// Append NS:@* node tests (if any)
   	if (nsAttr != null) body.append(nsAttr);
   
  -	// Append default action for element and root nodes
  -	body.append(ilRecurse);
  -	// Append default action for text and attribute nodes
  -	body.append(ilText);
  -
   	// putting together constituent instruction lists
   	mainIL.append(new GOTO_W(ihLoop));
   	mainIL.append(body);
  @@ -1404,22 +1320,5 @@
   
       public InstructionHandle getTemplateInstructionHandle(Template template) {
   	return (InstructionHandle)_templateIHs.get(template);
  -    }
  -
  -    /**
  -     * Auxiliary method to determine if a qname is an attribute.
  -     */
  -    private static boolean isAttributeName(String qname) {
  -	final int col = qname.lastIndexOf(':') + 1;
  -	return (qname.charAt(col) == '@');
  -    }
  -
  -    /**
  -     * Auxiliary method to determine if a qname is a namespace 
  -     * qualified "*".
  -     */
  -    private static boolean isNamespaceName(String qname) {
  -	final int col = qname.lastIndexOf(':');
  -	return (col > -1 && qname.charAt(qname.length()-1) == '*');
       }
   }
  
  
  
  1.7.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NameBase.java
  
  Index: NameBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NameBase.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NameCall.java
  
  Index: NameCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NameCall.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NamespaceAlias.java
  
  Index: NamespaceAlias.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NamespaceAlias.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NamespaceUriCall.java
  
  Index: NamespaceUriCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NamespaceUriCall.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NodeTest.java
  
  Index: NodeTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NodeTest.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NotCall.java
  
  Index: NotCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NotCall.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.9.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Number.java
  
  Index: Number.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Number.java,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NumberCall.java
  
  Index: NumberCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/NumberCall.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.3.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Otherwise.java
  
  Index: Otherwise.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Otherwise.java,v
  retrieving revision 1.3
  retrieving revision 1.3.12.1
  diff -u -r1.3 -r1.3.12.1
  
  
  
  1.16.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Output.java
  
  Index: Output.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Output.java,v
  retrieving revision 1.16
  retrieving revision 1.16.2.1
  diff -u -r1.16 -r1.16.2.1
  
  
  
  1.19.8.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Param.java
  
  Index: Param.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Param.java,v
  retrieving revision 1.19
  retrieving revision 1.19.8.1
  diff -u -r1.19 -r1.19.8.1
  
  
  
  1.11.2.1  +5 -7      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ParameterRef.java
  
  Index: ParameterRef.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ParameterRef.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- ParameterRef.java	13 Aug 2002 19:12:32 -0000	1.11
  +++ ParameterRef.java	14 Aug 2002 19:21:33 -0000	1.11.2.1
  @@ -112,12 +112,10 @@
   	}
   
   	if (_variable.getType() instanceof NodeSetType) {
  -	    // The method cloneIterator() also does resetting
  -            final int clone = cpg.addInterfaceMethodref(NODE_ITERATOR,
  -                                                       "cloneIterator",
  -                                                       "()" +
  -                                                        NODE_ITERATOR_SIG);
  -            il.append(new INVOKEINTERFACE(clone, 1));
  +	    final int reset = cpg.addInterfaceMethodref(NODE_ITERATOR,
  +							"reset",
  +							"()"+NODE_ITERATOR_SIG);
  +	    il.append(new INVOKEINTERFACE(reset,1));	    
   	}
   
       }
  
  
  
  1.19.2.1  +2 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ParentLocationPath.java
  
  Index: ParentLocationPath.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ParentLocationPath.java,v
  retrieving revision 1.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- ParentLocationPath.java	25 Jun 2002 20:22:27 -0000	1.19
  +++ ParentLocationPath.java	14 Aug 2002 19:21:33 -0000	1.19.2.1
  @@ -221,6 +221,7 @@
   	    final int path = ((Step)_path).getAxis();
   	    final int step = ((Step)stp).getAxis();
   	    if ((path == Axis.DESCENDANTORSELF && step == Axis.CHILD) ||
  +		(path == Axis.DESCENDANTORSELF && step == Axis.ATTRIBUTE) ||
   		(path == Axis.PRECEDING        && step == Axis.PARENT)) {
   		final int incl = cpg.addMethodref(NODE_ITERATOR_BASE,
   						  "includeSelf",
  
  
  
  1.5.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ParentPattern.java
  
  Index: ParentPattern.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ParentPattern.java,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  
  
  
  1.51.2.1  +6 -7      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
  retrieving revision 1.51
  retrieving revision 1.51.2.1
  diff -u -r1.51 -r1.51.2.1
  --- Parser.java	25 Jul 2002 11:44:19 -0000	1.51
  +++ Parser.java	14 Aug 2002 19:21:33 -0000	1.51.2.1
  @@ -740,6 +740,7 @@
   	MethodType R_D  = new MethodType(Type.Real, Type.NodeSet);
   	MethodType R_O  = new MethodType(Type.Real, Type.Reference);
   	MethodType I_I  = new MethodType(Type.Int, Type.Int);
  +	MethodType J_J  = new MethodType(Type.Lng, Type.Lng);  //GTM,bug 3592
    	MethodType D_O  = new MethodType(Type.NodeSet, Type.Reference);
   	MethodType D_V  = new MethodType(Type.NodeSet, Type.Void);
   	MethodType D_S  = new MethodType(Type.NodeSet, Type.String);
  @@ -754,7 +755,7 @@
   	MethodType B_V  = new MethodType(Type.Boolean, Type.Void);
   	MethodType B_B  = new MethodType(Type.Boolean, Type.Boolean);
   	MethodType B_S  = new MethodType(Type.Boolean, Type.String);
  -	MethodType D_X  = new MethodType(Type.NodeSet, Type.Object);
  +	MethodType D_T  = new MethodType(Type.NodeSet, Type.ResultTree);
   	MethodType R_RR = new MethodType(Type.Real, Type.Real, Type.Real);
   	MethodType I_II = new MethodType(Type.Int, Type.Int, Type.Int);
   	MethodType B_RR = new MethodType(Type.Boolean, Type.Real, Type.Real);
  @@ -840,7 +841,7 @@
   	_symbolTable.addPrimop("system-property", S_S);
   
   	// Extensions
  -	_symbolTable.addPrimop("nodeset", D_X);
  +	_symbolTable.addPrimop("nodeset", D_T);
   
   	// Operators +, -, *, /, % defined on real types.
   	_symbolTable.addPrimop("+", R_RR);	
  @@ -880,6 +881,7 @@
   	// Unary minus.
   	_symbolTable.addPrimop("u-", R_R);	
   	_symbolTable.addPrimop("u-", I_I);	
  +	_symbolTable.addPrimop("u-", J_J);  // GTM,bug 3592	
       }
   
       public SymbolTable getSymbolTable() {
  @@ -1008,10 +1010,7 @@
   	            versionIsOne = attrs.getValue(i).equals("1.0");
   	        }
   
  -		// Ignore if special or if it has a prefix
  -	        if (attrQName.startsWith("xml") ||
  -		    attrQName.indexOf(':') > 0) continue;
  -
  +	        if (attrQName.startsWith("xml")) continue;
   	        for (j = 0; j < legal.length; j++) {
   	            if (attrQName.equalsIgnoreCase(legal[j])) {
   		        break;
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Pattern.java
  
  Index: Pattern.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Pattern.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.8.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/PositionCall.java
  
  Index: PositionCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/PositionCall.java,v
  retrieving revision 1.8
  retrieving revision 1.8.8.1
  diff -u -r1.8 -r1.8.8.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/PositionCall.java.inuse
  
  Index: PositionCall.java.inuse
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/PositionCall.java.inuse,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.24.2.1  +4 -4      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Predicate.java
  
  Index: Predicate.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Predicate.java,v
  retrieving revision 1.24
  retrieving revision 1.24.2.1
  diff -u -r1.24 -r1.24.2.1
  --- Predicate.java	18 Jul 2002 17:31:02 -0000	1.24
  +++ Predicate.java	14 Aug 2002 19:21:33 -0000	1.24.2.1
  @@ -189,7 +189,7 @@
   		(parent instanceof Pattern) ||
   		(parent instanceof FilterExpr)) {
   
  -		final QName position = getParser().getQNameIgnoreDefaultNs("position");
  +		final QName position = getParser().getQName("position");
   		final PositionCall positionCall = new PositionCall(position);
   		positionCall.setParser(getParser());
   		positionCall.setParent(this);
  @@ -208,8 +208,8 @@
   
   		    if (fexp instanceof KeyCall)
   			_canOptimize = false;
  -		    else if (fexp instanceof VariableRefBase)
  -		        _canOptimize = false;
  +		    //else if (fexp instanceof VariableRefBase)
  +		    //    _canOptimize = false;
   		    else if (fexp instanceof ParentLocationPath)
   			_canOptimize = false;
   		    else if (fexp instanceof UnionPathExpr)
  
  
  
  1.7.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ProcessingInstruction.java
  
  Index: ProcessingInstruction.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ProcessingInstruction.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ProcessingInstructionPattern.java
  
  Index: ProcessingInstructionPattern.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ProcessingInstructionPattern.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.4.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/QName.java
  
  Index: QName.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/QName.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/RealExpr.java
  
  Index: RealExpr.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/RealExpr.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.12.8.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/RelationalExpr.java
  
  Index: RelationalExpr.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/RelationalExpr.java,v
  retrieving revision 1.12
  retrieving revision 1.12.8.1
  diff -u -r1.12 -r1.12.8.1
  
  
  
  1.3.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/RelativeLocationPath.java
  
  Index: RelativeLocationPath.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/RelativeLocationPath.java,v
  retrieving revision 1.3
  retrieving revision 1.3.12.1
  diff -u -r1.3 -r1.3.12.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/RelativePathPattern.java
  
  Index: RelativePathPattern.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/RelativePathPattern.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/RoundCall.java
  
  Index: RoundCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/RoundCall.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/SimpleAttributeValue.java
  
  Index: SimpleAttributeValue.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/SimpleAttributeValue.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.15.2.1  +2 -2      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Sort.java
  
  Index: Sort.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Sort.java,v
  retrieving revision 1.15
  retrieving revision 1.15.2.1
  diff -u -r1.15 -r1.15.2.1
  --- Sort.java	9 Jul 2002 17:40:17 -0000	1.15
  +++ Sort.java	14 Aug 2002 19:21:33 -0000	1.15.2.1
  @@ -349,7 +349,7 @@
   	// Class initializer - void NodeSortRecord.<clinit>();
   	final InstructionList il = new InstructionList();
   	final CompareGenerator classInit =
  -	    new CompareGenerator(ACC_PUBLIC | ACC_STATIC,
  +	    new CompareGenerator(ACC_PUBLIC | ACC_FINAL,
   				 org.apache.bcel.generic.Type.VOID, 
   				 new org.apache.bcel.generic.Type[] { },
   				 new String[] { },
  
  
  
  1.1.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/SourceLoader.java
  
  Index: SourceLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/SourceLoader.java,v
  retrieving revision 1.1
  retrieving revision 1.1.12.1
  diff -u -r1.1 -r1.1.12.1
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/StartsWithCall.java
  
  Index: StartsWithCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/StartsWithCall.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.37.2.1  +37 -37    xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Step.java
  
  Index: Step.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Step.java,v
  retrieving revision 1.37
  retrieving revision 1.37.2.1
  diff -u -r1.37 -r1.37.2.1
  --- Step.java	27 Jun 2002 14:56:29 -0000	1.37
  +++ Step.java	14 Aug 2002 19:21:33 -0000	1.37.2.1
  @@ -74,28 +74,23 @@
   
   final class Step extends RelativeLocationPath {
   
  -    /**
  -     * This step's axis as defined in class Axis.
  -     */
  +    // This step's axis as defined in class Axis.
       private int _axis;
   
  -    /**
  -     * A vector of predicates (filters) defined on this step - may be null
  -     */
  +    // A vector of predicates (filters) defined on this step - may be null
       private Vector _predicates;
   
  -    /**
  -     * Some simple predicates can be handled by this class (and not by the
  -     * Predicate class) and will be removed from the above vector as they are
  -     * handled. We use this boolean to remember if we did have any predicates.
  -     */
  +    // Some simple predicates can be handled by this class (and not by the
  +    // Predicate class) and will be removed from the above vector as they are
  +    // handled. We use this boolean to remember if we did have any predicates.
       private boolean _hadPredicates = false;
   
  -    /**
  -     * Type of the node test.
  -     */
  +    // Type of the node test.
       private int _nodeType;
   
  +    /**
  +     * Constructor
  +     */
       public Step(int axis, int nodeType, Vector predicates) {
   	_axis = axis;
   	_nodeType = nodeType;
  @@ -161,12 +156,16 @@
        * an element like <xsl:for-each> or <xsl:apply-templates>.
        */
       private boolean hasParentPattern() {
  -	final SyntaxTreeNode parent = getParent();
  -	return (parent instanceof ParentPattern ||
  -		parent instanceof ParentLocationPath ||
  -		parent instanceof UnionPathExpr ||
  -		parent instanceof FilterParentPath);
  +	SyntaxTreeNode parent = getParent();
  +	if ((parent instanceof ParentPattern) ||
  +	    (parent instanceof ParentLocationPath) ||
  +	    (parent instanceof UnionPathExpr) ||
  +	    (parent instanceof FilterParentPath))
  +	    return(true);
  +	else
  +	    return(false);
       }
  +
       
       /**
        * Returns 'true' if this step has any predicates
  @@ -215,7 +214,14 @@
   
   	// Special case for '.' 
   	if (isAbbreviatedDot()) {
  -	    _type =  (hasParentPattern()) ? Type.NodeSet : Type.Node;
  +	    if (hasParentPattern())
  +		_type = Type.NodeSet;
  +	    else
  +		_type = Type.Node;
  +	}
  +	// Special case for '..'
  +	else if (isAbbreviatedDDot()) {
  +	    _type = Type.NodeSet;
   	}
   	else {
   	    _type = Type.NodeSet;
  @@ -246,8 +252,11 @@
   	if ((_axis == Axis.ANCESTOR)  || (_axis == Axis.ANCESTORORSELF) ||
   	    (_axis == Axis.PRECEDING) || (_axis == Axis.PRECEDINGSIBLING)) {
   
  -	    // Do not reverse nodes if we had predicates
  -	    // if (_hadPredicates) return false;
  +	    // Do not reverse nodes if we have a parent step that will reverse
  +	    // the nodes for us.
  +	    if (hasParentPattern()) return false;
  +	    if (hasPredicates()) return false;
  +	    if (_hadPredicates) return false;
   	    
   	    // Check if this step occured under an <xsl:apply-templates> element
   	    SyntaxTreeNode parent = this;
  @@ -260,11 +269,12 @@
   		if (parent instanceof ApplyTemplates) return true;
   		if (parent instanceof ForEach) return true;
   		if (parent instanceof FilterParentPath) return true;
  -		if (parent instanceof FilterExpr) return true;
   		if (parent instanceof WithParam) return true;
  -		if (parent instanceof ValueOf) return true;
   
  -	    } while (parent != null && parent instanceof Instruction == false);
  +		// No not order node set if descendant of these elements:
  +		if (parent instanceof ValueOf) return false;
  +
  +	    } while (parent != null);
   	}
   	return false;
       }
  @@ -282,11 +292,6 @@
   
   	if (hasPredicates()) {
   	    translatePredicates(classGen, methodGen);
  -
  -	    // If needed, create a reverse iterator after compiling preds
  -	    if (_predicates.size() == 0) {
  -		orderIterator(classGen, methodGen);
  -	    }
   	}
   	else {
   	    // If it is an attribute but not '@*' or '@attr' with a parent
  @@ -380,13 +385,8 @@
   		il.append(new PUSH(cpg, _axis));
   		il.append(new PUSH(cpg, _nodeType));
   		il.append(new INVOKEINTERFACE(ty, 3));
  -
  -		break;
  -	    }
  -
  -	    // If needed, create a reverse iterator
  -	    if (!_hadPredicates) {
   		orderIterator(classGen, methodGen);
  +		break;
   	    }
   	}
       }
  
  
  
  1.17.2.1  +2 -4      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/StepPattern.java
  
  Index: StepPattern.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/StepPattern.java,v
  retrieving revision 1.17
  retrieving revision 1.17.2.1
  diff -u -r1.17 -r1.17.2.1
  --- StepPattern.java	29 Jul 2002 21:30:51 -0000	1.17
  +++ StepPattern.java	14 Aug 2002 19:21:33 -0000	1.17.2.1
  @@ -150,9 +150,7 @@
   	final StringBuffer buffer = new StringBuffer("stepPattern(\"");
   	buffer.append(Axis.names[_axis])
   	    .append("\", ")
  -	    .append(_isEpsilon ? 
  -			("epsilon{" + Integer.toString(_nodeType) + "}") :
  -			 Integer.toString(_nodeType));
  +	    .append(_isEpsilon ? "epsilon" : Integer.toString(_nodeType));
   	if (_predicates != null)
   	    buffer.append(", ").append(_predicates.toString());
   	return buffer.append(')').toString();
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/StringCall.java
  
  Index: StringCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/StringCall.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/StringLengthCall.java
  
  Index: StringLengthCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/StringLengthCall.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.43.2.1  +19 -7     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Stylesheet.java
  
  Index: Stylesheet.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Stylesheet.java,v
  retrieving revision 1.43
  retrieving revision 1.43.2.1
  diff -u -r1.43 -r1.43.2.1
  --- Stylesheet.java	17 Jul 2002 18:52:20 -0000	1.43
  +++ Stylesheet.java	14 Aug 2002 19:21:33 -0000	1.43.2.1
  @@ -399,12 +399,13 @@
        * Parse all direct children of the <xsl:stylesheet/> element.
        */
       public final void parseOwnChildren(Parser parser) {
  +
   	final Vector contents = getContents();
   	final int count = contents.size();
   
   	// We have to scan the stylesheet element's top-level elements for
  -	// variables and/or parameters before we parse the other elements
  -	for (int i = 0; i < count; i++) {
  +	// variables and/or parameters before we parse the other elements...
  +	for (int i=0; i<count; i++) {
   	    SyntaxTreeNode child = (SyntaxTreeNode)contents.elementAt(i);
   	    if ((child instanceof VariableBase) ||
   		(child instanceof NamespaceAlias)) {
  @@ -413,11 +414,22 @@
   	    }
   	}
   
  +	// Then we have to go through the included/imported stylesheets
  +	for (int i=0; i<count; i++) {
  +	    SyntaxTreeNode child = (SyntaxTreeNode)contents.elementAt(i);
  +	    if ((child instanceof Import) || (child instanceof Include)) {
  +		parser.getSymbolTable().setCurrentNode(child);
  +		child.parseContents(parser);		
  +	    }
  +	}
  +
   	// Now go through all the other top-level elements...
  -	for (int i = 0; i < count; i++) {
  +	for (int i=0; i<count; i++) {
   	    SyntaxTreeNode child = (SyntaxTreeNode)contents.elementAt(i);
  -	    if (!(child instanceof VariableBase) && 
  -		!(child instanceof NamespaceAlias)) {
  +	    if (!(child instanceof VariableBase) &&
  +		!(child instanceof NamespaceAlias) &&
  +		!(child instanceof Import) &&
  +		!(child instanceof Include)) {
   		parser.getSymbolTable().setCurrentNode(child);
   		child.parseContents(parser);
   	    }
  @@ -426,7 +438,7 @@
   	    // <xsl:apply-imports/> element was ever used in this stylesheet
   	    if (!_templateInlining && (child instanceof Template)) {
   		Template template = (Template)child;
  -		String name = "template$dot$" + template.getPosition();
  +		String name = "template$dot$"+template.getPosition();
   		template.setName(parser.getQName(name));
   	    }
   	}
  
  
  
  1.8.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/SymbolTable.java
  
  Index: SymbolTable.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/SymbolTable.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  
  
  
  1.20.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/SyntaxTreeNode.java
  
  Index: SyntaxTreeNode.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/SyntaxTreeNode.java,v
  retrieving revision 1.20
  retrieving revision 1.20.2.1
  diff -u -r1.20 -r1.20.2.1
  
  
  
  1.17.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Template.java
  
  Index: Template.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Template.java,v
  retrieving revision 1.17
  retrieving revision 1.17.2.1
  diff -u -r1.17 -r1.17.2.1
  
  
  
  1.8.2.1   +101 -154  xml-xalan/java/src/org/apache/xalan/xsltc/compiler/TestSeq.java
  
  Index: TestSeq.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/TestSeq.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- TestSeq.java	29 Jul 2002 21:30:51 -0000	1.8
  +++ TestSeq.java	14 Aug 2002 19:21:33 -0000	1.8.2.1
  @@ -69,7 +69,6 @@
   import java.util.Hashtable;
   import java.util.Dictionary;
   import java.util.Enumeration;
  -import java.util.Iterator;
   
   import org.apache.bcel.generic.*;
   import org.apache.xalan.xsltc.compiler.util.*;
  @@ -78,149 +77,110 @@
    * A test sequence is a sequence of patterns that
    *
    *  (1) occured in templates in the same mode
  - *  (2) share the same kernel node type (e.g. A/B and C/C/B)
  - *  (3) may also contain patterns matching "*" and "node()"
  - *      (element sequence only) or matching "@*" (attribute
  - *      sequence only).
  + *  (2) share the same kernel node type (such as A/B and C/C/B).
    *
  - * A test sequence may have a default template, which will be 
  - * instantiated if none of the other patterns match. 
  + * A test sequence may have a default template, which will be run if
  + * none of the patterns do not match. This template is always a template
  + * that matches solely on the shared kernel node type.
    */
   final class TestSeq {
   
  -    /**
  -     * Integer code for the kernel type of this test sequence
  -     */
  -    private int _kernelType;
  -
  -    /**
  -     * Vector of all patterns in the test sequence. May include
  -     * patterns with "*", "@*" or "node()" kernel.
  -     */
  -    private Vector _patterns = null;
  -
  -    /**
  -     * A reference to the Mode object.
  -     */
  -    private Mode _mode = null;
  -
  -    /**
  -     * Default template for this test sequence
  -     */
  -    private Template _default = null;
  +    private Vector   _patterns = null; // all patterns
  +    private Mode     _mode     = null; // the shared mode
  +    private Template _default  = null; // the default template
   
  -    /**
  -     * Instruction list representing this test sequence.
  -     */
       private InstructionList _instructionList;
   
       /**
  -     * Cached handle to avoid compiling more than once.
  -     */
  -    private InstructionHandle _start = null;
  -
  -    /**
  -     * Creates a new test sequence given a set of patterns and a mode.
  +     * Creates a new test sequence, given a set of patterns and a mode.
        */
       public TestSeq(Vector patterns, Mode mode) {
  -	this(patterns, -2, mode);
  -    }
  -
  -    public TestSeq(Vector patterns, int kernelType, Mode mode) {
   	_patterns = patterns;
  -	_kernelType = kernelType;
   	_mode = mode;
       }
   
       /**
  -     * Returns a string representation of this test sequence. Notice
  -     * that test sequences are mutable, so the value returned by this
  -     * method is different before and after calling reduce().
  +     * The priority is only calculated if the test sequence has a default
  +     * template. This is bad, bad, bad. We should get the priority from the
  +     * other templates that make up the test sequence.
        */
  -    public String toString() {
  +    public double getPriority() {
  +	double prio = (0 - Double.MAX_VALUE);
   	final int count = _patterns.size();
  -	final StringBuffer result = new StringBuffer();
   
   	for (int i = 0; i < count; i++) {
  -	    final LocationPathPattern pattern =
  -		(LocationPathPattern) _patterns.elementAt(i);
  -
  -	    if (i == 0) {
  -		result.append("Testseq for kernel " + _kernelType)
  -		      .append('\n');
  -	    }
  -	    result.append("   pattern " + i + ": ")
  -	          .append(pattern.toString())
  -		  .append('\n');
  +	    final Pattern pattern = (Pattern)_patterns.elementAt(i);
  +	    final Template template = pattern.getTemplate();
  +	    final double tp = template.getPriority();
  +	    if (tp > prio) prio = tp;
   	}
  -	return result.toString();
  -    }
  -
  -    /**
  -     * Returns the instruction list for this test sequence
  -     */
  -    public InstructionList getInstructionList() {
  -	return _instructionList;
  -    }
  -
  -    /**
  -     * Return the highest priority for a pattern in this test
  -     * sequence. This is either the priority of the first or
  -     * of the default pattern.
  -     */
  -    public double getPriority() {
  -	final Template template = (_patterns.size() == 0) ? _default 
  -	    : ((Pattern) _patterns.elementAt(0)).getTemplate();
  -	return template.getPriority();
  +	if (_default != null) {
  +	    final double tp = _default.getPriority();
  +	    if (tp > prio) prio = tp;
  +	}
  +	return prio;
       }
   
       /**
  -     * Returns the position of the highest priority pattern in 
  -     * this test sequence.
  +     * This method should return the last position of any template included
  +     * in this test sequence.
        */
       public int getPosition() {
  -	final Template template = (_patterns.size() == 0) ? _default 
  -	    : ((Pattern) _patterns.elementAt(0)).getTemplate();
  -	return template.getPosition();
  -    }
  +	int pos = Integer.MIN_VALUE;
  +	final int count = _patterns.size();
   
  +	for (int i = 0; i < count; i++) {
  +	    final Pattern pattern = (Pattern)_patterns.elementAt(i);
  +	    final Template template = pattern.getTemplate();
  +	    final int tp = template.getPosition();
  +	    if (tp > pos) pos = tp;
  +	}
  +	if (_default != null) {
  +	    final int tp = _default.getPosition();
  +	    if (tp > pos) pos = tp;
  +	}
  +	return pos;
  +    }
  +	
       /**
  -     * Reduce the patterns in this test sequence. Creates a new
  -     * vector of patterns and sets the default pattern if it
  -     * finds a patterns that is fully reduced.
  +     * Reduce the patterns in this test sequence to exclude the shared
  +     * kernel node type. After the switch() in the translet's applyTemplates()
  +     * we already know that we have a hit for the kernel node type, we only
  +     * have the check the rest of the pattern.
        */
       public void reduce() {
   	final Vector newPatterns = new Vector();
  -
   	final int count = _patterns.size();
  +
  +	// Traverse the existing set of patterns (they are in prioritised order)
   	for (int i = 0; i < count; i++) {
   	    final LocationPathPattern pattern =
   		(LocationPathPattern)_patterns.elementAt(i);
  -		
  -	    // Reduce this pattern
  +	    // Reduce this pattern (get rid of kernel node type)
   	    pattern.reduceKernelPattern();
   			
  -	    // Is this pattern fully reduced?
  -	    if (pattern.isWildcard()) {
  -		_default = pattern.getTemplate();
  -		break; 		// Ignore following patterns 
  +	    // Add this pattern to the new vector of patterns.
  +	    if (!pattern.isWildcard()) {
  +		newPatterns.addElement(pattern);
   	    }
  +	    // Set template as default if its pattern matches purely on kernel
   	    else {
  -		newPatterns.addElement(pattern);
  +		_default = pattern.getTemplate();
  +		// Following patterns can be ignored since default has priority
  +		break;
   	    }
   	}
   	_patterns = newPatterns;
       }
   
       /**
  -     * Returns, by reference, the templates that are included in 
  -     * this test sequence. Note that a single template can occur 
  -     * in several test sequences if its pattern is a union.
  +     * Returns, by reference, the templates that are included in this test
  +     * sequence. Remember that a single template can occur in several test
  +     * sequences if its pattern is a union (ex. match="A/B | A/C").
        */
       public void findTemplates(Dictionary templates) {
  -	if (_default != null) {
  +	if (_default != null)
   	    templates.put(_default, this);
  -	}
   	for (int i = 0; i < _patterns.size(); i++) {
   	    final LocationPathPattern pattern =
   		(LocationPathPattern)_patterns.elementAt(i);
  @@ -229,10 +189,9 @@
       }
   
       /**
  -     * Get the instruction handle to a template's code. This is 
  -     * used when a single template occurs in several test 
  -     * sequences; that is, if its pattern is a union of patterns 
  -     * (e.g. match="A/B | A/C").
  +     * Get the instruction handle to a template's code. This is used when
  +     * a single template occurs in several test sequences; that is, if its
  +     * pattern is a union of patterns (ex. match="A/B | A/C").
        */
       private InstructionHandle getTemplateHandle(Template template) {
   	return (InstructionHandle)_mode.getTemplateInstructionHandle(template);
  @@ -245,83 +204,71 @@
   	return (LocationPathPattern)_patterns.elementAt(n);
       }
   
  +
  +    private InstructionHandle _start = null;
  +
       /**
  -     * Compile the code for this test sequence. Compile patterns 
  -     * from highest to lowest priority. Note that since patterns 
  -     * can be share by multiple test sequences, instruction lists 
  -     * must be copied before backpatching.
  +     * Copile the code for this test sequence. The code will first test for
  +     * the pattern with the highest priority, then go on to the next ones,
  +     * until it hits or finds the default template.
        */
       public InstructionHandle compile(ClassGenerator classGen,
   				     MethodGenerator methodGen,
  -				     InstructionHandle continuation) 
  -    {
  -	// Returned cached value if already compiled
  -	if (_start != null) {
  -	    return _start;
  -	}
  +				     InstructionHandle continuation) {
   
  -	// If not patterns, then return handle for default template
   	final int count = _patterns.size();
  -	if (count == 0) {
  -	    return (_start = getTemplateHandle(_default));
  -	}
  +	
  +	if (_start != null) return(_start);
   
  -	// Init handle to jump when all patterns failed
  -	InstructionHandle fail = (_default == null) ? continuation
  -	    : getTemplateHandle(_default);
  +	// EZ DC if there is only one (default) pattern
  +	if (count == 0) getTemplateHandle(_default);
  +
  +	// The 'fail' instruction handle represents a branch to go to when
  +	// test fails. It is updated in each iteration, so that the tests
  +	// are linked together in the  if-elseif-elseif-else fashion.
  +	InstructionHandle fail;
   	
  -	// Compile all patterns in reverse order
  -	for (int n = count - 1; n >= 0; n--) {
  +	// Initialize 'fail' to either the code for the default template
  +	if (_default != null)
  +	    fail = getTemplateHandle(_default);
  +	// ..or if that does not exist, to a location set by the caller.
  +	else
  +	    fail = continuation;
  +
  +	for (int n = (count - 1); n >= 0; n--) {
   	    final LocationPathPattern pattern = getPattern(n);
   	    final Template template = pattern.getTemplate();
   	    final InstructionList il = new InstructionList();
   
   	    // Patterns expect current node on top of stack
   	    il.append(methodGen.loadCurrentNode());
  -
   	    // Apply the test-code compiled for the pattern
  -	    InstructionList ilist = _mode.getInstructionList(pattern);
  -	    if (ilist == null) {
  -		ilist = pattern.compile(classGen, methodGen);
  -		_mode.addInstructionList(pattern, ilist);
  -	    }
  -
  -	    // Make a copy of the instruction list for backpatching
  -	    InstructionList copyOfilist = ilist.copy();
  -
  -	    FlowList trueList = pattern.getTrueList();
  -	    if (trueList != null) {
  -		trueList = trueList.copyAndRedirect(ilist, copyOfilist);
  -	    }
  -	    FlowList falseList = pattern.getFalseList();
  -	    if (falseList != null) {
  -		falseList = falseList.copyAndRedirect(ilist, copyOfilist);
  -	    }
  -
  -	    il.append(copyOfilist);
  +	    il.append(pattern.compile(classGen, methodGen));
   
   	    // On success branch to the template code
   	    final InstructionHandle gtmpl = getTemplateHandle(template);
   	    final InstructionHandle success = il.append(new GOTO_W(gtmpl));
  +	    pattern.backPatchTrueList(success);
  +	    pattern.backPatchFalseList(fail);
   
  -	    if (trueList != null) {
  -		trueList.backPatch(success);
  -	    }
  -	    if (falseList != null) {
  -		falseList.backPatch(fail);
  -	    } 
  -
  -	    // Next pattern's 'fail' target is this pattern's first instruction
  +	    // We're working backwards here. The next pattern's 'fail' target
  +	    // is this pattern's first instruction
   	    fail = il.getStart();
   
   	    // Append existing instruction list to the end of this one
  -	    if (_instructionList != null) {
  -		il.append(_instructionList);
  -	    }
  +	    if (_instructionList != null) il.append(_instructionList);
   
  -	    // Set current instruction list to be this one
  +	    // Set current instruction list to be this one.
   	    _instructionList = il;
   	}
  -	return (_start = fail);
  +	return(_start = fail);
  +    }
  +
  +    /**
  +     * Returns the instruction list for this test sequence
  +     */
  +    public InstructionList getInstructionList() {
  +	return _instructionList;
       }
  +
   }
  
  
  
  1.12.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Text.java
  
  Index: Text.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Text.java,v
  retrieving revision 1.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/TopLevelElement.java
  
  Index: TopLevelElement.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/TopLevelElement.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.7.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/TransletOutput.java
  
  Index: TransletOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/TransletOutput.java,v
  retrieving revision 1.7
  retrieving revision 1.7.8.1
  diff -u -r1.7 -r1.7.8.1
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/UnaryOpExpr.java
  
  Index: UnaryOpExpr.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/UnaryOpExpr.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.6.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/UnionPathExpr.java
  
  Index: UnionPathExpr.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/UnionPathExpr.java,v
  retrieving revision 1.6
  retrieving revision 1.6.8.1
  diff -u -r1.6 -r1.6.8.1
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/UnparsedEntityUriCall.java
  
  Index: UnparsedEntityUriCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/UnparsedEntityUriCall.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.3.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/UnresolvedRef.java
  
  Index: UnresolvedRef.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/UnresolvedRef.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/UnsupportedElement.java
  
  Index: UnsupportedElement.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/UnsupportedElement.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.8.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/UseAttributeSets.java
  
  Index: UseAttributeSets.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/UseAttributeSets.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  
  
  
  1.7.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ValueOf.java
  
  Index: ValueOf.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ValueOf.java,v
  retrieving revision 1.7
  retrieving revision 1.7.8.1
  diff -u -r1.7 -r1.7.8.1
  
  
  
  1.22.8.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Variable.java
  
  Index: Variable.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Variable.java,v
  retrieving revision 1.22
  retrieving revision 1.22.8.1
  diff -u -r1.22 -r1.22.8.1
  
  
  
  1.16.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableBase.java
  
  Index: VariableBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableBase.java,v
  retrieving revision 1.16
  retrieving revision 1.16.2.1
  diff -u -r1.16 -r1.16.2.1
  
  
  
  1.12.2.1  +5 -7      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableRef.java
  
  Index: VariableRef.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableRef.java,v
  retrieving revision 1.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  --- VariableRef.java	13 Aug 2002 19:12:32 -0000	1.12
  +++ VariableRef.java	14 Aug 2002 19:21:34 -0000	1.12.2.1
  @@ -135,12 +135,10 @@
   	}
   
   	if (_variable.getType() instanceof NodeSetType) {
  -	    // The method cloneIterator() also does resetting
  -	    final int clone = cpg.addInterfaceMethodref(NODE_ITERATOR,
  -						       "cloneIterator",
  -						       "()" + 
  -							NODE_ITERATOR_SIG);
  -	    il.append(new INVOKEINTERFACE(clone, 1));
  +	    final int reset = cpg.addInterfaceMethodref(NODE_ITERATOR,
  +							"reset",
  +							"()"+NODE_ITERATOR_SIG);
  +	    il.append(new INVOKEINTERFACE(reset,1));	    
   	}
   
       }
  
  
  
  1.8.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableRefBase.java
  
  Index: VariableRefBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableRefBase.java,v
  retrieving revision 1.8
  retrieving revision 1.8.8.1
  diff -u -r1.8 -r1.8.8.1
  
  
  
  1.10.2.1  +8 -7      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/When.java
  
  Index: When.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/When.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- When.java	26 Jun 2002 21:25:35 -0000	1.10
  +++ When.java	14 Aug 2002 19:21:34 -0000	1.10.2.1
  @@ -90,12 +90,13 @@
   
       public void parseContents(Parser parser) {
   	_test = parser.parseExpression(this, "test", null);
  -
  -	// Ignore xsl:if when test is false (function-available() and
  -	// element-available())
  -	Object result = _test.evaluateAtCompileTime();
  -	if (result != null && result instanceof Boolean) {
  -	    _ignore = !((Boolean) result).booleanValue();
  +	if (_test instanceof ElementAvailableCall) {
  +	    ElementAvailableCall call = (ElementAvailableCall)_test;
  +	    _ignore = !call.getResult();
  +	}
  +	if (_test instanceof FunctionAvailableCall) {
  +	    FunctionAvailableCall call = (FunctionAvailableCall)_test;
  +	    _ignore = !call.getResult();
   	}
   
   	parseChildren(parser);
  
  
  
  1.7.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Whitespace.java
  
  Index: Whitespace.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Whitespace.java,v
  retrieving revision 1.7
  retrieving revision 1.7.8.1
  diff -u -r1.7 -r1.7.8.1
  
  
  
  1.10.8.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/WithParam.java
  
  Index: WithParam.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/WithParam.java,v
  retrieving revision 1.10
  retrieving revision 1.10.8.1
  diff -u -r1.10 -r1.10.8.1
  
  
  
  1.42.2.1  +4 -11     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.42
  retrieving revision 1.42.2.1
  diff -u -r1.42 -r1.42.2.1
  --- XSLTC.java	23 Jul 2002 19:47:42 -0000	1.42
  +++ XSLTC.java	14 Aug 2002 19:21:34 -0000	1.42.2.1
  @@ -341,11 +341,7 @@
   	    if ((!_parser.errorsFound()) && (_stylesheet != null)) {
   		_stylesheet.setCallsNodeset(_callsNodeset);
   		_stylesheet.setMultiDocument(_multiDocument);
  -
  -		// Class synchronization is needed for BCEL
  -		synchronized (getClass()) {
  -		    _stylesheet.translate();
  -		}
  +		_stylesheet.translate();
   	    }
   	}
   	catch (Exception e) {
  @@ -692,10 +688,7 @@
   	try {
   	    switch (_outputType) {
   	    case FILE_OUTPUT:
  -		clazz.dump(
  -		    new BufferedOutputStream(
  -			new FileOutputStream(
  -			    getOutputFile(clazz.getClassName()))));
  +		clazz.dump(getOutputFile(clazz.getClassName()));
   		break;
   	    case JAR_OUTPUT:
   		_classes.addElement(clazz);	 
  @@ -727,7 +720,7 @@
   	// create the manifest
   	final Manifest manifest = new Manifest();
   	final java.util.jar.Attributes atrs = manifest.getMainAttributes();
  -	atrs.put(java.util.jar.Attributes.Name.MANIFEST_VERSION,"1.1");
  +	atrs.put(java.util.jar.Attributes.Name.MANIFEST_VERSION,"1.0");
   
   	final Map map = manifest.getEntries();
   	// create manifest
  
  
  
  1.18.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XslAttribute.java
  
  Index: XslAttribute.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XslAttribute.java,v
  retrieving revision 1.18
  retrieving revision 1.18.2.1
  diff -u -r1.18 -r1.18.2.1
  
  
  
  1.17.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XslElement.java
  
  Index: XslElement.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XslElement.java,v
  retrieving revision 1.17
  retrieving revision 1.17.2.1
  diff -u -r1.17 -r1.17.2.1
  
  
  
  1.39.2.1  +6 -4      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.cup
  
  Index: xpath.cup
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.cup,v
  retrieving revision 1.39
  retrieving revision 1.39.2.1
  diff -u -r1.39 -r1.39.2.1
  --- xpath.cup	27 Jun 2002 21:52:09 -0000	1.39
  +++ xpath.cup	14 Aug 2002 19:21:35 -0000	1.39.2.1
  @@ -756,9 +756,11 @@
   
           | INT:num
           {: 
  +	   // bug fix 3592, num comes in as a Long rather than an Integer
  +	   //               see xpath.lex, {Digit}+ rule. 
   	   long value = num.longValue();
  -	   if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) {
  -		RESULT = new RealExpr(value);
  +	   if ((value < Integer.MIN_VALUE) || (value > Integer.MAX_VALUE)) {
  +		RESULT = new LongExpr(num.longValue());
   	   }
   	   else {
                  if (num.doubleValue() == -0)
  @@ -767,7 +769,7 @@
                      RESULT = new IntExpr(num.intValue());
                  else if (num.doubleValue() == 0.0)
                      RESULT = new RealExpr(num.doubleValue());
  -               else 
  +               else
                      RESULT = new IntExpr(num.intValue());
   	   }
           :}
  
  
  
  1.8.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.lex
  
  Index: xpath.lex
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.lex,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/AttributeSetMethodGenerator.java
  
  Index: AttributeSetMethodGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/AttributeSetMethodGenerator.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/BooleanType.java
  
  Index: BooleanType.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/BooleanType.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ClassGenerator.java
  
  Index: ClassGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ClassGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/CompareGenerator.java
  
  Index: CompareGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/CompareGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.12.2.1  +3 -7      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages.java
  
  Index: ErrorMessages.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages.java,v
  retrieving revision 1.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  --- ErrorMessages.java	25 Jul 2002 11:44:19 -0000	1.12
  +++ ErrorMessages.java	14 Aug 2002 19:21:40 -0000	1.12.2.1
  @@ -83,7 +83,7 @@
   	// CLASS_NOT_FOUND_ERR
   	"Cannot find class ''{0}''.",
   	// METHOD_NOT_FOUND_ERR
  -	"Cannot find external method ''{0}'' (must be public).",
  +	"Cannot find external method ''{0}'' (must be static and public).",
   	// ARGUMENT_CONVERSION_ERR
   	"Cannot convert argument/return type in call to method ''{0}''",
   	// FILE_NOT_FOUND_ERR
  @@ -265,11 +265,7 @@
   	// UNSUPPORTED_ENCODING
   	"Output encoding ''{0}'' is not supported on this JVM.",
   	// SYNTAX_ERR
  -	"Syntax error in ''{0}''.",
  -	// CONSTRUCTOR_NOT_FOUND 
  -	"Cannot find external constructor ''{0}''.",
  -	// NO_JAVA_FUNCT_THIS_REF 
  -	"First argument to non-static Java function ''{0}'' is not valid object ref."
  +	"Syntax error in ''{0}''."
       };
   
       private static Vector _keys;
  
  
  
  1.6.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages_no.java
  
  Index: ErrorMessages_no.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages_no.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  
  
  
  1.14.2.1  +1 -3      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java
  
  Index: ErrorMsg.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java,v
  retrieving revision 1.14
  retrieving revision 1.14.2.1
  diff -u -r1.14 -r1.14.2.1
  --- ErrorMsg.java	25 Jul 2002 11:44:19 -0000	1.14
  +++ ErrorMsg.java	14 Aug 2002 19:21:40 -0000	1.14.2.1
  @@ -166,8 +166,6 @@
       public static final int STRAY_SORT_ERR          = 74;
       public static final int UNSUPPORTED_ENCODING    = 75;
       public static final int SYNTAX_ERR              = 76;
  -    public static final int CONSTRUCTOR_NOT_FOUND   = 77;
  -    public static final int NO_JAVA_FUNCT_THIS_REF  = 78;
   
       // All error messages are localized and are stored in resource bundles.
       // This array and the following 4 strings are read from that bundle.
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/FilterGenerator.java
  
  Index: FilterGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/FilterGenerator.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/IntType.java
  
  Index: IntType.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/IntType.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/MatchGenerator.java
  
  Index: MatchGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/MatchGenerator.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.9.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
  
  Index: MethodGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/MethodType.java
  
  Index: MethodType.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/MethodType.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.3.2.1   +6 -7      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/MultiHashtable.java
  
  Index: MultiHashtable.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/MultiHashtable.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- MultiHashtable.java	30 Jul 2002 22:07:52 -0000	1.3
  +++ MultiHashtable.java	14 Aug 2002 19:21:40 -0000	1.3.2.1
  @@ -75,18 +75,17 @@
   	return vector;
       }
   	
  -    public Object maps(Object from, Object to) {
  -	if (from == null) return null;
  +    public boolean maps(Object from, Object to) {
  +	if (from == null) return false;
   	final Vector vector = (Vector) get(from);
   	if (vector != null) {
   	    final int n = vector.size();
   	    for (int i = 0; i < n; i++) {
  -                final Object item = vector.elementAt(i);
  -		if (item.equals(to)) {
  -		    return item;
  +		if (vector.elementAt(i).equals(to)) {
  +		    return true;
   		}
   	    }
   	}
  -	return null;
  +	return false;
       }
   }
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NamedMethodGenerator.java
  
  Index: NamedMethodGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NamedMethodGenerator.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NodeCounterGenerator.java
  
  Index: NodeCounterGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NodeCounterGenerator.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.10.2.1  +1 -47     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NodeSetType.java
  
  Index: NodeSetType.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NodeSetType.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- NodeSetType.java	25 Jul 2002 11:44:19 -0000	1.10
  +++ NodeSetType.java	14 Aug 2002 19:21:40 -0000	1.10.2.1
  @@ -113,9 +113,6 @@
   	else if (type == Type.Reference) {
   	    translateTo(classGen, methodGen, (ReferenceType) type);
   	}
  -	else if (type == Type.Object) {
  -	    translateTo(classGen, methodGen, (ObjectType) type);
  -	}
   	else {
   	    ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
   					toString(), type.toString());
  @@ -124,39 +121,6 @@
       }
   
       /**
  -     * Translates an external Java Class into an internal type.
  -     * Expects the Java object on the stack, pushes the internal type
  -     */
  -    public void translateFrom(ClassGenerator classGen, 
  -	MethodGenerator methodGen, Class clazz) 
  -    {
  -		
  -  	InstructionList il = methodGen.getInstructionList();
  -	ConstantPoolGen cpg = classGen.getConstantPool();
  -	if (clazz.getName().equals("org.w3c.dom.NodeList")) {
  -	   // w3c NodeList is on the stack from the external Java function call.
  -	   // call BasisFunction to consume NodeList and leave Iterator on
  -	   //    the stack. 
  -	   il.append(classGen.loadTranslet());   // push translet onto stack
  -	   il.append(methodGen.loadDOM());   	 // push DOM onto stack
  -	   final int convert = cpg.addMethodref(BASIS_LIBRARY_CLASS,
  -					"nodeList2Iterator",
  -					"("		
  -					 + "Lorg/w3c/dom/NodeList;"
  -					 + TRANSLET_INTF_SIG 
  -					 + DOM_INTF_SIG 
  -					 + ")" + NODE_ITERATOR_SIG );
  -	   il.append(new INVOKESTATIC(convert));
  -	}
  -	else {
  -	    ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
  -		toString(), clazz.getName());
  -	    classGen.getParser().reportError(Constants.FATAL, err);
  -	} 
  -    }
  -
  -
  -    /**
        * Translates a node-set into a synthesized boolean.
        * The boolean value of a node-set is "true" if non-empty
        * and "false" otherwise. Notice that the 
  @@ -213,16 +177,6 @@
       public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
   			    NodeType type) {
   	getFirstNode(classGen, methodGen);
  -    }
  -
  -    /**
  -     * Subsume node-set into ObjectType.
  -     *
  -     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
  -     */
  -    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
  -			    ObjectType type) {
  -	    methodGen.getInstructionList().append(NOP);	
       }
   
       /**
  
  
  
  1.4.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NodeSortRecordGenerator.java
  
  Index: NodeSortRecordGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NodeSortRecordGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.4.8.1
  diff -u -r1.4 -r1.4.8.1
  
  
  
  1.8.2.1   +1 -14     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NodeType.java
  
  Index: NodeType.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NodeType.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- NodeType.java	25 Jul 2002 11:45:28 -0000	1.8
  +++ NodeType.java	14 Aug 2002 19:21:40 -0000	1.8.2.1
  @@ -129,9 +129,6 @@
   	else if (type == Type.Reference) {
   	    translateTo(classGen, methodGen, (ReferenceType) type);
   	}
  -	else if (type == Type.Object) {
  -	    translateTo(classGen, methodGen, (ObjectType) type);
  -	}
   	else {
   	    ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
   					toString(), type.toString());
  @@ -228,16 +225,6 @@
   	final int init = cpg.addMethodref(SINGLETON_ITERATOR, "<init>",
   					  "(" + NODE_SIG +")V");
   	il.append(new INVOKESPECIAL(init));
  -    }
  -
  -    /**
  -     * Subsume Node into ObjectType.
  -     *
  -     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
  -     */
  -    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
  -			    ObjectType type) {
  -	    methodGen.getInstructionList().append(NOP);	
       }
   
       /**
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NumberType.java
  
  Index: NumberType.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/NumberType.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/RealType.java
  
  Index: RealType.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/RealType.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.11.2.1  +1 -14     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.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- ReferenceType.java	30 Jul 2002 18:30:28 -0000	1.11
  +++ ReferenceType.java	14 Aug 2002 19:21:40 -0000	1.11.2.1
  @@ -116,9 +116,6 @@
   	else if (type == Type.ResultTree) {
   	    translateTo(classGen, methodGen, (ResultTreeType) type);
   	}
  -	else if (type == Type.Object) {
  -	    translateTo(classGen, methodGen, (ObjectType) type);
  -	}
   	else {
   	    ErrorMsg err = new ErrorMsg(ErrorMsg.INTERNAL_ERR, type.toString());
   	    classGen.getParser().reportError(Constants.FATAL, err);
  @@ -228,16 +225,6 @@
   	int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "referenceToResultTree", 
   				     "(" + OBJECT_SIG + ")" + DOM_INTF_SIG);
   	il.append(new INVOKESTATIC(index));
  -    }
  -
  -    /**
  -     * Subsume reference into ObjectType.
  -     *
  -     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
  -     */
  -    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
  -			    ObjectType type) {
  -	methodGen.getInstructionList().append(NOP);	
       }
   
       /**
  
  
  
  1.11.2.1  +1 -18     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ResultTreeType.java
  
  Index: ResultTreeType.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ResultTreeType.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- ResultTreeType.java	30 Jul 2002 18:30:29 -0000	1.11
  +++ ResultTreeType.java	14 Aug 2002 19:21:40 -0000	1.11.2.1
  @@ -134,9 +134,6 @@
   	else if (type == Type.Reference) {
   	    translateTo(classGen, methodGen, (ReferenceType)type);
   	}
  -	else if (type == Type.Object) {
  -	    translateTo(classGen, methodGen, (ObjectType) type);
  -	}
   	else {
   	    ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
   					toString(), type.toString());
  @@ -371,16 +368,6 @@
       }
   
       /**
  -     * Subsume result tree into ObjectType.
  -     *
  -     * @see	org.apache.xalan.xsltc.compiler.util.Type#translateTo
  -     */
  -    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
  -			    ObjectType type) {
  -	methodGen.getInstructionList().append(NOP);	
  -    }
  -
  -    /**
        * Translates a result tree into a non-synthesized boolean.
        * It does not push a 0 or a 1 but instead returns branchhandle list
        * to be appended to the false list.
  @@ -430,11 +417,7 @@
   						  MAKE_NODE_LIST_SIG2);
   	    il.append(new INVOKEINTERFACE(index, 2));
   	}
  -	else if (className.equals("java.lang.Object")) {
  -	    il.append(NOP);
  -	}
   	else {
  -System.out.println("ResultTreeType.translateTo()");
   	    ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
   					toString(), className);
   	    classGen.getParser().reportError(Constants.FATAL, err);
  
  
  
  1.2.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/RtMethodGenerator.java
  
  Index: RtMethodGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/RtMethodGenerator.java,v
  retrieving revision 1.2
  retrieving revision 1.2.8.1
  diff -u -r1.2 -r1.2.8.1
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/SlotAllocator.java
  
  Index: SlotAllocator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/SlotAllocator.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/StringStack.java
  
  Index: StringStack.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/StringStack.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.6.2.1   +5 -22     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/StringType.java
  
  Index: StringType.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/StringType.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- StringType.java	25 Jul 2002 11:45:28 -0000	1.6
  +++ StringType.java	14 Aug 2002 19:21:40 -0000	1.6.2.1
  @@ -182,8 +182,7 @@
        * @see	org.apache.xalan.xsltc.compiler.util.Type#translateFrom
        */
       public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, 
  -			    Class clazz) 
  -    {
  +			    Class clazz) {
   	if (clazz.getName().equals("java.lang.String")) {
   	    // same internal representation
   	    methodGen.getInstructionList().append(NOP);
  @@ -200,25 +199,9 @@
        *
        * @see	org.apache.xalan.xsltc.compiler.util.Type#translateFrom
        */
  -    public void translateFrom(ClassGenerator classGen, 
  -	MethodGenerator methodGen, Class clazz) 
  -    {
  -	final ConstantPoolGen cpg = classGen.getConstantPool();
  -	final InstructionList il = methodGen.getInstructionList();
  -
  -	if (clazz.getName().equals("java.lang.String")) {
  -	    // same internal representation, convert null to ""
  -	    il.append(DUP);
  -	    final BranchHandle ifNonNull = il.append(new IFNONNULL(null));
  -	    il.append(POP);
  -	    il.append(new PUSH(cpg, ""));
  -	    ifNonNull.setTarget(il.append(NOP));
  -	}
  -	else {
  -	    ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
  -					toString(), clazz.getName());
  -	    classGen.getParser().reportError(Constants.FATAL, err);
  -	}
  +    public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen, 
  +			      Class clazz) {
  +	translateTo(classGen, methodGen, clazz);
       }
   
       /**
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/TestGenerator.java
  
  Index: TestGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/TestGenerator.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  1.11.2.1  +2 -2      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/Type.java
  
  Index: Type.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/Type.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- Type.java	25 Jul 2002 11:45:28 -0000	1.11
  +++ Type.java	14 Aug 2002 19:21:40 -0000	1.11.2.1
  @@ -72,6 +72,7 @@
   
   public abstract class Type implements Constants {
       public static final Type Int        = new IntType();
  +    public static final Type Lng        = new LongType(); //GTM,bug 3592
       public static final Type Real       = new RealType();
       public static final Type Boolean    = new BooleanType();
       public static final Type NodeSet    = new NodeSetType();
  @@ -79,7 +80,6 @@
       public static final Type ResultTree = new ResultTreeType();
       public static final Type Reference  = new ReferenceType();
       public static final Type Void       = new VoidType();
  -    public static final Type Object     = new ObjectType();
   
       public static final Type Node       = new NodeType(NodeTest.ANODE);
       public static final Type Root       = new NodeType(NodeTest.ROOT);
  
  
  
  1.2.2.1   +1 -5      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/TypeCheckError.java
  
  Index: TypeCheckError.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/TypeCheckError.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- TypeCheckError.java	15 Jul 2002 15:57:38 -0000	1.2
  +++ TypeCheckError.java	14 Aug 2002 19:21:40 -0000	1.2.2.1
  @@ -89,10 +89,6 @@
   	_error = new ErrorMsg(code, param1, param2);
       }
   
  -    public ErrorMsg getErrorMsg() {
  -        return _error;
  -    }
  -
       public String toString() {
   	String result;
   
  
  
  
  1.9.2.1   +1 -12     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/Util.java
  
  Index: Util.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/Util.java,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  --- Util.java	25 Jun 2002 17:05:38 -0000	1.9
  +++ Util.java	14 Aug 2002 19:21:40 -0000	1.9.2.1
  @@ -66,7 +66,6 @@
   import org.apache.bcel.generic.Type;
   import org.apache.bcel.generic.*;
   import org.apache.xalan.xsltc.compiler.Parser;
  -import org.apache.xalan.xsltc.compiler.Constants;
   
   public final class Util {
       static public char filesep;
  @@ -187,15 +186,5 @@
   	    new String[] { "$dot$", "$dash$", "$slash$", "$colon$" });
       }
   
  -    public static String getLocalName(String qname) {
  -	final int index = qname.lastIndexOf(":");
  -	return (index > 0) ? qname.substring(index + 1) : qname;
  -    }
  -
  -    public static String getPrefix(String qname) {
  -	final int index = qname.lastIndexOf(":");
  -	return (index > 0) ? qname.substring(0, index) : 
  -	    Constants.EMPTYSTRING;
  -    }
   }
   
  
  
  
  1.3.8.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/VoidType.java
  
  Index: VoidType.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/VoidType.java,v
  retrieving revision 1.3
  retrieving revision 1.3.8.1
  diff -u -r1.3 -r1.3.8.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.7.2.1   +3 -8      xml-xalan/java/src/org/apache/xalan/xsltc/dom/AbsoluteIterator.java
  
  Index: AbsoluteIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/AbsoluteIterator.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- AbsoluteIterator.java	25 Jul 2002 11:45:28 -0000	1.7
  +++ AbsoluteIterator.java	14 Aug 2002 19:21:41 -0000	1.7.2.1
  @@ -83,16 +83,11 @@
   	_source.setRestartable(isRestartable);
       }
   	
  -    int _mask = -1;
  -
       public NodeIterator setStartNode(int node) {
  -	if (_mask == -1) {
  -            _mask = node & 0xFF000000;
  -        }
  -	_startNode = _mask | DOM.ROOTNODE;
  +	_startNode = DOM.ROOTNODE;
   	if (_isRestartable) {
   	    resetPosition();
  -	    return _source.setStartNode(_startNode = _mask | DOM.ROOTNODE);
  +	    return _source.setStartNode(_startNode = DOM.ROOTNODE);
   	}
   	return reset();
       }
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/AnyNodeCounter.java
  
  Index: AnyNodeCounter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/AnyNodeCounter.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.3.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/Axis.java
  
  Index: Axis.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/Axis.java,v
  retrieving revision 1.3
  retrieving revision 1.3.12.1
  diff -u -r1.3 -r1.3.12.1
  
  
  
  1.4.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/BitArray.java
  
  Index: BitArray.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/BitArray.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/CurrentNodeListFilter.java
  
  Index: CurrentNodeListFilter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/CurrentNodeListFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.8.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/CurrentNodeListIterator.java
  
  Index: CurrentNodeListIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/CurrentNodeListIterator.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOM.java.Palm
  
  Index: DOM.java.Palm
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOM.java.Palm,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.13.2.1  +20 -27    xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMAdapter.java
  
  Index: DOMAdapter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMAdapter.java,v
  retrieving revision 1.13
  retrieving revision 1.13.2.1
  diff -u -r1.13 -r1.13.2.1
  --- DOMAdapter.java	21 Jun 2002 15:36:01 -0000	1.13
  +++ DOMAdapter.java	14 Aug 2002 19:21:42 -0000	1.13.2.1
  @@ -73,7 +73,6 @@
   import org.apache.xalan.xsltc.TransletException;
   
   public final class DOMAdapter implements DOM {
  -
       private final DOMImpl _domImpl;
       private short[] _mapping;
       private short[] _reverse;
  @@ -86,8 +85,7 @@
       
       public DOMAdapter(DOMImpl dom,
   		      String[] namesArray,
  -		      String[] namespaceArray) 
  -    {
  +		      String[] namespaceArray) {
   	_domImpl = dom;
   	_mapping = dom.getMapping(namesArray);
   	_reverse = dom.getReverseMapping(namesArray);
  @@ -102,9 +100,7 @@
   	_NSreverse = _domImpl.getReverseNamespaceMapping(namespaces);
       }
   
  -    /** 
  -      * Returns singleton iterator containg the document root 
  -      */
  +    /** returns singleton iterator containg the document root */
       public NodeIterator getIterator() {
   	return _domImpl.getIterator();
       }
  @@ -128,11 +124,11 @@
       public NodeIterator getChildren(final int node) {
   	NodeIterator iterator = _domImpl.getChildren(node);
   	if (_filter == null) {
  -	    return iterator.setStartNode(node);
  +	    return(iterator.setStartNode(node));
   	}
   	else {
  -	    iterator = _domImpl.strippingIterator(iterator, _mapping, _filter);
  -	    return iterator.setStartNode(node);
  +	    iterator = _domImpl.strippingIterator(iterator,_mapping,_filter);
  +	    return(iterator.setStartNode(node));
   	}
       }
   
  @@ -142,10 +138,9 @@
       
       public NodeIterator getTypedChildren(final int type) {
   	NodeIterator iterator = _domImpl.getTypedChildren(_reverse[type]);
  -	if (_reverse[type] == DOM.TEXT && _filter != null) {
  -	    return _domImpl.strippingIterator(iterator,_mapping,_filter);
  -	}
  -	return iterator;
  +	if ((_reverse[type] == DOM.TEXT) && (_filter != null))
  +	    iterator = _domImpl.strippingIterator(iterator,_mapping,_filter);
  +	return(iterator);
       }
   
       public NodeIterator getNamespaceAxisIterator(final int axis, final int ns) {
  @@ -155,27 +150,26 @@
       public NodeIterator getAxisIterator(final int axis) {
   	NodeIterator iterator = _domImpl.getAxisIterator(axis);
   	if (_filter != null) {
  -	    return _domImpl.strippingIterator(iterator, _mapping, _filter);
  +	    iterator = _domImpl.strippingIterator(iterator,_mapping,_filter);
   	}
  -	return iterator;
  +	return(iterator);
       }
       
       public NodeIterator getTypedAxisIterator(final int axis, final int type) {
   	NodeIterator iterator;
   
   	if (axis == Axis.NAMESPACE) {
  -	    iterator = (type == NO_TYPE || type > _NSreverse.length) ?
  -		_domImpl.getAxisIterator(axis) :
  -		_domImpl.getTypedAxisIterator(axis,_NSreverse[type]);
  +	    if ((type == NO_TYPE) || (type > _NSreverse.length))
  +		iterator = _domImpl.getAxisIterator(axis);
  +	    else
  +		iterator = _domImpl.getTypedAxisIterator(axis,_NSreverse[type]);
   	}
  -	else {
  +	else
   	    iterator = _domImpl.getTypedAxisIterator(axis, _reverse[type]);
  -	}
   	
  -	if (_reverse[type] == DOM.TEXT && _filter != null) {
  -	    iterator = _domImpl.strippingIterator(iterator, _mapping, _filter);
  -	}
  -	return iterator;
  +	if ((_reverse[type] == DOM.TEXT) && (_filter != null))
  +	    iterator = _domImpl.strippingIterator(iterator,_mapping,_filter);
  +	return(iterator);
       }
   
       public NodeIterator getNthDescendant(int type, int n, boolean includeself) {
  @@ -183,8 +177,7 @@
       }
   
       public NodeIterator getNodeValueIterator(NodeIterator iterator, int type,
  -					     String value, boolean op) 
  -    {
  +					     String value, boolean op) {
   	return _domImpl.getNodeValueIterator(iterator, type, value, op);
       }
   
  
  
  
  1.3.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMBuilder.java
  
  Index: DOMBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMBuilder.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  
  
  
  1.78.2.1  +14 -25    xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMImpl.java
  
  Index: DOMImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMImpl.java,v
  retrieving revision 1.78
  retrieving revision 1.78.2.1
  diff -u -r1.78 -r1.78.2.1
  --- DOMImpl.java	28 Jun 2002 17:18:53 -0000	1.78
  +++ DOMImpl.java	14 Aug 2002 19:21:42 -0000	1.78.2.1
  @@ -1411,15 +1411,12 @@
   	public NodeIterator setStartNode(int node) {
   	    if (_isRestartable) {
   		_last = -1;
  -		if (_includeSelf) {
  -		    _startNode = node;
  -		}
  -		else if (node >= _firstAttributeNode) {
  +		if (node >= _firstAttributeNode)
   		    _startNode = node = _parent[node];
  -		}
  -		else {
  +		else if (_includeSelf)
  +		    _startNode = node;
  +		else
   		    _startNode = _parent[node];
  -		}
   		_index = _startNode;
   		return resetPosition();
   	    }
  @@ -2701,8 +2698,8 @@
        * Performs a shallow copy (ref. XSLs copy())
        */
       public String shallowCopy(final int node, TransletOutputHandler handler)
  -	throws TransletException 
  -    {
  +	throws TransletException {
  +
   	final int type = _type[node];
   
   	switch(type) {
  @@ -2746,40 +2743,32 @@
   
       private String copyElement(int node, int type,
   			       TransletOutputHandler handler)
  -	throws TransletException 
  -    {
  +	throws TransletException {
  +
   	type = type - NTYPES;
   	String name = _namesArray[type];
   	final int pi = _prefix[node];
   	final int ui = _namespace[type];
  -
   	if (pi > 0) {
   	    final String prefix = _prefixArray[pi];
   	    final String uri = _uriArray[ui];
   	    final String local = getLocalName(node);
  -
  -	    name = prefix.equals(EMPTYSTRING) ? local : (prefix + ':' + local);
  +	    if (prefix.equals(EMPTYSTRING))
  +		name = local;
  +	    else
  +		name = prefix+':'+local;
   	    handler.startElement(name);
   	    handler.namespace(prefix, uri);
   	}
   	else {
   	    if (ui > 0) {
  -		handler.startElement(name = getLocalName(node));
  +		handler.startElement(getLocalName(node));
   		handler.namespace(EMPTYSTRING, _uriArray[ui]);
   	    }
   	    else {
   		handler.startElement(name);
   	    }
   	}
  -
  -	// Copy element namespaces
  -	for (int a = _lengthOrAttr[node]; a != NULL; a = _nextSibling[a]) {
  -	    if (_type[a] == NAMESPACE) {
  -		handler.namespace(_prefixArray[_prefix[a]],
  -				  makeStringValue(a));
  -	    }
  -	}
  -
   	return name;
       }
   
  
  
  
  1.7.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/DTDMonitor.java
  
  Index: DTDMonitor.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DTDMonitor.java,v
  retrieving revision 1.7
  retrieving revision 1.7.12.1
  diff -u -r1.7 -r1.7.12.1
  
  
  
  1.6.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/DocumentCache.java
  
  Index: DocumentCache.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DocumentCache.java,v
  retrieving revision 1.6
  retrieving revision 1.6.12.1
  diff -u -r1.6 -r1.6.12.1
  
  
  
  1.8.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java
  
  Index: DupFilterIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java,v
  retrieving revision 1.8
  retrieving revision 1.8.12.1
  diff -u -r1.8 -r1.8.12.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/EmptyFilter.java
  
  Index: EmptyFilter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/EmptyFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.2.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/ExtendedSAX.java
  
  Index: ExtendedSAX.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/ExtendedSAX.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/Filter.java
  
  Index: Filter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/Filter.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.4.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/FilterIterator.java
  
  Index: FilterIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/FilterIterator.java,v
  retrieving revision 1.4
  retrieving revision 1.4.12.1
  diff -u -r1.4 -r1.4.12.1
  
  
  
  1.5.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/FilteredStepIterator.java
  
  Index: FilteredStepIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/FilteredStepIterator.java,v
  retrieving revision 1.5
  retrieving revision 1.5.12.1
  diff -u -r1.5 -r1.5.12.1
  
  
  
  1.7.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/KeyIndex.java
  
  Index: KeyIndex.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/KeyIndex.java,v
  retrieving revision 1.7
  retrieving revision 1.7.12.1
  diff -u -r1.7 -r1.7.12.1
  
  
  
  1.12.2.1  +14 -23    xml-xalan/java/src/org/apache/xalan/xsltc/dom/LoadDocument.java
  
  Index: LoadDocument.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/LoadDocument.java,v
  retrieving revision 1.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  --- LoadDocument.java	12 Aug 2002 19:31:32 -0000	1.12
  +++ LoadDocument.java	14 Aug 2002 19:21:42 -0000	1.12.2.1
  @@ -62,9 +62,8 @@
   
   package org.apache.xalan.xsltc.dom;
   
  -import java.net.URL;
   import java.io.File;
  -import java.io.FileNotFoundException;
  +import java.net.URL;
   
   import javax.xml.parsers.SAXParser;
   import javax.xml.parsers.SAXParserFactory;
  @@ -91,24 +90,22 @@
        */
       public static NodeIterator document(String uri, String base,
   					AbstractTranslet translet, DOM dom)
  -	throws Exception 
  -    {
  -	final String originalUri = uri;
  +	throws Exception {
  +
   	MultiDOM multiplexer = (MultiDOM)dom;
   
   	// Return an empty iterator if the URI is clearly invalid
   	// (to prevent some unncessary MalformedURL exceptions).
  -	if (uri == null || uri.equals("")) {
  -	    return new SingletonIterator(DOM.NULL,true);
  -	}
  +	if ((uri == null) || (uri.equals("")))
  +	    return(new SingletonIterator(DOM.NULL,true));
   
   	// Prepend URI base to URI (from context)
  -	if (base != null && !base.equals("")) {
  -	    if (!uri.startsWith(base)     &&   // unless URI contains base
  -		!uri.startsWith("/")      &&   // unless URI is abs. file path
  -		!uri.startsWith("http:/") &&   // unless URI is abs. http URL
  -		!uri.startsWith("file:/")) {   // unless URI is abs. file URL
  -		uri = base + uri;
  +	if ((base != null) && (!base.equals(""))) {
  +	    if ((!uri.startsWith(base)) &&     // unless URI contains base
  +		(!uri.startsWith("/")) &&      // unless URI is abs. file path
  +		(!uri.startsWith("http:/")) && // unless URI is abs. http URL
  +		(!uri.startsWith("file:/"))) { // unless URI is abs. file URL
  +		uri = base+uri;
   	    }
   	}
   
  @@ -131,11 +128,7 @@
   	mask = multiplexer.nextMask(); // peek
   
   	if (cache != null) {
  -	    newdom = cache.retrieveDocument(originalUri, mask, translet);
  -	    if (newdom == null) {
  -		final Exception e = new FileNotFoundException(originalUri);
  -		throw new TransletException(e);
  -	    }
  +	    newdom = cache.retrieveDocument(uri, mask, translet);
   	}
   	else {
   	    // Parse the input document and construct DOM object
  @@ -254,10 +247,8 @@
   		throw new IllegalArgumentException(err);
   	    }
   	}
  -	catch (TransletException e) {
  -	    throw e;
  -	}
   	catch (Exception e) {
  +	    e.printStackTrace();
   	    throw new TransletException(e);
   	}
       }
  
  
  
  1.6.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/MatchingIterator.java
  
  Index: MatchingIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/MatchingIterator.java,v
  retrieving revision 1.6
  retrieving revision 1.6.12.1
  diff -u -r1.6 -r1.6.12.1
  
  
  
  1.20.2.1  +20 -23    xml-xalan/java/src/org/apache/xalan/xsltc/dom/MultiDOM.java
  
  Index: MultiDOM.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/MultiDOM.java,v
  retrieving revision 1.20
  retrieving revision 1.20.2.1
  diff -u -r1.20 -r1.20.2.1
  --- MultiDOM.java	21 Jun 2002 19:15:34 -0000	1.20
  +++ MultiDOM.java	14 Aug 2002 19:21:42 -0000	1.20.2.1
  @@ -76,7 +76,6 @@
   import org.apache.xalan.xsltc.runtime.BasisLibrary;
   
   public final class MultiDOM implements DOM {
  -
       private static final int NO_TYPE = DOM.FIRST_TYPE - 2;
       private static final int INITIAL_SIZE = 4;
       private static final int CLR = 0x00FFFFFF;
  @@ -89,11 +88,12 @@
       private Hashtable _documents = new Hashtable();
   
       private final class AxisIterator implements NodeIterator {
  +	// constitutive data
   	private final int _axis;
   	private final int _type;
  -
  +	// implementation mechanism
  +	private NodeIterator _source;
   	private int _mask;
  -	private NodeIterator _source = null;
   	
   	public AxisIterator(final int axis, final int type) {
   	    _axis = axis;
  @@ -112,23 +112,19 @@
   	}
   
   	public NodeIterator setStartNode(final int node) {
  -	    final int dom = node >>> 24;
  -	    final int mask = node & SET;
  +	    _mask = node & SET;
  +	    int dom = node >>> 24;
   
  -	    // Get a new source first time and when mask changes
  -	    if (_source == null || _mask != mask) {
  -		if (_type == NO_TYPE) {
  -		    _source = _adapters[dom].getAxisIterator(_axis);
  -		}
  -		else if (_axis == Axis.CHILD && _type != ELEMENT) {
  -		    _source = _adapters[dom].getTypedChildren(_type);
  -		}
  -		else {
  -		    _source = _adapters[dom].getTypedAxisIterator(_axis, _type);
  -		}
  +	    // consider caching these
  +	    if ((_type == NO_TYPE) || (_type == DOM.ELEMENT)) {
  +		_source = _adapters[dom].getAxisIterator(_axis);
  +	    }
  +	    else if (_axis == Axis.CHILD) {
  +		_source = _adapters[dom].getTypedChildren(_type);
  +	    }
  +	    else {
  +		_source = _adapters[dom].getTypedAxisIterator(_axis,_type);
   	    }
  -
  -	    _mask = mask;
   	    _source.setStartNode(node & CLR);
   	    return this;
   	}
  @@ -147,7 +143,10 @@
   	}
       
   	public boolean isReverse() {
  -	    return (_source == null) ? false : _source.isReverse();
  +	    if (_source == null)
  +		return(false);
  +	    else
  +		return _source.isReverse();
   	}
       
   	public void setMark() {
  @@ -291,9 +290,7 @@
   	    return((domIdx.intValue() << 24));
       }
   
  -    /** 
  -      * Returns singleton iterator containg the document root 
  -      */
  +    /** returns singleton iterator containg the document root */
       public NodeIterator getIterator() {
   	// main source document @ 0
   	return _adapters[0].getIterator();
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/MultipleNodeCounter.java
  
  Index: MultipleNodeCounter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/MultipleNodeCounter.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.6.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/NodeCounter.java
  
  Index: NodeCounter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/NodeCounter.java,v
  retrieving revision 1.6
  retrieving revision 1.6.12.1
  diff -u -r1.6 -r1.6.12.1
  
  
  
  1.7.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/NodeIteratorBase.java
  
  Index: NodeIteratorBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/NodeIteratorBase.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  
  
  
  1.8.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
  
  Index: NodeSortRecord.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/NodeSortRecord.java,v
  retrieving revision 1.8
  retrieving revision 1.8.12.1
  diff -u -r1.8 -r1.8.12.1
  
  
  
  1.7.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
  
  Index: NodeSortRecordFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.7.12.1
  diff -u -r1.7 -r1.7.12.1
  
  
  
  1.9.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/NthIterator.java
  
  Index: NthIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/NthIterator.java,v
  retrieving revision 1.9
  retrieving revision 1.9.12.1
  diff -u -r1.9 -r1.9.12.1
  
  
  
  1.3.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/ReverseIterator.java
  
  Index: ReverseIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/ReverseIterator.java,v
  retrieving revision 1.3
  retrieving revision 1.3.12.1
  diff -u -r1.3 -r1.3.12.1
  
  
  
  1.2.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/SingleNodeCounter.java
  
  Index: SingleNodeCounter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/SingleNodeCounter.java,v
  retrieving revision 1.2
  retrieving revision 1.2.12.1
  diff -u -r1.2 -r1.2.12.1
  
  
  
  1.2.14.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/SingletonIterator.java
  
  Index: SingletonIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/SingletonIterator.java,v
  retrieving revision 1.2
  retrieving revision 1.2.14.1
  diff -u -r1.2 -r1.2.14.1
  
  
  
  1.3.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/SortingIterator.java
  
  Index: SortingIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/SortingIterator.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  
  
  
  1.12.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/StepIterator.java
  
  Index: StepIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/StepIterator.java,v
  retrieving revision 1.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/StripWhitespaceFilter.java
  
  Index: StripWhitespaceFilter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/StripWhitespaceFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.12.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/UnionIterator.java
  
  Index: UnionIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/UnionIterator.java,v
  retrieving revision 1.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.42.2.1  +1 -9      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
  
  Index: AbstractTranslet.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java,v
  retrieving revision 1.42
  retrieving revision 1.42.2.1
  diff -u -r1.42 -r1.42.2.1
  --- AbstractTranslet.java	25 Jul 2002 11:45:28 -0000	1.42
  +++ AbstractTranslet.java	14 Aug 2002 19:21:44 -0000	1.42.2.1
  @@ -615,12 +615,4 @@
   	if (_auxClasses == null) return null;
   	return((Class)_auxClasses.get(className));
       }
  -
  -    // GTM added (see pg 110)
  -    public String[] getNamesArray() {
  -	return namesArray;
  -    }
  -    public String[] getNamespaceArray() {
  -	return namespaceArray;
  -    }
   }
  
  
  
  1.4.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/AttributeList.java
  
  Index: AttributeList.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/AttributeList.java,v
  retrieving revision 1.4
  retrieving revision 1.4.16.1
  diff -u -r1.4 -r1.4.16.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/Attributes.java
  
  Index: Attributes.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/Attributes.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.45.2.1  +8 -160    xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
  
  Index: BasisLibrary.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java,v
  retrieving revision 1.45
  retrieving revision 1.45.2.1
  diff -u -r1.45 -r1.45.2.1
  --- BasisLibrary.java	12 Aug 2002 19:22:21 -0000	1.45
  +++ BasisLibrary.java	14 Aug 2002 19:21:44 -0000	1.45.2.1
  @@ -69,7 +69,6 @@
   import java.util.Locale;
   import java.util.ResourceBundle;
   
  -import java.text.NumberFormat;
   import java.text.MessageFormat;
   import java.text.FieldPosition;
   import java.text.DecimalFormat;
  @@ -86,16 +85,6 @@
   import org.apache.xalan.xsltc.dom.AbsoluteIterator;
   import org.apache.xalan.xsltc.dom.SingletonIterator;
   
  -import org.apache.xalan.xsltc.dom.DOMImpl;
  -import org.apache.xalan.xsltc.dom.DOMBuilder;
  -import org.apache.xalan.xsltc.dom.StepIterator;
  -import org.w3c.dom.NodeList;
  -import org.w3c.dom.DOMException;
  -import org.w3c.dom.Document;
  -import javax.xml.parsers.DocumentBuilderFactory; 
  -import javax.xml.parsers.DocumentBuilder; 
  -import org.apache.xalan.xsltc.trax.DOM2SAX;
  -
   /**
    * Standard XSLT functions. All standard functions expect the current node 
    * and the DOM as their last two arguments.
  @@ -465,20 +454,10 @@
       /**
        * Implements the nodeset() extension function. 
        */
  -    public static NodeIterator nodesetF(Object obj) {
  -	if (obj instanceof DOM) {
  -	   final DOMAdapter adapter = (DOMAdapter) obj;
  -	   return new SingletonIterator(
  -		  DOM.ROOTNODE | adapter.getMultiDOMMask(), true);
  -	}
  -        else if (obj instanceof NodeIterator) {
  -	   return (NodeIterator) obj;
  -        }
  -        else {
  -	    final String className = obj.getClass().getName();
  -	    runTimeError(DATA_CONVERSION_ERR, "node-set", className);
  -	    return null;
  -        }
  +    public static NodeIterator nodesetF(DOM rtf) {
  +	final DOMAdapter adapter = (DOMAdapter) rtf;
  +	return new SingletonIterator(
  +	    DOM.ROOTNODE | adapter.getMultiDOMMask(), true);
       }
   
       //-- Begin utility functions
  @@ -832,7 +811,7 @@
       private static boolean hasSimpleType(Object obj) {
   	return obj instanceof Boolean || obj instanceof Double ||
   	    obj instanceof Integer || obj instanceof String ||
  -	    obj instanceof Node || obj instanceof DOM; 
  +	    obj instanceof Node;
       }
   
       /**
  @@ -865,9 +844,7 @@
       private static String defaultPattern = "";
   
       static {
  -	NumberFormat f = NumberFormat.getInstance(Locale.getDefault());
  -	defaultFormatter = (f instanceof DecimalFormat) ?
  -	    (DecimalFormat) f : new DecimalFormat();
  +	defaultFormatter = new DecimalFormat();
   	defaultFormatter.setGroupingUsed(false);
       }
   
  @@ -912,9 +889,7 @@
   				      DecimalFormat formatter) {
   	try {
   	    StringBuffer result = new StringBuffer();
  -	    if (pattern != defaultPattern) {
  -		formatter.applyLocalizedPattern(pattern);
  -	    }
  +	    formatter.applyLocalizedPattern(pattern);
   
   	    //------------------------------------------------------
    	    // bug fix # 9179 - make sure localized pattern contains
  @@ -967,133 +942,6 @@
   	    runTimeError(DATA_CONVERSION_ERR, "reference", className);
   	    return null;
   	}
  -    }
  -
  -    /**
  -     * Utility function used to convert a w3c NodeList into a internal
  -     * DOM iterator. 
  -     */
  -    public static NodeIterator nodeList2Iterator(org.w3c.dom.NodeList nodeList,
  -	Translet translet, DOM dom) 
  -    {
  -	int size = nodeList.getLength();
  -
  -	// w3c NodeList -> w3c DOM
  -	DocumentBuilderFactory dfac = DocumentBuilderFactory.newInstance();
  -	DocumentBuilder docbldr = null;
  -	try {
  -	    docbldr = dfac.newDocumentBuilder();
  -	} catch (javax.xml.parsers.ParserConfigurationException e) {
  -	    runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage());
  -            return null;
  -
  -	}
  -	// create new w3c DOM
  -	Document doc = docbldr.newDocument();	
  -        org.w3c.dom.Node topElementNode = 
  -            doc.appendChild(doc.createElementNS("", "__top__"));
  -
  -	// copy Nodes from NodeList into new w3c DOM
  -	for (int i=0; i<size; i++){
  -	    org.w3c.dom.Node curr = nodeList.item(i);
  -	    int nodeType = curr.getNodeType();
  -	    if (nodeType == org.w3c.dom.Node.DOCUMENT_NODE) {
  -		// ignore the root node of node list
  -		continue;
  -	    }
  -	    String value = null;
  -	    try {
  -	        value = curr.getNodeValue();
  -	    } catch (DOMException ex) {
  -		runTimeError(RUN_TIME_INTERNAL_ERR, ex.getMessage());
  -                return null;
  -	    }
  -	    String namespaceURI = curr.getNamespaceURI();
  -	    String nodeName = curr.getNodeName();
  -	    org.w3c.dom.Node newNode = null; 
  -	    switch (nodeType){
  -		case org.w3c.dom.Node.ATTRIBUTE_NODE: 
  -		     newNode = doc.createAttributeNS(namespaceURI,
  -			nodeName);
  -                     break;
  -		case org.w3c.dom.Node.CDATA_SECTION_NODE: 
  -		     newNode = doc.createCDATASection(value);
  -                     break;
  -		case org.w3c.dom.Node.COMMENT_NODE: 
  -		     newNode = doc.createComment(value);
  -                     break;
  -		case org.w3c.dom.Node.DOCUMENT_FRAGMENT_NODE: 
  -		     newNode = doc.createDocumentFragment();
  -                     break;
  -		case org.w3c.dom.Node.DOCUMENT_TYPE_NODE: 
  -		     // nothing ?
  -                     break;
  -		case org.w3c.dom.Node.ELEMENT_NODE: 
  -		     newNode = doc.createElementNS(namespaceURI, nodeName);
  -		     break;
  -		case org.w3c.dom.Node.ENTITY_NODE: 
  -		     // nothing ? 
  -                     break;
  -		case org.w3c.dom.Node.ENTITY_REFERENCE_NODE: 
  -		     newNode = doc.createEntityReference(nodeName);
  -		     break;
  -		case org.w3c.dom.Node.NOTATION_NODE: 
  -		     // nothing ? 
  -		     break;
  -		case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 
  -		     newNode = doc.createProcessingInstruction(nodeName,
  -			value);
  -		     break;
  -		case org.w3c.dom.Node.TEXT_NODE: 
  -		     newNode = doc.createTextNode(value);
  -		     break;
  -	    }
  -	    try {
  -	        topElementNode.appendChild(newNode);
  -	    } catch (DOMException e) {
  -		runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage());
  -		return null;
  -	    }
  -	}
  -	// w3c DOM -> DOM2SAX -> DOMBuilder -> DOMImpl
  -	DOMImpl idom = new DOMImpl();
  -	final DOM2SAX dom2sax = new DOM2SAX(doc);
  -	final DOMBuilder domBuilder = idom.getBuilder();
  -	dom2sax.setContentHandler(domBuilder);
  -	try {
  -	    dom2sax.parse(); 
  -	} 
  -        catch (java.io.IOException e){
  -	    runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage());
  -            return null;
  -	}
  -        catch (org.xml.sax.SAXException e){
  -	    runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage());
  -            return null;
  -	}
  -	
  -
  -	if (dom instanceof MultiDOM) {
  -            final MultiDOM multiDOM = (MultiDOM) dom;
  -
  -	    // Create DOMAdapter and register with MultiDOM
  -	    DOMAdapter domAdapter = new DOMAdapter(idom, 
  -                translet.getNamesArray(),
  -		translet.getNamespaceArray());
  -            multiDOM.addDOMAdapter(domAdapter);
  -
  -	    NodeIterator iter1 = multiDOM.getAxisIterator(Axis.CHILD);
  -	    NodeIterator iter2 = multiDOM.getAxisIterator(Axis.CHILD);
  -            NodeIterator iter = new AbsoluteIterator(
  -                new StepIterator(iter1, iter2));
  -
  - 	    iter.setStartNode(DOM.ROOTNODE | domAdapter.getMultiDOMMask());
  -	    return iter;
  -	}
  -        else {
  -	    runTimeError(RUN_TIME_INTERNAL_ERR, "nodeList2Iterator()");
  -	    return null;
  -        }
       }
   
       /**
  
  
  
  1.4.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/Constants.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  
  
  
  1.26.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/DefaultSAXOutputHandler.java
  
  Index: DefaultSAXOutputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/DefaultSAXOutputHandler.java,v
  retrieving revision 1.26
  retrieving revision 1.26.2.1
  diff -u -r1.26 -r1.26.2.1
  
  
  
  1.1.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/ErrorMessages.java
  
  Index: ErrorMessages.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/ErrorMessages.java,v
  retrieving revision 1.1
  retrieving revision 1.1.12.1
  diff -u -r1.1 -r1.1.12.1
  
  
  
  1.1.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/ErrorMessages_no.java
  
  Index: ErrorMessages_no.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/ErrorMessages_no.java,v
  retrieving revision 1.1
  retrieving revision 1.1.12.1
  diff -u -r1.1 -r1.1.12.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/Hashtable.java
  
  Index: Hashtable.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/Hashtable.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/MessageHandler.java
  
  Index: MessageHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/MessageHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/Node.java
  
  Index: Node.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/Node.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.1.16.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/Operators.java
  
  Index: Operators.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/Operators.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  
  1.2.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/Parameter.java
  
  Index: Parameter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/Parameter.java,v
  retrieving revision 1.2
  retrieving revision 1.2.12.1
  diff -u -r1.2 -r1.2.12.1
  
  
  
  1.14.2.1  +1 -3      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/SAXAdapter.java
  
  Index: SAXAdapter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/SAXAdapter.java,v
  retrieving revision 1.14
  retrieving revision 1.14.2.1
  diff -u -r1.14 -r1.14.2.1
  --- SAXAdapter.java	12 Aug 2002 19:33:55 -0000	1.14
  +++ SAXAdapter.java	14 Aug 2002 19:21:44 -0000	1.14.2.1
  @@ -186,8 +186,6 @@
       }
   
       // The SAX handler does not handle these:
  -    public void startCDATA() throws TransletException {}
  -    public void endCDATA() throws TransletException {}
       public void setType(int type) {}
       public void setHeader(String header) {}
       public void setIndent(boolean indent) {}
  
  
  
  1.5.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/StringValueHandler.java
  
  Index: StringValueHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/StringValueHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  
  
  
  1.58.2.1  +1 -9      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/TextOutput.java
  
  Index: TextOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/TextOutput.java,v
  retrieving revision 1.58
  retrieving revision 1.58.2.1
  diff -u -r1.58 -r1.58.2.1
  --- TextOutput.java	12 Aug 2002 19:33:55 -0000	1.58
  +++ TextOutput.java	14 Aug 2002 19:21:44 -0000	1.58.2.1
  @@ -384,14 +384,6 @@
   	_cdataTagOpen = false;
       }
   
  -    public void startCDATA() throws TransletException {
  -	// This class is deprecated - use runtime.output package
  -    }
  -
  -    public void endCDATA() throws TransletException {
  -	// This class is deprecated - use runtime.output package
  -    }
  -
       /**
        * Send characters to the output document
        */
  
  
  
  1.3.2.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/TransletLoader.java
  
  Index: TransletLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/TransletLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  
  
  
  1.10.2.1  +1 -3      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/TransletOutputBase.java
  
  Index: TransletOutputBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/TransletOutputBase.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- TransletOutputBase.java	12 Aug 2002 19:33:55 -0000	1.10
  +++ TransletOutputBase.java	14 Aug 2002 19:21:44 -0000	1.10.2.1
  @@ -85,8 +85,6 @@
   	throws TransletException {}
       public boolean setEscaping(boolean escape) 
   	throws TransletException { return true; }
  -    public void startCDATA() throws TransletException {}
  -    public void endCDATA() throws TransletException {}
       public String expandQName(String withPrefix) { return(withPrefix); }
       public void setType(int type) {}
       public void setIndent(boolean indent) {}
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.1   +2 -3      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/OutputBase.java
  
  Index: OutputBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/OutputBase.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- OutputBase.java	12 Aug 2002 19:33:55 -0000	1.8
  +++ OutputBase.java	14 Aug 2002 19:21:45 -0000	1.8.2.1
  @@ -288,8 +288,7 @@
           return uri;
       }
   
  -    public void startCDATA() throws TransletException { }
  -    public void endCDATA() throws TransletException { }
  +    // -- Temporary
       public void namespace(String prefix, String uri) throws TransletException { }
       public void setType(int type) { }
       public void setIndent(boolean indent) { }
  
  
  
  1.9.2.1   +19 -17    xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXHTMLOutput.java
  
  Index: SAXHTMLOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXHTMLOutput.java,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  --- SAXHTMLOutput.java	12 Aug 2002 19:25:46 -0000	1.9
  +++ SAXHTMLOutput.java	14 Aug 2002 19:21:45 -0000	1.9.2.1
  @@ -140,7 +140,7 @@
               if (_startTagOpen) {
   		closeStartTag();
   	    }
  -            _saxHandler.endElement(EMPTYSTRING, elementName, elementName);
  +            _saxHandler.endElement(EMPTYSTRING, EMPTYSTRING, elementName);
           } 
   	catch (SAXException e) {
               throw new TransletException(e);
  @@ -151,20 +151,22 @@
       public void attribute(String name, final String value) 
   	throws TransletException
       {
  -	if (_startTagOpen) {
  -	    final String patchedName = patchName(name);
  -	    final String localName = getLocalName(patchedName);
  -	    final int index = _attributes.getIndex(name); 
  -
  -	    if (index >= 0) {
  -		_attributes.setAttribute(index, EMPTYSTRING, localName,
  -			name, "CDATA", value);
  -	    }
  -	    else {
  -		_attributes.addAttribute(EMPTYSTRING, localName,
  +	final String patchedName = patchName(name);
  +	final String localName = getLocalName(patchedName);
  +	final int index = _attributes.getIndex(name); 
  +
  +	if (!_startTagOpen) {
  +            BasisLibrary.runTimeError(BasisLibrary.STRAY_ATTRIBUTE_ERR,name);
  +        }
  +
  +        if (index >= 0) {
  +            _attributes.setAttribute(index, EMPTYSTRING, EMPTYSTRING,
  +                    name, "CDATA", value);
  +        }
  +        else {
  +            _attributes.addAttribute(EMPTYSTRING, EMPTYSTRING,
                   name, "CDATA", value);
  -	    }
  -	}
  +        }
       }
   
       /**
  @@ -192,8 +194,8 @@
               _startTagOpen = false;
   
               // Now is time to send the startElement event
  -            _saxHandler.startElement(EMPTYSTRING, _elementName, 
  -		_elementName, _attributes);
  +            _saxHandler.startElement(null, _elementName, _elementName, 
  +		_attributes);
           }
           catch (SAXException e) {
               throw new TransletException(e);
  
  
  
  1.12.4.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXOutput.java
  
  Index: SAXOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXOutput.java,v
  retrieving revision 1.12
  retrieving revision 1.12.4.1
  diff -u -r1.12 -r1.12.4.1
  
  
  
  1.1.4.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXTextOutput.java
  
  Index: SAXTextOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXTextOutput.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  
  
  
  1.12.2.1  +25 -38    xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXXMLOutput.java
  
  Index: SAXXMLOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXXMLOutput.java,v
  retrieving revision 1.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  --- SAXXMLOutput.java	12 Aug 2002 19:33:55 -0000	1.12
  +++ SAXXMLOutput.java	14 Aug 2002 19:21:45 -0000	1.12.2.1
  @@ -153,24 +153,27 @@
       public void attribute(String name, final String value)
           throws TransletException 
       {
  -	if (_startTagOpen) {
  -	    final String patchedName = patchName(name);
  -	    final String localName = getLocalName(patchedName);
  -	    final String uri = getNamespaceURI(patchedName, false);
  -
  -	    final int index = (localName == null) ?
  -		    _attributes.getIndex(name) :    /* don't use patchedName */
  -		    _attributes.getIndex(uri, localName);
  -
  -	    if (index >= 0) {       // Duplicate attribute?
  -		_attributes.setAttribute(index, uri, localName,
  -		    patchedName, "CDATA", value);
  -	    }
  -	    else {
  -		_attributes.addAttribute(uri, localName, patchedName,
  -		    "CDATA", value);
  -	    }
  +	final String patchedName = patchName(name);
  +        final String localName = getLocalName(patchedName);
  +        final String uri = getNamespaceURI(patchedName, false);
  +
  +        final int index = (localName == null) ?
  +                _attributes.getIndex(name) :    /* don't use patchedName */
  +                _attributes.getIndex(uri, localName);
  +
  +        if (!_startTagOpen) {
  +            BasisLibrary.runTimeError(BasisLibrary.STRAY_ATTRIBUTE_ERR,
  +                patchedName);
  +        }
  +
  +	if (index >= 0) {       // Duplicate attribute?
  +	    _attributes.setAttribute(index, uri, localName,
  +		patchedName, "CDATA", value);
   	}
  +	else {
  +	    _attributes.addAttribute(uri, localName, patchedName,
  +		"CDATA", value);
  +        }
       }
   
       public void characters(char[] ch, int off, int len)
  @@ -327,26 +330,10 @@
           }
       }
   
  -    public void startCDATA() throws TransletException {
  -	try {
  -	    // Output start bracket - "<![CDATA["
  -	    _saxHandler.characters(BEGCDATA, 0, BEGCDATA.length);
  -	    _cdataTagOpen = true;
  -	}
  -	catch (SAXException e) {
  -            throw new TransletException(e);
  -	}
  -    }
  -
  -    public void closeCDATA() throws TransletException {
  -	try {
  -	    // Output closing bracket - "]]>"
  -	    _saxHandler.characters(ENDCDATA, 0, ENDCDATA.length);
  -	    _cdataTagOpen = false;
  -	}
  -	catch (SAXException e) {
  -            throw new TransletException(e);
  -	}
  +    protected void closeCDATA() throws SAXException {
  +        // Output closing bracket - "]]>"
  +        _saxHandler.characters(ENDCDATA, 0, ENDCDATA.length);
  +        _cdataTagOpen = false;
       }
   
       /**
  
  
  
  1.17.2.1  +5 -57     xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamHTMLOutput.java
  
  Index: StreamHTMLOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamHTMLOutput.java,v
  retrieving revision 1.17
  retrieving revision 1.17.2.1
  diff -u -r1.17 -r1.17.2.1
  --- StreamHTMLOutput.java	12 Aug 2002 19:33:55 -0000	1.17
  +++ StreamHTMLOutput.java	14 Aug 2002 19:21:45 -0000	1.17.2.1
  @@ -98,21 +98,19 @@
       public StreamHTMLOutput(StreamOutput output) {
   	super(output);
   	setIndent(true);  // default for HTML
  -// System.out.println("StreamHTMLOutput.<init> this = " + this);
  +// System.out.println("StreamHTMLOutput.<init>");
       }
   
       public StreamHTMLOutput(Writer writer, String encoding) {
   	super(writer, encoding);
  -	setIndent(true);  // default for HTML
  -//System.out.println("StreamHTMLOutput.<init> this = " + this);
  +// System.out.println("StreamHTMLOutput.<init>");
       }
   
       public StreamHTMLOutput(OutputStream out, String encoding) 
   	throws IOException
       {
   	super(out, encoding);
  -	setIndent(true);  // default for HTML
  -//System.out.println("StreamHTMLOutput.<init> this = " + this);
  +// System.out.println("StreamHTMLOutput.<init>");
       }
   
       public void startDocument() throws TransletException { 
  @@ -262,7 +260,7 @@
   	if (_startTagOpen) {
   	    closeStartTag();
   	}
  -	appendComment(comment);
  +	_buffer.append("<!--").append(comment).append("-->");
       }
   
       public void processingInstruction(String target, String data)
  @@ -418,54 +416,4 @@
   	    _headTagOpen = false;
   	}
       } 
  -
  -    /**
  -     * This method escapes special characters used in text nodes
  -     */
  -    protected void escapeCharacters(char[] ch, int off, int len) {
  -	int limit = off + len;
  -	int offset = off;
  -
  -	if (limit > ch.length) {
  -	    limit = ch.length;
  -	}
  -
  -	// Step through characters and escape all special characters
  -	for (int i = off; i < limit; i++) {
  -	    final char current = ch[i];
  -
  -	    switch (current) {
  -	    case '&':
  -		_buffer.append(ch, offset, i - offset).append(AMP);
  -		offset = i + 1;
  -		break;
  -	    case '<':
  -		_buffer.append(ch, offset, i - offset).append(LT);
  -		offset = i + 1;
  -		break;
  -	    case '>':
  -		_buffer.append(ch, offset, i - offset).append(GT);
  -		offset = i + 1;
  -		break;
  -	    case '\u00A0':
  -		_buffer.append(ch, offset, i - offset).append(NBSP);
  -		offset = i + 1;
  -		break;
  -	    default:
  -		if ((current >= '\u007F' && current < '\u00A0') ||
  -		    (_is8859Encoded && current > '\u00FF'))
  -		{
  -		    _buffer.append(ch, offset, i - offset)
  -			   .append(CHAR_ESC_START)
  -			   .append(Integer.toString((int)ch[i]))
  -			   .append(';');
  -		    offset = i + 1;
  -		}
  -	    }
  -	}
  -	// Output remaining characters (that do not need escaping).
  -	if (offset < limit) {
  -	    _buffer.append(ch, offset, limit - offset);
  -	}
  -    }
   }
  
  
  
  1.19.2.1  +53 -45    xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamOutput.java
  
  Index: StreamOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamOutput.java,v
  retrieving revision 1.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- StreamOutput.java	12 Aug 2002 19:33:55 -0000	1.19
  +++ StreamOutput.java	14 Aug 2002 19:21:45 -0000	1.19.2.1
  @@ -79,8 +79,7 @@
       protected static final String LT       = "&lt;";
       protected static final String GT       = "&gt;";
       protected static final String CRLF     = "&#xA;";
  -    protected static final String APOS     = "&apos;";
  -    protected static final String QUOT     = "&quot;";
  +    protected static final String QUOTE    = "&quot;";
       protected static final String NBSP     = "&nbsp;";
   
       protected static final String CHAR_ESC_START  = "&#";
  @@ -89,7 +88,7 @@
       protected static final int MAX_INDENT_LEVEL = (INDENT.length >> 1);
       protected static final int MAX_INDENT       = INDENT.length;
   
  -    protected static final int BUFFER_SIZE = 32 * 1024;
  +    protected static final int BUFFER_SIZE = 64 * 1024;
       protected static final int OUTPUT_BUFFER_SIZE = 4 * 1024;
   
       protected Writer  _writer;
  @@ -109,8 +108,7 @@
       protected boolean _escaping     = true;
       protected String  _encoding     = "UTF-8";
   
  -    protected int     _indentNumber = 2;
  -
  +    // protected HashSet _attributes = new HashSet();
       protected Vector _attributes = new Vector();
   
       static class Attribute {
  @@ -140,7 +138,6 @@
   	_encoding = output._encoding;
   	_is8859Encoded = output._is8859Encoded;
   	_buffer = output._buffer;
  -	_indentNumber = output._indentNumber;
       }
   
       protected StreamOutput(Writer writer, String encoding) {
  @@ -163,10 +160,6 @@
   	_buffer = new StringBuffer(BUFFER_SIZE);
       }
   
  -    public void setIndentNumber(int value) {
  -	_indentNumber = value;
  -    }
  -
       /**
        * Set the output document system/public identifiers
        */
  @@ -238,15 +231,59 @@
   	}
   
   	_buffer.append(INDENT, 0, 
  -	    _indentLevel < MAX_INDENT_LEVEL ? _indentLevel * _indentNumber 
  +	    _indentLevel < MAX_INDENT_LEVEL ? _indentLevel + _indentLevel 
   		: MAX_INDENT);
       }
   
  -    /**
  -     * This method escapes special characters used in text nodes. It
  -     * is overriden for XML and HTML output.
  -     */
       protected void escapeCharacters(char[] ch, int off, int len) {
  +	int limit = off + len;
  +	int offset = off;
  +
  +	if (limit > ch.length) {
  +	    limit = ch.length;
  +	}
  +
  +	// Step through characters and escape all special characters
  +	for (int i = off; i < limit; i++) {
  +	    final char current = ch[i];
  +
  +	    switch (current) {
  +	    case '&':
  +		_buffer.append(ch, offset, i - offset);
  +		_buffer.append(AMP);
  +		offset = i + 1;
  +		break;
  +	    case '<':
  +		_buffer.append(ch, offset, i - offset);
  +		_buffer.append(LT);
  +		offset = i + 1;
  +		break;
  +	    case '>':
  +		_buffer.append(ch, offset, i - offset);
  +		_buffer.append(GT);
  +		offset = i + 1;
  +		break;
  +	    case '\u00a0':
  +		_buffer.append(ch, offset, i - offset);
  +		_buffer.append(NBSP);
  +		offset = i + 1;
  +		break;
  +	    default:
  +		if ((current >= '\u007F' && current < '\u00A0') ||
  +		    (_is8859Encoded && current > '\u00FF'))
  +		{
  +		    _buffer.append(ch, offset, i - offset);
  +		    _buffer.append(CHAR_ESC_START);
  +		    _buffer.append(Integer.toString((int)ch[i]));
  +		    _buffer.append(';');
  +		    offset = i + 1;
  +		}
  +	    }
  +	}
  +	// Output remaining characters (that do not need escaping).
  +	if (offset < limit) {
  +	    _buffer.append(ch, offset, limit - offset);
  +	}
       }
   
       protected void appendAttributes() {
  @@ -269,34 +306,5 @@
   	appendAttributes();
   	_buffer.append('>');
   	_startTagOpen = false;
  -    }
  -
  -    /**
  -     * Ensure that comments do not include the sequence "--" and
  -     * that they do not end with "-".
  -     */
  -    protected void appendComment(String comment) 
  -	throws TransletException 
  -    {
  -	boolean lastIsDash = false;
  -	final int n = comment.length();
  -
  -	_buffer.append("<!--");
  -	for (int i = 0; i < n; i++) {
  -	    final char ch = comment.charAt(i);
  -	    final boolean isDash = (ch == '-');
  -
  -	    if (lastIsDash && isDash) {
  -		_buffer.append(" -");
  -	    }
  -	    else {
  -		_buffer.append(ch);
  -	    }
  -	    lastIsDash = isDash;
  -	}
  -	if (lastIsDash) {
  -	    _buffer.append(' ');
  -	}
  -	_buffer.append("-->");
       }
   }
  
  
  
  1.2.4.1   +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamTextOutput.java
  
  Index: StreamTextOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamTextOutput.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  
  
  
  1.7.4.1   +1 -5      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamUnknownOutput.java
  
  Index: StreamUnknownOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamUnknownOutput.java,v
  retrieving revision 1.7
  retrieving revision 1.7.4.1
  diff -u -r1.7 -r1.7.4.1
  --- StreamUnknownOutput.java	26 Jun 2002 22:55:07 -0000	1.7
  +++ StreamUnknownOutput.java	14 Aug 2002 19:21:45 -0000	1.7.4.1
  @@ -285,10 +285,6 @@
   	_handler.setCdataElements(elements);
       }
   
  -    public void setIndentNumber(int value) {
  -	_handler.setIndentNumber(value);
  -    }
  -
       private void initStreamOutput() 
   	throws TransletException 
       {
  
  
  
  1.19.2.1  +9 -59     xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamXMLOutput.java
  
  Index: StreamXMLOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamXMLOutput.java,v
  retrieving revision 1.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- StreamXMLOutput.java	12 Aug 2002 19:33:55 -0000	1.19
  +++ StreamXMLOutput.java	14 Aug 2002 19:21:45 -0000	1.19.2.1
  @@ -131,7 +131,7 @@
   	    closeStartTag();
   	}
   	else if (_cdataTagOpen) {
  -	    endCDATA();
  +	    closeCDATA();
   	}
   
   	// Handle document type declaration (for first element only)
  @@ -159,7 +159,7 @@
       public void endElement(String elementName) throws TransletException { 
   // System.out.println("endElement = " + elementName);
   	if (_cdataTagOpen) {
  -	    endCDATA();
  +	    closeCDATA();
   	}
   
   	if (_startTagOpen) {
  @@ -248,9 +248,10 @@
   	    closeStartTag();
   	}
   	else if (_cdataTagOpen) {
  -	    endCDATA();
  +	    closeCDATA();
   	}
  -	appendComment(comment);
  +
  +	_buffer.append("<!--").append(comment).append("-->");
       }
   
       public void processingInstruction(String target, String data)
  @@ -261,7 +262,7 @@
   	    closeStartTag();
   	}
   	else if (_cdataTagOpen) {
  -	    endCDATA();
  +	    closeCDATA();
   	}
   
   	_buffer.append("<?").append(target).append(' ')
  @@ -339,12 +340,7 @@
   	_cdataTagOpen = true;
       }
   
  -    public void startCDATA() throws TransletException {
  -	_buffer.append(BEGCDATA);
  -	_cdataTagOpen = true;
  -    }
  -
  -    public void endCDATA() throws TransletException {
  +    private void closeCDATA() {
   	_buffer.append(ENDCDATA);
   	_cdataTagOpen = false;
       }
  @@ -394,7 +390,7 @@
   		offset = i + 1;
   		break;
   	    case '"':
  -		result.append(ch, offset, i - offset).append(QUOT);
  +		result.append(ch, offset, i - offset).append(QUOTE);
   		offset = i + 1;
   		break;
   	    case '<':
  @@ -416,51 +412,5 @@
   	    result.append(ch, offset, limit - offset);
   	}
   	return result.toString();
  -    }
  -
  -    /**
  -     * This method escapes special characters used in text nodes
  -     */
  -    protected void escapeCharacters(char[] ch, int off, int len) {
  -	int limit = off + len;
  -	int offset = off;
  -
  -	if (limit > ch.length) {
  -	    limit = ch.length;
  -	}
  -
  -	// Step through characters and escape all special characters
  -	for (int i = off; i < limit; i++) {
  -	    final char current = ch[i];
  -
  -	    switch (current) {
  -	    case '&':
  -		_buffer.append(ch, offset, i - offset).append(AMP);
  -		offset = i + 1;
  -		break;
  -	    case '<':
  -		_buffer.append(ch, offset, i - offset).append(LT);
  -		offset = i + 1;
  -		break;
  -	    case '>':
  -		_buffer.append(ch, offset, i - offset).append(GT);
  -		offset = i + 1;
  -		break;
  -	    default:
  -		if ((current >= '\u007F' && current < '\u00A0') ||
  -		    (_is8859Encoded && current > '\u00FF'))
  -		{
  -		    _buffer.append(ch, offset, i - offset)
  -			   .append(CHAR_ESC_START)
  -			   .append(Integer.toString((int)ch[i]))
  -			   .append(';');
  -		    offset = i + 1;
  -		}
  -	    }
  -	}
  -	// Output remaining characters (that do not need escaping).
  -	if (offset < limit) {
  -	    _buffer.append(ch, offset, limit - offset);
  -	}
       }
   }
  
  
  
  1.12.4.1  +8 -18     xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/TransletOutputHandlerFactory.java
  
  Index: TransletOutputHandlerFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/TransletOutputHandlerFactory.java,v
  retrieving revision 1.12
  retrieving revision 1.12.4.1
  diff -u -r1.12 -r1.12.4.1
  --- TransletOutputHandlerFactory.java	26 Jun 2002 22:55:07 -0000	1.12
  +++ TransletOutputHandlerFactory.java	14 Aug 2002 19:21:45 -0000	1.12.4.1
  @@ -89,7 +89,6 @@
       private OutputStream _ostream  = System.out;
       private Writer _writer         = null;
       private Node           _node   = null;
  -    private int _indentNumber      = -1;
       private ContentHandler _handler    = null;
       private LexicalHandler _lexHandler = null;
   
  @@ -136,42 +135,33 @@
   	   : null;
       }
   
  -    public void setIndentNumber(int value) {
  -	_indentNumber = value;
  -    }
  -
       public TransletOutputHandler getTransletOutputHandler() 
   	throws IOException, ParserConfigurationException 
       {
   	switch (_outputType) {
   	    case STREAM:
  -		StreamOutput result = null;
  -
   		if (_method == null) {
  -		    result = (_writer == null) ? 
  +		    return (_writer == null) ? 
   			new StreamUnknownOutput(_ostream, _encoding) :
   			new StreamUnknownOutput(_writer, _encoding);
   		}
  -		else if (_method.equalsIgnoreCase("xml")) {
  -		    result = (_writer == null) ? 
  +
  +		if (_method.equalsIgnoreCase("xml")) {
  +		    return (_writer == null) ? 
   			new StreamXMLOutput(_ostream, _encoding) :
   			new StreamXMLOutput(_writer, _encoding);
   		}
   		else if (_method.equalsIgnoreCase("html")) {
  -		    result = (_writer == null) ? 
  +		    return (_writer == null) ? 
   			new StreamHTMLOutput(_ostream, _encoding) :
   			new StreamHTMLOutput(_writer, _encoding);
   		}
   		else if (_method.equalsIgnoreCase("text")) {
  -		    result = (_writer == null) ? 
  +		    return (_writer == null) ? 
   			new StreamTextOutput(_ostream, _encoding) :
   			new StreamTextOutput(_writer, _encoding);
   		}
  -
  -		if (result != null && _indentNumber >= 0) {
  -		    result.setIndentNumber(_indentNumber);
  -		}
  -		return result;
  +	    break;
   	    case DOM:
   		_handler = (_node != null) ? new SAX2DOM(_node) : 
   					     new SAX2DOM();
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.17.2.1  +2 -18     xml-xalan/java/src/org/apache/xalan/xsltc/trax/DOM2SAX.java
  
  Index: DOM2SAX.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/DOM2SAX.java,v
  retrieving revision 1.17
  retrieving revision 1.17.2.1
  diff -u -r1.17 -r1.17.2.1
  --- DOM2SAX.java	12 Aug 2002 19:33:55 -0000	1.17
  +++ DOM2SAX.java	14 Aug 2002 19:21:46 -0000	1.17.2.1
  @@ -89,7 +89,7 @@
   import org.w3c.dom.Entity;
   import org.w3c.dom.Notation;
   
  -public class DOM2SAX implements XMLReader, Locator {
  +class DOM2SAX implements XMLReader, Locator {
   
       private final static String EMPTYSTRING = "";
       private static final String XMLNS_PREFIX = "xmlns";
  @@ -184,22 +184,6 @@
   
       public void parse(InputSource unused) throws IOException, SAXException {
           parse(_dom);
  -    }
  -
  -    public void parse() throws IOException, SAXException {
  -	if (_dom != null) {
  -	    boolean isIncomplete = 
  -		(_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE);
  -
  -	    if (isIncomplete) {
  -		_sax.startDocument();
  -		parse(_dom);
  -		_sax.endDocument();
  -	    }
  -	    else {
  -		parse(_dom);
  -	    }
  -	}
       }
   
       /**
  
  
  
  1.1.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/trax/OutputSettings.java
  
  Index: OutputSettings.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/OutputSettings.java,v
  retrieving revision 1.1
  retrieving revision 1.1.12.1
  diff -u -r1.1 -r1.1.12.1
  
  
  
  1.14.2.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/trax/SAX2DOM.java
  
  Index: SAX2DOM.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/SAX2DOM.java,v
  retrieving revision 1.14
  retrieving revision 1.14.2.1
  diff -u -r1.14 -r1.14.2.1
  
  
  
  1.5.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
  
  Index: SmartTransformerFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.5.12.1
  diff -u -r1.5 -r1.5.12.1
  
  
  
  1.14.2.1  +12 -81    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.14
  retrieving revision 1.14.2.1
  diff -u -r1.14 -r1.14.2.1
  --- TemplatesHandlerImpl.java	12 Aug 2002 19:33:55 -0000	1.14
  +++ TemplatesHandlerImpl.java	14 Aug 2002 19:21:46 -0000	1.14.2.1
  @@ -57,7 +57,6 @@
    * <http://www.apache.org/>.
    *
    * @author Morten Jorgensen
  - * @author Santiago Pericas-Geertsen
    *
    */
   
  @@ -67,48 +66,27 @@
   import javax.xml.transform.sax.*;
   
   import org.xml.sax.Locator;
  -import org.xml.sax.InputSource;
  -
  -import org.apache.xalan.xsltc.compiler.*;
   import org.apache.xalan.xsltc.Translet;
   import org.apache.xalan.xsltc.runtime.AbstractTranslet;
  +import org.apache.xalan.xsltc.compiler.*;
  +import org.apache.xalan.xsltc.compiler.util.Util;
   
   /**
    * Implementation of a JAXP1.1 TemplatesHandler
    */
  -public class TemplatesHandlerImpl extends Parser 
  -    implements TemplatesHandler, SourceLoader 
  -{
  -    /**
  -     * System ID for this stylesheet.
  -     */
  -    private String _systemId;
  -
  -    /**
  -     * Number of spaces to add for output indentation.
  -     */
  -    private int _indentNumber;
  +public class TemplatesHandlerImpl extends Parser implements TemplatesHandler {
   
  -    /**
  -     * This URIResolver is passed to all Transformers.
  -     */
  -    private URIResolver _uriResolver = null;
  +    private String _systemId;
   
  -    /**
  -     * A reference to the transformer factory that this templates
  -     * object belongs to.
  -     */
  -    private TransformerFactoryImpl _tfactory = null;
  +    // Temporary
  +    private boolean _oldOutputSystem;
   
       /**
        * Default constructor
        */
  -    protected TemplatesHandlerImpl(int indentNumber, 
  -	TransformerFactoryImpl tfactory) 
  -    {
  +    protected TemplatesHandlerImpl(boolean oldOutputSystem) {
   	super(null);
  -	_indentNumber = indentNumber;
  -	_tfactory = tfactory;
  +	_oldOutputSystem = oldOutputSystem;
       }
   
       /**
  @@ -145,13 +123,6 @@
       }
   
       /**
  -     * Store URIResolver needed for Transformers.
  -     */
  -    public void setURIResolver(URIResolver resolver) {
  -	_uriResolver = resolver;
  -    }
  -
  -    /**
        * Implements javax.xml.transform.sax.TemplatesHandler.getTemplates()
        * When a TemplatesHandler object is used as a ContentHandler or
        * DocumentHandler for the parsing of transformation instructions, it
  @@ -164,11 +135,6 @@
   	try {
   	    final XSLTC xsltc = getXSLTC();
   
  -	    // Set a document loader (for xsl:include/import) if defined
  -	    if (_uriResolver != null) {
  -		xsltc.setSourceLoader(this);
  -	    }
  -
   	    // Set the translet class name if not already set
   	    String transletName = TransformerFactoryImpl._defaultTransletName;
   	    if (_systemId != null) {
  @@ -189,10 +155,6 @@
   		stylesheet.setSystemId(_systemId);
   		stylesheet.setParentStylesheet(null);
   		setCurrentStylesheet(stylesheet);
  -
  -		// Set it as top-level in the XSLTC object
  -		xsltc.setStylesheet(stylesheet);
  -
   		// Create AST under the Stylesheet element 
   		createAST(stylesheet);
   	    }
  @@ -207,15 +169,8 @@
   		// Check that the transformation went well before returning
   		final byte[][] bytecodes = xsltc.getBytecodes();
   		if (bytecodes != null) {
  -		    final TemplatesImpl templates = 
  -			new TemplatesImpl(xsltc.getBytecodes(), transletName, 
  -			    getOutputProperties(), _indentNumber, _tfactory);
  -
  -		    // Set URIResolver on templates object
  -		    if (_uriResolver != null) {
  -			templates.setURIResolver(_uriResolver);
  -		    }
  -		    return templates;
  +		    return new TemplatesImpl(xsltc.getBytecodes(), transletName, 
  +			 getOutputProperties(), _oldOutputSystem);
   		}
   	    }
   	}
  @@ -226,36 +181,12 @@
       }
   
       /**
  -     * Recieve an object for locating the origin of SAX document events.
  +     * 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. 
        */
       public void setDocumentLocator(Locator locator) {
  -	super.setDocumentLocator(locator);
     	setSystemId(locator.getSystemId());
  -    }
  -
  -    /**
  -     * This method implements XSLTC's SourceLoader interface. It is used to
  -     * glue a TrAX URIResolver to the XSLTC compiler's Input and Import classes.
  -     *
  -     * @param href The URI of the document to load
  -     * @param context The URI of the currently loaded document
  -     * @param xsltc The compiler that resuests the document
  -     * @return An InputSource with the loaded document
  -     */
  -    public InputSource loadSource(String href, String context, XSLTC xsltc) {
  -	try {
  -	    // A _uriResolver must be set if this method is called
  -	    final Source source = _uriResolver.resolve(href, context);
  -	    if (source != null) {
  -		return Util.getInputSource(xsltc, source);
  -	    }
  -	}
  -	catch (TransformerException e) {
  -	    // Falls through
  -	}
  -	return null;
       }
   }
   
  
  
  
  1.21.2.1  +56 -130   xml-xalan/java/src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
  
  Index: TemplatesImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TemplatesImpl.java,v
  retrieving revision 1.21
  retrieving revision 1.21.2.1
  diff -u -r1.21 -r1.21.2.1
  --- TemplatesImpl.java	12 Aug 2002 19:33:55 -0000	1.21
  +++ TemplatesImpl.java	14 Aug 2002 19:21:46 -0000	1.21.2.1
  @@ -82,159 +82,91 @@
   
   public final class TemplatesImpl implements Templates, Serializable {
   
  -    /**
  -     * Name of the superclass of all translets. This is needed to
  -     * determine which, among all classes comprising a translet, 
  -     * is the main one.
  -     */
  -    private static String ABSTRACT_TRANSLET 
  -	= "org.apache.xalan.xsltc.runtime.AbstractTranslet";
  -
  -    /**
  -     * Name of the main class or default name if unknown.
  -     */
  -    private String _name = null;
  +    // Contains the name of the main translet class
  +    private String   _name = null;
   
  -    /**
  -     * Contains the actual class definition for the translet class and
  -     * any auxiliary classes.
  -     */
  +    // Contains the actual class definition for the translet class and
  +    // any auxiliary classes (representing node sort records, predicates, etc.)
       private byte[][] _bytecodes = null;
   
  -    /**
  -     * Contains the translet class definition(s). These are created when 
  -     * this Templates is created or when it is read back from disk.
  -     */
  -    private Class[] _class = null;
  +    // Contains the translet class definition(s). These are created when this
  +    // Templates is first instanciated or read back from disk (see readObject())
  +    private Class[]  _class = null;
   
  -    /**
  -     * The index of the main translet class in the arrays _class[] and
  -     * _bytecodes.
  -     */
  +    // This tells us which index the main translet class has in the _class
  +    // and _bytecodes arrays (above).
       private int _transletIndex = -1;
       
  -    /**
  -     * Output properties of this translet.
  -     */
       private Properties _outputProperties; 
   
  -    /**
  -     * Number of spaces to add for output indentation.
  -     */
  -    private int _indentNumber;
  -
  -    /**
  -     * This URIResolver is passed to all Transformers.
  -     */
  -    private URIResolver _uriResolver = null;
  -
  -    /**
  -     * A reference to the transformer factory that this templates
  -     * object belongs to.
  -     */
  -    private TransformerFactoryImpl _tfactory = null;
  +    // Temporary
  +    private boolean _oldOutputSystem;
   
  +    // Our own private class loader - builds Class definitions from bytecodes
       private class TransletClassLoader extends ClassLoader {
   
   	protected TransletClassLoader(ClassLoader parent){
   	    super(parent);
   	}
  +
   	public Class defineClass(byte[] b) {
   	    return super.defineClass(null, b, 0, b.length);
   	}
       }
   
  -   /**
  -     * The only way to create an XSLTC emplate object
  -     * The bytecodes for the translet and auxiliary classes, plus the name of
  -     * the main translet class, must be supplied
  -     */
  -    protected TemplatesImpl(byte[][] bytecodes, String transletName,
  -	Properties outputProperties, int indentNumber,
  -	TransformerFactoryImpl tfactory) 
  -    {
  -	_bytecodes = bytecodes;
  -	_name      = transletName;
  -	_outputProperties = outputProperties;
  -	_indentNumber = indentNumber;
  -	_tfactory = tfactory;
  -    }
  -
  -    public synchronized void writeExternal(ObjectOutput out) 
  -	throws IOException 
  -    {
  +    public void writeExternal(ObjectOutput out) throws IOException {
   	out.writeObject(_name);
   	out.writeObject(_bytecodes);
   	out.flush();
       }
   
  -    public synchronized void readExternal(ObjectInput in)
  -	throws IOException, ClassNotFoundException 
  -    {
  +    public void readExternal(ObjectInput in)
  +	throws IOException, ClassNotFoundException {
   	_name      = (String)in.readObject();
   	_bytecodes = (byte[][])in.readObject();
   	_class     = null; // must be created again...
       }
   
  -     /**
  -     * Store URIResolver needed for Transformers.
  +    /**
  +     * The only way to create an XSLTC emplate object
  +     * The bytecodes for the translet and auxiliary classes, plus the name of
  +     * the main translet class, must be supplied
        */
  -    public synchronized void setURIResolver(URIResolver resolver) {
  -	_uriResolver = resolver;
  +    protected TemplatesImpl(byte[][] bytecodes, String transletName,
  +	Properties outputProperties, boolean oldOutputSystem) 
  +    {
  +	_bytecodes = bytecodes;
  +	_name      = transletName;
  +	_outputProperties = outputProperties;
  +	_oldOutputSystem = oldOutputSystem;
       }
   
       /**
        * The TransformerFactory must pass us the translet bytecodes using this
        * method before we can create any translet instances
        */
  -    protected synchronized void setTransletBytecodes(byte[][] bytecodes) {
  +    protected void setTransletBytecodes(byte[][] bytecodes) {
   	_bytecodes = bytecodes;
       }
   
       /**
        * Returns the translet bytecodes stored in this template
        */
  -    public synchronized byte[][] getTransletBytecodes() {
  -	return _bytecodes;
  -    }
  -
  -    /**
  -     * Returns the translet bytecodes stored in this template
  -     */
  -    public synchronized Class[] getTransletClasses() {
  -	try {
  -	    if (_class == null) defineTransletClasses();
  -	}
  -	catch (TransformerConfigurationException e) {
  -	    // Falls through
  -	}
  -	return _class;
  -    }
  -
  -    /**
  -     * Returns the index of the main class in array of bytecodes
  -     */
  -    public synchronized int getTransletIndex() {
  -	try {
  -	    if (_class == null) defineTransletClasses();
  -	}
  -	catch (TransformerConfigurationException e) {
  -	    // Falls through
  -	}
  -	return _transletIndex;
  +    protected byte[][] getTransletBytecodes() {
  +	return(_bytecodes);
       }
   
       /**
        * The TransformerFactory should call this method to set the translet name
        */
  -    protected synchronized void setTransletName(String name) {
  +    protected void setTransletName(String name) {
   	_name = name;
       }
   
       /**
        * Returns the name of the main translet class stored in this template
        */
  -    protected synchronized String getTransletName() {
  +    protected String getTransletName() {
   	return _name;
       }
   
  @@ -271,25 +203,22 @@
   
   	    for (int i = 0; i < classCount; i++) {
   		_class[i] = loader.defineClass(_bytecodes[i]);
  -		final Class superClass = _class[i].getSuperclass();
  -
  -		// Check if this is the main class
  -		if (superClass.getName().equals(ABSTRACT_TRANSLET)) {
  +		if (_class[i].getName().equals(_name))
   		    _transletIndex = i;
  -		}
   	    }
   
   	    if (_transletIndex < 0) {
  -		ErrorMsg err= new ErrorMsg(ErrorMsg.NO_MAIN_TRANSLET_ERR, _name);
  +		ErrorMsg err= new ErrorMsg(ErrorMsg.NO_MAIN_TRANSLET_ERR,_name);
   		throw new TransformerConfigurationException(err.toString());
   	    }
   	}
  +
   	catch (ClassFormatError e) {
  -	    ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name);
  +	    ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR+_name);
   	    throw new TransformerConfigurationException(err.toString());
   	}
   	catch (LinkageError e) {
  -	    ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name);
  +	    ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR+_name);
   	    throw new TransformerConfigurationException(err.toString());
   	}
       }
  @@ -306,14 +235,16 @@
   
   	    if (_class == null) defineTransletClasses();
   
  -	    // The translet needs to keep a reference to all its auxiliary 
  -	    // class to prevent the GC from collecting them
  -	    Translet translet = (Translet) _class[_transletIndex].newInstance();
  +	    // The translet needs a reference to all its auxiliary class
  +	    // definitions so that it can instanciate them on the fly. You
  +	    // wouldn't think this is necessary, but it seems like the JVM
  +	    // quickly forgets the classes we define here and the translet
  +	    // needs to know them as long as it exists.
  +	    Translet translet = (Translet)_class[_transletIndex].newInstance();
   	    final int classCount = _bytecodes.length;
   	    for (int i = 0; i < classCount; i++) {
  -		if (i != _transletIndex) {
  +		if (i != _transletIndex)
   		    translet.addAuxiliaryClass(_class[i]);
  -		}
   	    }
   	    return translet;
   	}
  @@ -332,27 +263,22 @@
        *
        * @throws TransformerConfigurationException
        */
  -    public synchronized Transformer newTransformer()
  -	throws TransformerConfigurationException 
  -    {
  -	final TransformerImpl transformer =
  -	    new TransformerImpl(getTransletInstance(), _outputProperties,
  -			        _indentNumber, _tfactory);
  -	if (_uriResolver != null) {
  -	    transformer.setURIResolver(_uriResolver);
  -	}
  -	return transformer;
  +    public Transformer newTransformer()
  +	throws TransformerConfigurationException {
  +        return new TransformerImpl(getTransletInstance(), _outputProperties,
  +	    _oldOutputSystem);
       }
   
       /**
  -     * Implements JAXP's Templates.getOutputProperties(). We need to 
  -     * instanciate a translet to get the output settings, so
  -     * we might as well just instanciate a Transformer and use its
  -     * implementation of this method.
  +     * Implements JAXP's Templates.getOutputProperties()
        */
  -    public synchronized Properties getOutputProperties() { 
  +    public Properties getOutputProperties() { 
  +	// We need to instanciate a translet to get the output settings, so
  +	// we might as well just instanciate a Transformer and use its
  +	// implementation of this method
   	try {
  -	    return newTransformer().getOutputProperties();
  +	    Transformer transformer = newTransformer();
  +	    return transformer.getOutputProperties();
   	}
   	catch (TransformerConfigurationException e) {
   	    return null;
  
  
  
  1.1.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/trax/TrAXFilter.java
  
  Index: TrAXFilter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TrAXFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.1.12.1
  diff -u -r1.1 -r1.1.12.1
  
  
  
  1.45.2.1  +216 -216  xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
  
  Index: TransformerFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java,v
  retrieving revision 1.45
  retrieving revision 1.45.2.1
  diff -u -r1.45 -r1.45.2.1
  --- TransformerFactoryImpl.java	12 Aug 2002 19:33:55 -0000	1.45
  +++ TransformerFactoryImpl.java	14 Aug 2002 19:21:46 -0000	1.45.2.1
  @@ -58,7 +58,6 @@
    *
    * @author G. Todd Miller 
    * @author Morten Jorgensen
  - * @author Santiago Pericas-Geertsen
    *
    */
   
  @@ -72,16 +71,15 @@
   import java.net.MalformedURLException;
   import java.util.Vector;
   import java.util.Hashtable;
  -import java.util.Properties;
   
   import javax.xml.transform.*;
   import javax.xml.transform.sax.*;
   import javax.xml.transform.dom.*;
   import javax.xml.transform.stream.*;
  -import javax.xml.parsers.SAXParserFactory;
   
  -import org.xml.sax.*;
   import org.w3c.dom.Document;
  +import org.xml.sax.XMLFilter;
  +import org.xml.sax.InputSource;
   
   import org.apache.xalan.xsltc.Translet;
   import org.apache.xalan.xsltc.runtime.AbstractTranslet;
  @@ -89,46 +87,47 @@
   import org.apache.xalan.xsltc.compiler.XSLTC;
   import org.apache.xalan.xsltc.compiler.SourceLoader;
   import org.apache.xalan.xsltc.compiler.CompilerException;
  +import org.apache.xalan.xsltc.compiler.util.Util;
   import org.apache.xalan.xsltc.compiler.util.ErrorMsg;
   
   /**
    * Implementation of a JAXP1.1 TransformerFactory for Translets.
    */
   public class TransformerFactoryImpl
  -    extends SAXTransformerFactory implements SourceLoader, ErrorListener 
  -{
  -    /**
  -     * This error listener is used only for this factory and is not passed to
  -     * the Templates or Transformer objects that we create.
  -     */
  +    extends SAXTransformerFactory implements SourceLoader, ErrorListener {
  +
  +    // This error listener is used only for this factory and is not passed to
  +    // the Templates or Transformer objects that we create!!!
       private ErrorListener _errorListener = this; 
   
  -    /**
  -     * This URIResolver is passed to all created Templates and Transformers
  -     */
  +    // This URIResolver is passed to all created Templates and Transformers
       private URIResolver _uriResolver = null;
   
  -    /** 
  -     * As Gregor Samsa awoke one morning from uneasy dreams he found himself
  -     * transformed in his bed into a gigantic insect. He was lying on his hard,
  -     * as it were armour plated, back, and if he lifted his head a little he
  -     * could see his big, brown belly divided into stiff, arched segments, on
  -     * top of which the bed quilt could hardly keep in position and was about
  -     * to slide off completely. His numerous legs, which were pitifully thin
  -     * compared to the rest of his bulk, waved helplessly before his eyes.
  -     * "What has happened to me?", he thought. It was no dream....
  -     */
  +    // As Gregor Samsa awoke one morning from uneasy dreams he found himself
  +    // transformed in his bed into a gigantic insect. He was lying on his hard,
  +    // as it were armour plated, back, and if he lifted his head a little he
  +    // could see his big, brown belly divided into stiff, arched segments, on
  +    // top of which the bed quilt could hardly keep in position and was about
  +    // to slide off completely. His numerous legs, which were pitifully thin
  +    // compared to the rest of his bulk, waved helplessly before his eyes.
  +    // "What has happened to me?", he thought. It was no dream....
       protected static String _defaultTransletName = "GregorSamsa";
   
  -    /**
  -     * This Hashtable is used to store parameters for locating
  -     * <?xml-stylesheet ...?> processing instructions in XML docs.
  -     */
  +    // Cache for the newTransformer() method - see method for details
  +    private Transformer _copyTransformer = null;
  +    // XSL document for the default transformer
  +    private static final String COPY_TRANSLET_CODE =
  +	"<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">"+
  +	"<xsl:template match=\"/\">"+
  +	"  <xsl:copy-of select=\".\"/>"+
  +	"</xsl:template>"+
  +	"</xsl:stylesheet>";
  +
  +    // This Hashtable is used to store parameters for locating
  +    // <?xml-stylesheet ...?> processing instructions in XML documents.
       private Hashtable _piParams = null;
   
  -    /**
  -     * The above hashtable stores objects of this class.
  -     */
  +    // The above hashtable stores objects of this class only:
       private class PIParamWrapper {
   	public String _media = null;
   	public String _title = null;
  @@ -141,31 +140,17 @@
   	}
       }
   
  -    /**
  -     * Set to <code>true</code> when debugging is enabled.
  -     */
  +    // This flags are passed to the compiler
       private boolean _debug = false;
  -
  -    /**
  -     * Set to <code>true</code> when templates are not inlined.
  -     */
       private boolean _disableInlining = false;
  -
  -    /**
  -     * Number of indent spaces when indentation is turned on.
  -     */
  -    private int _indentNumber = -1;
  -
  -    /**
  -     * A reference to an XML reader for parsing.
  -     */
  -    private XMLReader _xmlReader = null;
  +    private boolean _oldOutputSystem = false;
   
       /**
        * javax.xml.transform.sax.TransformerFactory implementation.
        * Contains nothing yet
        */
       public TransformerFactoryImpl() {
  +	// Don't need anything here so far...
       }
   
       /**
  @@ -178,8 +163,7 @@
        * @throws IllegalArgumentException
        */
       public void setErrorListener(ErrorListener listener) 
  -	throws IllegalArgumentException 
  -    {
  +	throws IllegalArgumentException {
   	if (listener == null) {
   	    ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR,
   					"TransformerFactory");
  @@ -207,13 +191,9 @@
        * @throws IllegalArgumentException
        */
       public Object getAttribute(String name) 
  -	throws IllegalArgumentException 
  -    { 
  +	throws IllegalArgumentException { 
   	// Return value for attribute 'translet-name'
  -	if (name.equals("translet-name")) {
  -	    return _defaultTransletName;
  -	}
  -
  +	if (name.equals("translet-name")) return(_defaultTransletName);
   	// Throw an exception for all other attributes
   	ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name);
   	throw new IllegalArgumentException(err.toString());
  @@ -228,54 +208,26 @@
        * @throws IllegalArgumentException
        */
       public void setAttribute(String name, Object value) 
  -	throws IllegalArgumentException 
  -    { 
  +	throws IllegalArgumentException { 
   	// Set the default translet name (ie. class name), which will be used
   	// for translets that cannot be given a name from their system-id.
  -	if (name.equals("translet-name") && value instanceof String) {
  -	    _defaultTransletName = (String) value;
  -	    return;
  +	if ((name.equals("translet-name")) && (value instanceof String)) {
  +	    _defaultTransletName = (String)value;
   	}
   	else if (name.equals("debug")) {
  -	    if (value instanceof Boolean) {
  -		_debug = ((Boolean) value).booleanValue();
  -		return;
  -	    }
  -	    else if (value instanceof String) {
  -		_debug = ((String) value).equalsIgnoreCase("true");
  -		return;
  -	    }
  +	    _debug = true;
   	}
  -	else if (name.equals("disable-inlining")) {
  -	    if (value instanceof Boolean) {
  -		_disableInlining = ((Boolean) value).booleanValue();
  -		return;
  -	    }
  -	    else if (value instanceof String) {
  -		_disableInlining = ((String) value).equalsIgnoreCase("true");
  -		return;
  -	    }
  +	else if (name.equals("disable-inlining") && value instanceof Boolean) {
  +	    _disableInlining = ((Boolean) value).booleanValue();
   	}
  -	else if (name.equals("indent-number")) {
  -	    if (value instanceof String) {
  -		try {
  -		    _indentNumber = Integer.parseInt((String) value);
  -		    return;
  -		}
  -		catch (NumberFormatException e) {
  -		    // Falls through
  -		}
  -	    }
  -	    else if (value instanceof Integer) {
  -		_indentNumber = ((Integer) value).intValue();
  -		return;
  -	    }
  +	else if (name.equals("old-output") && value instanceof Boolean) {
  +	    _oldOutputSystem = ((Boolean) value).booleanValue();
  +	}
  +	else {
  +	    // Throw an exception for all other attributes
  +	    ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name);
  +	    throw new IllegalArgumentException(err.toString());
   	}
  -
  -	// Throw an exception for all other attributes
  -	final ErrorMsg err 
  -	    = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name);
  -	throw new IllegalArgumentException(err.toString());
       }
   
       /**
  @@ -298,12 +250,10 @@
   	    StreamResult.FEATURE
   	};
   
  -	// Inefficient, but array is small
  -	for (int i =0; i < features.length; i++) {
  -	    if (name.equals(features[i])) {
  -		return true;
  -	    }
  -	}
  +	// Inefficient, but it really does not matter in a function like this
  +	for (int i=0; i<features.length; i++)
  +	    if (name.equals(features[i])) return true;
  +
   	// Feature not supported
   	return false;
       }
  @@ -317,7 +267,7 @@
        * Templates and Transformer objects created using this factory
        */    
       public URIResolver getURIResolver() {
  -	return _uriResolver;
  +	return(_uriResolver);
       } 
   
       /**
  @@ -351,16 +301,13 @@
        */
       public Source getAssociatedStylesheet(Source source, String media,
   					  String title, String charset)
  -	throws TransformerConfigurationException 
  -    {
  +	throws TransformerConfigurationException {
   	// First create a hashtable that maps Source refs. to parameters
  -	if (_piParams == null) {
  -	    _piParams = new Hashtable();
  -	}
  +	if (_piParams == null) _piParams = new Hashtable();
   	// Store the parameters for this Source in the Hashtable
   	_piParams.put(source, new PIParamWrapper(media, title, charset));
   	// Return the same Source - we'll locate the stylesheet later
  -	return source;
  +	return(source);
       }
   
       /**
  @@ -371,14 +318,40 @@
        * @throws TransformerConfigurationException
        */    
       public Transformer newTransformer()
  -	throws TransformerConfigurationException 
  -    { 
  -	TransformerImpl result = new TransformerImpl(new Properties(), 
  -	    _indentNumber, this);
  +	throws TransformerConfigurationException { 
  +
  +	if (_copyTransformer != null) {
  +	    if (_uriResolver != null)
  +		_copyTransformer.setURIResolver(_uriResolver);
  +	    return _copyTransformer;
  +	}
  +
  +	XSLTC xsltc = new XSLTC();
  +	if (_debug) xsltc.setDebug(true);
  +	if (_disableInlining) xsltc.setTemplateInlining(false);
  +	xsltc.init();
  +
  +	// Compile the default copy-stylesheet
  +	byte[] bytes = COPY_TRANSLET_CODE.getBytes();
  +	ByteArrayInputStream bytestream = new ByteArrayInputStream(bytes);
  +	InputSource input = new InputSource(bytestream);
  +	input.setSystemId(_defaultTransletName);
  +	byte[][] bytecodes = xsltc.compile(_defaultTransletName, input);
  +
  +	// Check that the transformation went well before returning
  +	if (bytecodes == null) {
  +	    ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR);
  +	    throw new TransformerConfigurationException(err.toString());
  +	}
  +
  +	// Create a Transformer object and store for other calls
  +	Templates templates = new TemplatesImpl(bytecodes, _defaultTransletName,
  +	    xsltc.getOutputProperties(), _oldOutputSystem);
  +	_copyTransformer = templates.newTransformer();
   	if (_uriResolver != null) {
  -	    result.setURIResolver(_uriResolver);
  +	    _copyTransformer.setURIResolver(_uriResolver);
   	}
  -	return result;
  +	return _copyTransformer;
       }
   
       /**
  @@ -392,13 +365,10 @@
        * @throws TransformerConfigurationException
        */
       public Transformer newTransformer(Source source) throws
  -	TransformerConfigurationException 
  -    {
  +	TransformerConfigurationException {
   	final Templates templates = newTemplates(source);
   	final Transformer transformer = templates.newTransformer();
  -	if (_uriResolver != null) {
  -	    transformer.setURIResolver(_uriResolver);
  -	}
  +	if (_uriResolver != null) transformer.setURIResolver(_uriResolver);
   	return(transformer);
       }
   
  @@ -408,7 +378,7 @@
       private void passWarningsToListener(Vector messages) 
   	throws TransformerException 
       {
  -	if (_errorListener == null || messages == null) {
  +	if (_errorListener == null || messages == null ) {
   	    return;
   	}
   	// Pass messages to listener, one by one
  @@ -425,12 +395,13 @@
        */
       private void passErrorsToListener(Vector messages) {
   	try {
  -	    if (_errorListener == null || messages == null) {
  -		return;
  -	    }
  +	    // Nothing to do if there is no registered error listener
  +	    if (_errorListener == null) return;
  +	    // Nothing to do if there are not warning messages
  +	    if (messages == null) return;
   	    // Pass messages to listener, one by one
   	    final int count = messages.size();
  -	    for (int pos = 0; pos < count; pos++) {
  +	    for (int pos=0; pos<count; pos++) {
   		String message = messages.elementAt(pos).toString();
   		_errorListener.error(new TransformerException(message));
   	    }
  @@ -441,6 +412,70 @@
       }
   
       /**
  +     * Creates a SAX2 InputSource object from a TrAX Source object
  +     */
  +    private InputSource getInputSource(XSLTC xsltc, Source source)
  +	throws TransformerConfigurationException {
  +
  +	InputSource input = null;
  +	String systemId = source.getSystemId();
  +	if (systemId == null) systemId = "";
  +
  +	try {
  +
  +	    // Try to get InputSource from SAXSource input
  +	    if (source instanceof SAXSource) {
  +		final SAXSource sax = (SAXSource)source;
  +		input = sax.getInputSource();
  +		// Pass the SAX parser to the compiler
  +		xsltc.setXMLReader(sax.getXMLReader());
  +	    }
  +	    // handle  DOMSource  
  +	    else if (source instanceof DOMSource) {
  +		final DOMSource domsrc = (DOMSource)source;
  +		final Document dom = (Document)domsrc.getNode();
  +		final DOM2SAX dom2sax = new DOM2SAX(dom);
  +		xsltc.setXMLReader(dom2sax);  
  +	        // try to get SAX InputSource from DOM Source.
  +		input = SAXSource.sourceToInputSource(source);
  +		if (input == null){
  +			input = new InputSource(domsrc.getSystemId());
  +		}
  +	    }
  +	    // Try to get InputStream or Reader from StreamSource
  +	    else if (source instanceof StreamSource) {
  +		final StreamSource stream = (StreamSource)source;
  +		final InputStream istream = stream.getInputStream();
  +		final Reader reader = stream.getReader();
  +		// Create InputSource from Reader or InputStream in Source
  +		if (istream != null)
  +		    input = new InputSource(istream);
  +		else if (reader != null)
  +		    input = new InputSource(reader);
  +		else
  +		    input = new InputSource(systemId);
  +	    }
  +	    else {
  +		ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR);
  +		throw new TransformerConfigurationException(err.toString());
  +	    }
  +	    input.setSystemId(systemId);
  +	}
  +	catch (NullPointerException e) {
  + 	    ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR,
  +					"TransformerFactory.newTemplates()");
  +	    throw new TransformerConfigurationException(err.toString());
  +	}
  +	catch (SecurityException e) {
  + 	    ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId);
  +	    throw new TransformerConfigurationException(err.toString());
  +	}
  +	finally {
  +	    return(input);
  +	}
  +    }
  +
  +    /**
        * javax.xml.transform.sax.TransformerFactory implementation.
        * Process the Source into a Templates object, which is a a compiled
        * representation of the source.
  @@ -450,8 +485,7 @@
        * @throws TransformerConfigurationException
        */
       public Templates newTemplates(Source source)
  -	throws TransformerConfigurationException 
  -    {
  +	throws TransformerConfigurationException {
   	// Create and initialize a stylesheet compiler
   	final XSLTC xsltc = new XSLTC();
   	if (_debug) xsltc.setDebug(true);
  @@ -459,9 +493,7 @@
   	xsltc.init();
   
   	// Set a document loader (for xsl:include/import) if defined
  -	if (_uriResolver != null) {
  -	    xsltc.setSourceLoader(this);
  -	}
  +	if (_uriResolver != null) xsltc.setSourceLoader(this);
   
   	// Pass parameters to the Parser to make sure it locates the correct
   	// <?xml-stylesheet ...?> PI in an XML input document
  @@ -469,13 +501,12 @@
   	    // Get the parameters for this Source object
   	    PIParamWrapper p = (PIParamWrapper)_piParams.get(source);
   	    // Pass them on to the compiler (which will pass then to the parser)
  -	    if (p != null) {
  +	    if (p != null) 
   		xsltc.setPIParameters(p._media, p._title, p._charset);
  -	    }
   	}
   
   	// Compile the stylesheet
  -	final InputSource input = Util.getInputSource(xsltc, source);
  +	final InputSource input = getInputSource(xsltc, source);
   	byte[][] bytecodes = xsltc.compile(null, input);
   	final String transletName = xsltc.getClassName();
   
  @@ -495,18 +526,15 @@
   	// Check that the transformation went well before returning
   	if (bytecodes == null) {
   	    // Pass compiler errors to the error listener
  -	    if (_errorListener != null) {
  +	    if (_errorListener != null)
   		passErrorsToListener(xsltc.getErrors());
  -	    }
  -	    else {
  +	    else
   		xsltc.printErrors();
  -	    }
   	    ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR);
   	    throw new TransformerConfigurationException(err.toString());
   	}
  -
   	return new TemplatesImpl(bytecodes, transletName, 
  -	    xsltc.getOutputProperties(), _indentNumber, this);
  +	    xsltc.getOutputProperties(), _oldOutputSystem);
       }
   
       /**
  @@ -518,14 +546,10 @@
        * @throws TransformerConfigurationException
        */
       public TemplatesHandler newTemplatesHandler() 
  -	throws TransformerConfigurationException 
  -    { 
  +	throws TransformerConfigurationException { 
   	final TemplatesHandlerImpl handler = 
  -	    new TemplatesHandlerImpl(_indentNumber, this);
  +	    new TemplatesHandlerImpl(_oldOutputSystem);
   	handler.init();
  -	if (_uriResolver != null) {
  -	    handler.setURIResolver(_uriResolver);
  -	}
   	return handler;
       }
   
  @@ -538,13 +562,10 @@
        * @throws TransformerConfigurationException
        */
       public TransformerHandler newTransformerHandler() 
  -	throws TransformerConfigurationException 
  -    {
  +	throws TransformerConfigurationException {
   	final Transformer transformer = newTransformer();
  -	if (_uriResolver != null) {
  -	    transformer.setURIResolver(_uriResolver);
  -	}
  -	return new TransformerHandlerImpl((TransformerImpl) transformer);
  +	final TransformerImpl internal = (TransformerImpl)transformer;
  +	return(new TransformerHandlerImpl(internal));
       }
   
       /**
  @@ -558,13 +579,10 @@
        * @throws TransformerConfigurationException
        */
       public TransformerHandler newTransformerHandler(Source src) 
  -	throws TransformerConfigurationException 
  -    { 
  +	throws TransformerConfigurationException { 
   	final Transformer transformer = newTransformer(src);
  -	if (_uriResolver != null) {
  -	    transformer.setURIResolver(_uriResolver);
  -	}
  -	return new TransformerHandlerImpl((TransformerImpl) transformer);
  +	final TransformerImpl internal = (TransformerImpl)transformer;
  +	return(new TransformerHandlerImpl(internal));
       }
   
       /**
  @@ -578,13 +596,13 @@
        * @throws TransformerConfigurationException
        */    
       public TransformerHandler newTransformerHandler(Templates templates) 
  -	throws TransformerConfigurationException  
  -    {
  +	throws TransformerConfigurationException  {
   	final Transformer transformer = templates.newTransformer();
   	final TransformerImpl internal = (TransformerImpl)transformer;
  -	return new TransformerHandlerImpl(internal);
  +	return(new TransformerHandlerImpl(internal));
       }
   
  +
       /**
        * javax.xml.transform.sax.SAXTransformerFactory implementation.
        * Create an XMLFilter that uses the given source as the
  @@ -595,10 +613,9 @@
        * @throws TransformerConfigurationException
        */
       public XMLFilter newXMLFilter(Source src) 
  -	throws TransformerConfigurationException 
  -    {
  +	throws TransformerConfigurationException {
   	Templates templates = newTemplates(src);
  -	if (templates == null) return null; 
  +	if (templates == null ) return null; 
   	return newXMLFilter(templates);
       }
   
  @@ -612,18 +629,17 @@
        * @throws TransformerConfigurationException
        */
       public XMLFilter newXMLFilter(Templates templates) 
  -	throws TransformerConfigurationException 
  -    {
  +	throws TransformerConfigurationException {
   	try {
         	    return new org.apache.xalan.xsltc.trax.TrAXFilter(templates);
       	}
  -	catch (TransformerConfigurationException e1) {
  -      	    if (_errorListener != null) {
  +	catch(TransformerConfigurationException e1) {
  +      	    if(_errorListener != null) {
                   try {
             	    _errorListener.fatalError(e1);
             	    return null;
           	}
  -		catch (TransformerException e2) {
  +		catch( TransformerException e2) {
             	    new TransformerConfigurationException(e2);
           	}
         	    }
  @@ -632,6 +648,29 @@
       }
   
       /**
  +     * This method implements XSLTC's SourceLoader interface. It is used to
  +     * glue a TrAX URIResolver to the XSLTC compiler's Input and Import classes.
  +     *
  +     * @param href The URI of the document to load
  +     * @param context The URI of the currently loaded document
  +     * @param xsltc The compiler that resuests the document
  +     * @return An InputSource with the loaded document
  +     */
  +    public InputSource loadSource(String href, String context, XSLTC xsltc) {
  +	try {
  +	    final Source source = _uriResolver.resolve(href, context);
  +	    final InputSource input = getInputSource(xsltc, source);
  +	    return(input);
  +	}
  +	catch (TransformerConfigurationException e) {
  +	    return null;
  +	}
  +	catch (TransformerException e) {
  +	    return null;
  +	}
  +    }
  +
  +    /**
        * Receive notification of a recoverable error. 
        * The transformer must continue to provide normal parsing events after
        * invoking this method. It should still be possible for the application
  @@ -643,14 +682,12 @@
        * the transformation (always does in our case).
        */
       public void error(TransformerException e)
  -	throws TransformerException 
  -    {
  +	throws TransformerException {
   	System.err.println("ERROR: "+e.getMessageAndLocation());
   	Throwable wrapped = e.getException();
  -	if (wrapped != null) {
  +	if (wrapped != null)
   	    System.err.println("     : "+wrapped.getMessage());
  -	}
  -	throw e; 	
  +	throw(e); 	
       }
   
       /**
  @@ -667,14 +704,12 @@
        * the transformation (always does in our case).
        */
       public void fatalError(TransformerException e)
  -	throws TransformerException 
  -    {
  +	throws TransformerException {
   	System.err.println("FATAL: "+e.getMessageAndLocation());
   	Throwable wrapped = e.getException();
  -	if (wrapped != null) {
  +	if (wrapped != null)
   	    System.err.println("     : "+wrapped.getMessage());
  -	}
  -	throw e;
  +	throw(e);
       }
   
       /**
  @@ -691,46 +726,11 @@
        * the transformation (never does in our case).
        */
       public void warning(TransformerException e)
  -	throws TransformerException 
  -    {
  +	throws TransformerException {
   	System.err.println("WARNING: "+e.getMessageAndLocation());
   	Throwable wrapped = e.getException();
  -	if (wrapped != null) {
  +	if (wrapped != null)
   	    System.err.println("       : "+wrapped.getMessage());
  -	}
       }
   
  -    /**
  -     * This method implements XSLTC's SourceLoader interface. It is used to
  -     * glue a TrAX URIResolver to the XSLTC compiler's Input and Import classes.
  -     *
  -     * @param href The URI of the document to load
  -     * @param context The URI of the currently loaded document
  -     * @param xsltc The compiler that resuests the document
  -     * @return An InputSource with the loaded document
  -     */
  -    public InputSource loadSource(String href, String context, XSLTC xsltc) {
  -	try {
  -	    if (_uriResolver != null) {
  -		final Source source = _uriResolver.resolve(href, context);
  -		if (source != null) {
  -		    return Util.getInputSource(xsltc, source);
  -		}
  -	    }
  -	}
  -	catch (TransformerException e) {
  -	    // Falls through
  -	}
  -	return null;
  -    }
  -
  -    public XMLReader getXMLReader() throws Exception {
  -	if (_xmlReader == null) {
  -	    final SAXParserFactory pfactory 
  -		= SAXParserFactory.newInstance();
  -	    pfactory.setNamespaceAware(true);
  -	    _xmlReader = pfactory.newSAXParser().getXMLReader();
  -	}
  -	return _xmlReader;
  -    }
   }
  
  
  
  1.11.2.1  +38 -91    xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
  
  Index: TransformerHandlerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- TransformerHandlerImpl.java	12 Aug 2002 19:33:55 -0000	1.11
  +++ TransformerHandlerImpl.java	14 Aug 2002 19:21:46 -0000	1.11.2.1
  @@ -63,15 +63,12 @@
   package org.apache.xalan.xsltc.trax;
   
   import org.xml.sax.*;
  -import org.xml.sax.ext.LexicalHandler;
   import org.xml.sax.ext.DeclHandler;
  -import org.xml.sax.helpers.DefaultHandler;
   
   import javax.xml.transform.*;
   import javax.xml.transform.sax.*;
   
   import org.apache.xalan.xsltc.Translet;
  -import org.apache.xalan.xsltc.TransletOutputHandler;
   import org.apache.xalan.xsltc.dom.DOMImpl;
   import org.apache.xalan.xsltc.dom.DOMBuilder;
   import org.apache.xalan.xsltc.dom.DTDMonitor;
  @@ -87,43 +84,28 @@
       private AbstractTranslet _translet = null;
       private String           _systemId;
       private DOMImpl          _dom = null;
  -    private ContentHandler   _handler = null;
  -    private LexicalHandler   _lexHandler = null;
  +    private DOMBuilder       _handler = null;
       private DTDMonitor       _dtd = null;
       private Result           _result = null;
   
       private boolean          _done = false; // Set in endDocument()
   
       /**
  -     * A flag indicating whether this transformer handler implements the 
  -     * identity transform.
  -     */
  -    private boolean _isIdentity = false;
  -
  -    /**
        * Cosntructor - pass in reference to a TransformerImpl object
        */
       protected TransformerHandlerImpl(TransformerImpl transformer) {
   	// Save the reference to the transformer
   	_transformer = transformer;
   
  -	if (transformer.isIdentity()) {
  -	    // Set initial handler to the empty handler
  -	    _handler = new DefaultHandler();
  -	    _isIdentity = true;
  -	}
  -	else {
  -	    // Get a reference to the translet wrapped inside the transformer
  -	    _translet = _transformer.getTranslet();
  -
  -	    // Create a DOMBuilder object and get the handler
  -	    _dom = new DOMImpl();
  -	    _handler = _dom.getBuilder();
  -	    _lexHandler = (LexicalHandler) _handler;
  +	// Get a reference to the translet wrapped inside the transformer
  +	_translet = _transformer.getTranslet();
   
  -	    // Create a new DTD monitor
  -	    _dtd = new DTDMonitor();
  -	}
  +	// Create a DOMBuilder object and get the handler
  +	_dom = new DOMImpl();
  +	_handler = _dom.getBuilder();
  +
  +	// Create a new DTD monitor
  +	_dtd = new DTDMonitor();
       }
   
       /**
  @@ -166,22 +148,8 @@
       public void setResult(Result result) throws IllegalArgumentException {
   	_result = result;
   
  -	if (_isIdentity) {
  -	    try {
  -		// Connect this object with output system directly
  -		TransletOutputHandler outputHandler =
  -		    _transformer.getOutputHandler(result);
  -		_transformer.transferOutputProperties(outputHandler);
  -
  -		_handler = new SAX2TO(outputHandler);
  -		_lexHandler = (LexicalHandler) _handler;
  -	    }
  -	    catch (TransformerException e) {
  -		_result = null;
  -	    }
  -	}
  -	else if (_done) {
  -	    // Run the transformation now, if not already done
  +	// Run the transformation now, if not already done
  +	if (_done) {
   	    try {
   		_transformer.setDOM(_dom);
   		_transformer.transform(null, _result);
  @@ -214,10 +182,8 @@
   	    throw new SAXException(err.toString());
   	}
   
  -	if (!_isIdentity) {
  -	    // Set document URI
  -	    _dom.setDocumentURI(_systemId);
  -	}
  +	// Set document URI
  +	_dom.setDocumentURI(_systemId);
   
   	// Proxy call
   	_handler.startDocument();
  @@ -231,24 +197,22 @@
   	// Signal to the DOMBuilder that the document is complete
   	_handler.endDocument();
   
  -	if (!_isIdentity) {
  -	    // Run the transformation now if we have a reference to a Result object
  -	    if (_result != null) {
  -		try {
  -		    _transformer.setDOM(_dom);
  -		    _transformer.setDTDMonitor(_dtd);	// for id/key
  -		    _transformer.transform(null, _result);
  -		}
  -		catch (TransformerException e) {
  -		    throw new SAXException(e);
  -		}
  +	// Run the transformation now if we have a reference to a Result object
  +	if (_result != null) {
  +	    try {
  +		_transformer.setDOM(_dom);
  +		_transformer.setDTDMonitor(_dtd);	// for id/key
  +		_transformer.transform(null, _result);
  +	    }
  +	    catch (TransformerException e) {
  +		throw new SAXException(e);
   	    }
  -	    // Signal that the internal DOM is build (see 'setResult()').
  -	    _done = true;
  -
  -	    // Set this DOM as the transformer's DOM
  -	    _transformer.setDOM(_dom);
   	}
  +	// Signal that the internal DOM is build (see 'setResult()').
  +	_done = true;
  +
  +	// Set this DOM as the transformer's DOM
  +	_transformer.setDOM(_dom);
       }
   	
       /**
  @@ -257,8 +221,7 @@
        */
       public void startElement(String uri, String localName,
   			     String qname, Attributes attributes)
  -	throws SAXException 
  -    {
  +	throws SAXException {
   	_handler.startElement(uri, localName, qname, attributes);
       }
   	
  @@ -267,8 +230,7 @@
        * Receive notification of the end of an element.
        */
       public void endElement(String namespaceURI, String localName, String qname)
  -	throws SAXException 
  -    {
  +	throws SAXException {
   	_handler.endElement(namespaceURI, localName, qname);
       }
   
  @@ -277,8 +239,7 @@
        * Receive notification of a processing instruction.
        */
       public void processingInstruction(String target, String data)
  -	throws SAXException 
  -    {
  +	throws SAXException {
   	_handler.processingInstruction(target, data);
       }
   
  @@ -286,18 +247,14 @@
        * Implements org.xml.sax.ext.LexicalHandler.startCDATA()
        */
       public void startCDATA() throws SAXException { 
  -	if (_lexHandler != null) {
  -	    _lexHandler.startCDATA();
  -	}
  +	_handler.startCDATA();
       }
   
       /**
        * Implements org.xml.sax.ext.LexicalHandler.endCDATA()
        */
       public void endCDATA() throws SAXException { 
  -	if (_lexHandler != null) {
  -	    _lexHandler.endCDATA();
  -	}
  +	_handler.endCDATA();
       }
   
       /**
  @@ -307,9 +264,7 @@
       public void comment(char[] ch, int start, int length) 
   	throws SAXException 
       { 
  -	if (_lexHandler != null) {
  -	    _lexHandler.comment(ch, start, length);
  -	}
  +	_handler.comment(ch, start, length);
       }
   
       /**
  @@ -362,36 +317,28 @@
       public void startDTD(String name, String publicId, String systemId) 
   	throws SAXException
       { 
  -	if (_lexHandler != null) {
  -	    _lexHandler.startDTD(name, publicId, systemId);
  -	}
  +	_handler.startDTD(name, publicId, systemId);
       }
   
       /**
        * Implements org.xml.sax.ext.LexicalHandler.endDTD()
        */
       public void endDTD() throws SAXException {
  -	if (_lexHandler != null) {
  -	    _lexHandler.endDTD();
  -	}
  +	_handler.endDTD();
       }
   
       /**
        * Implements org.xml.sax.ext.LexicalHandler.startEntity()
        */
       public void startEntity(String name) throws SAXException { 
  -	if (_lexHandler != null) {
  -	    _lexHandler.startEntity(name);
  -	}
  +	_handler.startEntity(name);
       }
   
       /**
        * Implements org.xml.sax.ext.LexicalHandler.endEntity()
        */
       public void endEntity(String name) throws SAXException { 
  -	if (_lexHandler != null) {
  -	    _lexHandler.endEntity(name);
  -	}
  +	_handler.endEntity(name);
       }
   
       /**
  
  
  
  1.55.2.1  +270 -304  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.55
  retrieving revision 1.55.2.1
  diff -u -r1.55 -r1.55.2.1
  --- TransformerImpl.java	12 Aug 2002 19:33:55 -0000	1.55
  +++ TransformerImpl.java	14 Aug 2002 19:21:46 -0000	1.55.2.1
  @@ -58,13 +58,21 @@
    *
    * @author Morten Jorgensen
    * @author G. Todd Miller
  - * @author Santiago Pericas-Geertsen
    *
    */
   
   package org.apache.xalan.xsltc.trax;
   
  -import java.io.*;
  +import java.io.File;
  +import java.io.FileOutputStream;
  +import java.io.Writer;
  +import java.io.Reader;
  +import java.io.InputStream;
  +import java.io.OutputStream;
  +import java.io.FileOutputStream;
  +import java.io.FileNotFoundException;
  +import java.io.IOException;
  +
   import java.net.URL;
   import java.net.URLConnection;
   import java.net.MalformedURLException;
  @@ -75,26 +83,27 @@
   import java.util.Enumeration;
   import java.util.StringTokenizer;
   
  -import org.xml.sax.*;
  +import org.xml.sax.SAXException;
  +import org.xml.sax.XMLReader;
  +import org.xml.sax.ContentHandler;
  +import org.xml.sax.InputSource;
   import org.xml.sax.ext.LexicalHandler;
   
   import org.w3c.dom.Document;
   
  +import javax.xml.parsers.SAXParser;
  +import javax.xml.parsers.SAXParserFactory;
  +import javax.xml.parsers.ParserConfigurationException;
   import javax.xml.transform.*;
   import javax.xml.transform.sax.*;
   import javax.xml.transform.dom.*;
   import javax.xml.transform.stream.*;
   
  -import javax.xml.parsers.SAXParser;
  -import javax.xml.parsers.SAXParserFactory;
  -import javax.xml.parsers.ParserConfigurationException;
  -
   import org.apache.xalan.xsltc.Translet;
   import org.apache.xalan.xsltc.TransletException;
   import org.apache.xalan.xsltc.TransletOutputHandler;
   import org.apache.xalan.xsltc.DOMCache;
   import org.apache.xalan.xsltc.dom.*;
  -import org.apache.xalan.xsltc.compiler.Constants;
   import org.apache.xalan.xsltc.runtime.*;
   import org.apache.xalan.xsltc.runtime.output.*;
   import org.apache.xalan.xsltc.compiler.*;
  @@ -103,115 +112,58 @@
   import java.util.Properties;
   
   public final class TransformerImpl extends Transformer
  -    implements DOMCache, ErrorListener 
  -{
  +    implements DOMCache, ErrorListener {
  +
  +    private AbstractTranslet _translet = null;
  +    private String           _method   = null;
  +    private String           _encoding = null;
  +    private ContentHandler   _handler  = null;
  +
  +    private ErrorListener _errorListener = this;
  +    private URIResolver   _uriResolver = null;
  +    private Properties    _properties, _propertiesClone;
  +
  +    // Used for default output property settings
       private final static String EMPTY_STRING = "";
       private final static String NO_STRING    = "no";
       private final static String YES_STRING   = "yes";
       private final static String XML_STRING   = "xml";
   
  +    // Pre-set DOMImpl to use as input (used only with TransformerHandlerImpl)
  +    private DOMImpl _dom = null;
  +
  +    private DTDMonitor _dtdMonitor = null;
  +
       private final static String LEXICAL_HANDLER_PROPERTY =
   	"http://xml.org/sax/properties/lexical-handler";
       private static final String NAMESPACE_FEATURE =
   	"http://xml.org/sax/features/namespaces";
       
  -    /**
  -     * A reference to the translet or null if the identity transform.
  -     */
  -    private AbstractTranslet _translet = null;
  -
  -    /**
  -     * The output method of this transformation.
  -     */
  -    private String _method = null;
  -
  -    /**
  -     * The output encoding of this transformation.
  -     */
  -    private String _encoding = null;
  -
  -    /**
  -     * The systemId set in input source.
  -     */
  -    private String _sourceSystemId = null;
  -
  -    /**
  -     * An error listener for runtime errors.
  -     */
  -    private ErrorListener _errorListener = this;
  -
  -    /**
  -     * A reference to a URI resolver for calls to document().
  -     */
  -    private URIResolver _uriResolver = null;
  -
  -    /**
  -     * Output properties of this transformer instance.
  -     */
  -    private Properties _properties, _propertiesClone;
  -
  -    /**
  -     * A reference to an output handler factory.
  -     */
       private TransletOutputHandlerFactory _tohFactory = null;
   
  -    /**
  -     * A reference to a internal DOM represenation of the input.
  -     */
  -    private DOMImpl _dom = null;
  +    // Temporary
  +    private boolean _oldOutputSystem;
   
       /**
  -     * DTD monitor needed for id()/key().
  +     * Implements JAXP's Transformer constructor
  +     * Our Transformer objects always need a translet to do the actual work
        */
  -    private DTDMonitor _dtdMonitor = null;
  -
  -    /**
  -     * Number of indent spaces to add when indentation is on.
  -     */
  -    private int _indentNumber;
  -
  -    /**
  -     * A reference to the transformer factory that this templates
  -     * object belongs to.
  -     */
  -    private TransformerFactoryImpl _tfactory = null;
  -
  -    /**
  -     * A flag indicating whether this transformer implements the identity 
  -     * transform.
  -     */
  -    private boolean _isIdentity = false;
  -
  -    protected TransformerImpl(Properties outputProperties, int indentNumber, 
  -	TransformerFactoryImpl tfactory) 
  -    {
  -	this(null, outputProperties, indentNumber, tfactory);
  -	_isIdentity = true;
  -	// _properties.put(OutputKeys.METHOD, "xml");
  -    }
  -
       protected TransformerImpl(Translet translet, Properties outputProperties,
  -	int indentNumber, TransformerFactoryImpl tfactory) 
  +	boolean oldOutputSystem) 
       {
   	_translet = (AbstractTranslet) translet;
   	_properties = createOutputProperties(outputProperties);
  +	_oldOutputSystem = oldOutputSystem;
   	_propertiesClone = (Properties) _properties.clone();
  -	_indentNumber = indentNumber;
  -	_tfactory = tfactory;
       }
   
       /**
  -     * Returns the translet wrapped inside this Transformer or
  -     * null if this is the identity transform.
  +     * Returns the translet wrapped inside this Transformer
        */
       protected AbstractTranslet getTranslet() {
   	return _translet;
       }
   
  -    public boolean isIdentity() {
  -	return _isIdentity;
  -    }
  -
       /**
        * Implements JAXP's Transformer.transform()
        *
  @@ -222,34 +174,51 @@
       public void transform(Source source, Result result)
   	throws TransformerException 
       {
  -	if (!_isIdentity) {
  -	    if (_translet == null) {
  -		ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_TRANSLET_ERR);
  -		throw new TransformerException(err.toString());
  -	    }
  -	    // Pass output properties to the translet
  -	    transferOutputProperties(_translet);
  -	}
  -	    
  -	final TransletOutputHandler toHandler = getOutputHandler(result);
  -	if (toHandler == null) {
  -	    ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_HANDLER_ERR);
  +	if (_translet == null) {
  +	    ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_TRANSLET_ERR);
   	    throw new TransformerException(err.toString());
   	}
   
  -	if (_uriResolver != null && !_isIdentity) {
  -	    _translet.setDOMCache(this);
  -	}
  +	// Pass output properties to the translet
  +	setOutputProperties(_translet, _properties);
  +	    
  +	if (!_oldOutputSystem) {
  +	    final TransletOutputHandler toHandler = getOutputHandler(result);
   
  -	// Pass output properties to handler if identity
  -	if (_isIdentity) {
  -	    transferOutputProperties(toHandler);
  +	    if (toHandler == null) {
  +		ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_HANDLER_ERR);
  +		throw new TransformerException(err.toString());
  +	    }
  +
  +	    if (_uriResolver != null) {
  +		_translet.setDOMCache(this);
  +	    }
  +
  +	    transform(source, toHandler, _encoding);
  +
  +	    if (result instanceof DOMResult) {
  +		((DOMResult)result).setNode(_tohFactory.getNode());
  +	    }
   	}
  +	else {
  +	    _handler = getOldOutputHandler(result);
  +	    if (_handler == null) {
  +		ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_HANDLER_ERR);
  +		throw new TransformerException(err.toString());
  +	    }
  +
  +	    if (_uriResolver != null) {
  +		_translet.setDOMCache(this);
  +	    }
   
  -	transform(source, toHandler, _encoding);
  +	    // Run the transformation
  +	    transform(source, (ContentHandler)_handler, _encoding);
   
  -	if (result instanceof DOMResult) {
  -	    ((DOMResult)result).setNode(_tohFactory.getNode());
  +	    // If a DOMResult, then we must set the DOM Tree so it can
  +	    // be retrieved later 
  +	    if (result instanceof DOMResult) {
  +		((DOMResult)result).setNode(((SAX2DOM)_handler).getDOM());
  +	    }
   	}
       }
   
  @@ -258,7 +227,7 @@
        * the type and contents of the TrAX Result object passed to the 
        * transform() method. 
        */
  -    public TransletOutputHandler getOutputHandler(Result result) 
  +    private TransletOutputHandler getOutputHandler(Result result) 
   	throws TransformerException 
       {
   	// Get output method using get() to ignore defaults 
  @@ -273,11 +242,6 @@
   	    _tohFactory.setOutputMethod(_method);
   	}
   
  -	// Set indentation number in the factory
  -	if (_indentNumber >= 0) {
  -	    _tohFactory.setIndentNumber(_indentNumber);
  -	}
  -
   	// Return the content handler for this Result object
   	try {
   	    // Result object could be SAXResult, DOMResult, or StreamResult 
  @@ -368,6 +332,102 @@
       }
   
       /**
  +     * Create an output handler (SAX2 handler) for the transformation output
  +     * based on the type and contents of the TrAX Result object passed to
  +     * the transform() method. 
  +     */
  +    private ContentHandler getOldOutputHandler(Result result) throws 
  + 	TransformerException 
  +    {
  +	// Try to get the encoding from the translet (may not be set)
  +	if (_translet._encoding != null) {
  +            _encoding = _translet._encoding;
  +        }
  +        else {
  +            _encoding = "UTF-8"; // default output encoding
  +        }
  +
  +	// Return the content handler for this Result object
  +	try {
  +	    // Result object could be SAXResult, DOMResult, or StreamResult 
  +	    if (result instanceof SAXResult) {
  +                final SAXResult target = (SAXResult)result;
  +                final ContentHandler handler = target.getHandler();
  +                // Simple as feck, just pass the SAX handler back...
  +                if (handler != null) return handler;
  +            }
  +	    else if (result instanceof DOMResult) {
  +                return new SAX2DOM(((DOMResult) result).getNode());
  +            }
  +	    else if (result instanceof StreamResult) {
  +		// Get StreamResult
  +		final StreamResult target = (StreamResult)result;	
  +
  +		// StreamResult may have been created with a java.io.File,
  +		// java.io.Writer, java.io.OutputStream or just a String
  +		// systemId. 
  +
  +		// try to get a Writer from Result object
  +		final Writer writer = target.getWriter();
  +		if (writer != null) {
  +		    return (new DefaultSAXOutputHandler(writer, _encoding));
  +		}
  +
  +		// or try to get an OutputStream from Result object
  +		final OutputStream ostream = target.getOutputStream();
  +		if (ostream != null) {
  +		    return (new DefaultSAXOutputHandler(ostream, _encoding));
  +		}
  +
  +		// or try to get just a systemId string from Result object
  +		String systemId = result.getSystemId();
  +		if (systemId == null) {
  +		    ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_RESULT_ERR);
  +                    throw new TransformerException(err.toString());
  +		}
  +
  +		// System Id may be in one of several forms, (1) a uri
  +		// that starts with 'file:', (2) uri that starts with 'http:'
  +		// or (3) just a filename on the local system.
  +	        OutputStream os = null;
  +		URL url = null;
  +		if (systemId.startsWith("file:")) {
  +                    url = new URL(systemId);
  +                    os = new FileOutputStream(url.getFile());
  +		    return (new DefaultSAXOutputHandler(os, _encoding));
  +                }
  +                else if (systemId.startsWith("http:")) {
  +                    url = new URL(systemId);
  +                    URLConnection connection = url.openConnection();
  +                    os = connection.getOutputStream();
  +		    return (new DefaultSAXOutputHandler(os, _encoding));
  +                }
  +                else {
  +                    // system id is just a filename
  +                    File tmp = new File(systemId);
  +                    url = tmp.toURL();
  +                    os = new FileOutputStream(url.getFile());
  +		    return (new DefaultSAXOutputHandler(os, _encoding));
  +                }
  +	    }
  +	}
  +        // If we cannot write to the location specified by the SystemId
  +        catch (UnknownServiceException e) {
  +            throw new TransformerException(e);
  +        }
  +        // If we cannot create a SAX2DOM adapter
  +        catch (ParserConfigurationException e) {
  +            ErrorMsg err = new ErrorMsg(ErrorMsg.SAX2DOM_ADAPTER_ERR);
  +            throw new TransformerException(err.toString());
  +        }
  +        // If we cannot create the file specified by the SystemId
  +        catch (IOException e) {
  +            throw new TransformerException(e);
  +        }
  +	return null;
  +    }
  +
  +    /**
        * Set the internal DOMImpl that will be used for the next transformation
        */
       protected void setDOM(DOMImpl dom) {
  @@ -391,27 +451,28 @@
   	    DOMImpl dom = null;
   	    DTDMonitor dtd = null;
   
  -	    // Get systemId from source
  -	    if (source != null) {
  -		_sourceSystemId = source.getSystemId();
  -	    }
  -
  +	    // Handle SAXSource input
   	    if (source instanceof SAXSource) {
   		// Get all info from the input SAXSource object
  -		final SAXSource sax = (SAXSource)source;
  -		XMLReader reader = sax.getXMLReader();
  -		final InputSource input = sax.getInputSource();
  +		final SAXSource   sax    = (SAXSource)source;
  +		XMLReader   reader = sax.getXMLReader();
  +		final InputSource input  = sax.getInputSource();
  +		final String      systemId = sax.getSystemId();
   
  -		// Create a reader if not set by user
  +		// if reader was not set with setXMLReader by user,
  +		// then we must create one ourselves.
   		if (reader == null) {
  -		    reader = _tfactory.getXMLReader();
  +		    SAXParserFactory pfactory= SAXParserFactory.newInstance();
  +		    pfactory.setNamespaceAware(true);
  +		    reader = pfactory.newSAXParser().getXMLReader();
   		}
   
   		// Create a DTD monitor to trap all DTD/declarative events
   		dtd = new DTDMonitor();
   		dtd.handleDTD(reader);
   
  -		// Create a new internal DOM and set up its builder 
  +		// Create a new internal DOM and set up its builder to trap
  +		// all content/lexical events
   		dom = new DOMImpl();
   		final DOMBuilder builder = dom.getBuilder();
   		try {
  @@ -424,12 +485,21 @@
   
   		// Parse the input and build the internal DOM
   		reader.parse(input);
  -		dom.setDocumentURI(_sourceSystemId);
  +		dom.setDocumentURI(systemId);
   	    }
  +	    // Handle DOMSource input
   	    else if (source instanceof DOMSource) {
  -		final DOMSource domsrc = (DOMSource) source;
  +		final DOMSource   domsrc = (DOMSource)source;
   		final org.w3c.dom.Node node = domsrc.getNode();
  -		final DOM2SAX dom2sax = new DOM2SAX(node);
  +
  +		boolean isComplete = true;
  +		if (node.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE) {
  +		    isComplete = false;
  +		}
  +
  +		final DOM2SAX     dom2sax = new DOM2SAX(node);
  +		final InputSource input = null; 
  +		final String      systemId = domsrc.getSystemId(); 
   
   		// Create a DTD monitor to trap all DTD/declarative events
   		dtd = new DTDMonitor();
  @@ -442,15 +512,34 @@
   		dom2sax.setContentHandler(builder);
   
   		// Parse the input and build the internal DOM
  -		dom2sax.parse();
  -		dom.setDocumentURI(_sourceSystemId);
  +		if (!isComplete) {
  +		    builder.startDocument();
  +		}
  +		dom2sax.parse(input); // need this parameter?
  +		if (!isComplete) {
  +		    builder.endDocument();
  +		}
  +		dom.setDocumentURI(systemId);
   	    }
  +	    // Handle StreamSource input
   	    else if (source instanceof StreamSource) {
   		// Get all info from the input StreamSource object
   		final StreamSource stream = (StreamSource)source;
  -		final InputStream streamInput = stream.getInputStream();
  +		final InputStream  streamInput = stream.getInputStream();
   		final Reader streamReader = stream.getReader();
  -		final XMLReader reader = _tfactory.getXMLReader();
  +		final String systemId = stream.getSystemId();
  +
  +		// With a StreamSource we need to create our own parser
  +		final SAXParserFactory factory = SAXParserFactory.newInstance();
  +		try {
  +		    factory.setFeature(NAMESPACE_FEATURE,true);
  +		}
  +		catch (Exception e) {
  +		    factory.setNamespaceAware(true);
  +		}
  +
  +		final SAXParser parser = factory.newSAXParser();
  +		final XMLReader reader = parser.getXMLReader();
   
   		// Create a DTD monitor to trap all DTD/declarative events
   		dtd = new DTDMonitor();
  @@ -469,17 +558,12 @@
   		reader.setContentHandler(builder);
   
   		InputSource input;
  -		if (streamInput != null) {
  +		if (streamInput != null)
   		    input = new InputSource(streamInput);
  -		    input.setSystemId(_sourceSystemId); 
  -		} 
  -		else if (streamReader != null) {
  +		else if (streamReader != null)
   		    input = new InputSource(streamReader);
  -		    input.setSystemId(_sourceSystemId); 
  -		} 
  -		else if (_sourceSystemId != null) {
  -		    input = new InputSource(_sourceSystemId);
  -		} 
  +		else if (systemId != null)
  +		    input = new InputSource(systemId);
   		else {
   		    ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
   		    throw new TransformerException(err.toString());
  @@ -487,8 +571,9 @@
   
   		// Parse the input and build the internal DOM
   		reader.parse(input);
  -		dom.setDocumentURI(_sourceSystemId);
  +		dom.setDocumentURI(systemId);
   	    }
  +	    // Handle XSLTC-internal Source input
   	    else if (source instanceof XSLTCSource) {
   		final XSLTCSource xsltcsrc = (XSLTCSource)source;
   		dtd = xsltcsrc.getDTD();
  @@ -504,17 +589,12 @@
   	    }
   
   	    // Set size of key/id indices
  -	    if (!_isIdentity) {
  -		_translet.setIndexSize(dom.getSize());
  -
  -		// If there are any elements with ID attributes, build an index
  -		dtd.buildIdIndex(dom, mask, _translet);
  -
  -		// Pass unparsed entity URIs to the translet
  -		_translet.setDTDMonitor(dtd);
  -	    }
  +	    _translet.setIndexSize(dom.getSize());
  +	    // If there are any elements with ID attributes, build an index
  +	    dtd.buildIdIndex(dom, mask, _translet);
  +	    // Pass unparsed entity URIs to the translet
  +	    _translet.setDTDMonitor(dtd);
   	    return dom;
  -
   	}
   	catch (FileNotFoundException e) {
   	    if (_errorListener != null)	postErrorToListener(e.getMessage());
  @@ -534,99 +614,49 @@
   	}
       }
    
  -    private void transformIdentity(Source source, TransletOutputHandler handler)
  -	throws Exception 
  +    /**
  +     * Internal transformation method - uses the internal APIs of XSLTC
  +     */
  +    private void transform(Source src, TransletOutputHandler handler, 
  +	String encoding) throws TransformerException 
       {
  -	// Get systemId from source
  -	if (source != null) {
  -	    _sourceSystemId = source.getSystemId();
  -	}
  -
  -	if (source instanceof StreamSource) {
  -	    final StreamSource stream = (StreamSource) source;
  -	    final InputStream streamInput = stream.getInputStream();
  -	    final Reader streamReader = stream.getReader();
  -	    final XMLReader reader = _tfactory.getXMLReader();
  -
  -	    // Hook up reader and output handler 
  -	    try {
  -		reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler);
  -	    }
  -	    catch (SAXException e) {
  -		// Falls through
  -	    }
  -	    reader.setContentHandler(new SAX2TO(handler));
  -
  -	    // Create input source from source
  -	    InputSource input;
  -	    if (streamInput != null) {
  -		input = new InputSource(streamInput);
  -		input.setSystemId(_sourceSystemId); 
  -	    } 
  -	    else if (streamReader != null) {
  -		input = new InputSource(streamReader);
  -		input.setSystemId(_sourceSystemId); 
  -	    } 
  -	    else if (_sourceSystemId != null) {
  -		input = new InputSource(_sourceSystemId);
  -	    } 
  -	    else {
  -		ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
  -		throw new TransformerException(err.toString());
  -	    }
  -
  -	    // Start pushing SAX events
  -	    reader.parse(input);
  -	}
  -	else if (source instanceof SAXSource) {
  -	    final SAXSource sax = (SAXSource) source;
  -	    XMLReader reader = sax.getXMLReader();
  -	    final InputSource input = sax.getInputSource();
  -
  -	    // Create a reader if not set by user
  -	    if (reader == null) {
  -		reader = _tfactory.getXMLReader();
  -	    }
  -
  -	    // Hook up reader and output handler 
  -	    try {
  -		reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler);
  -	    }
  -	    catch (SAXException e) {
  -		// Falls through
  -	    }
  -	    reader.setContentHandler(new SAX2TO(handler));
  -
  -	    // Start pushing SAX events
  -	    reader.parse(input);
  +	try {
  +	    _translet.transform(getDOM(src, 0), handler);
   	}
  -	else if (source instanceof DOMSource) {
  -	    final DOMSource domsrc = (DOMSource) source;
  -	    new DOM2TO(domsrc.getNode(), handler).parse();
  +	catch (TransletException e) {
  +	    if (_errorListener != null)	postErrorToListener(e.getMessage());
  +	    throw new TransformerException(e);
   	}
  -	else if (source instanceof XSLTCSource) {
  -	    final DOMImpl dom = ((XSLTCSource) source).getDOM();
  -	    dom.copy(handler);
  +	catch (RuntimeException e) {
  +	    if (_errorListener != null)	postErrorToListener(e.getMessage());
  +	    throw new TransformerException(e);
   	}
  -	else {
  -	    ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
  -	    throw new TransformerException(err.toString());
  +	catch (Exception e) {
  +	    if (_errorListener != null)	postErrorToListener(e.getMessage());
  +	    throw new TransformerException(e);
   	}
       }
   
       /**
        * Internal transformation method - uses the internal APIs of XSLTC
        */
  -    private void transform(Source source, TransletOutputHandler handler, 
  -	String encoding) throws TransformerException 
  -    {
  +    private void transform(Source src, ContentHandler sax, String encoding)
  +	throws TransformerException {
   	try {
  -	    if (_isIdentity) {
  -		transformIdentity(source, handler);
  +	    // Build an iternal DOMImpl from the TrAX Source
  +	    DOMImpl dom = getDOM(src, 0);
  +
  +	    // This handler will post-process the translet output
  +	    TextOutput handler;
  +
  +	    // Check if the ContentHandler also implements LexicalHandler
  +	    if (sax instanceof LexicalHandler) {
  +		handler = new TextOutput(sax, (LexicalHandler)sax, encoding);
   	    }
   	    else {
  -		_translet.transform(getDOM(source, 0), handler);
  +		handler = new TextOutput(sax, encoding);
   	    }
  +	    _translet.transform(dom, handler);
   	}
   	catch (TransletException e) {
   	    if (_errorListener != null)	postErrorToListener(e.getMessage());
  @@ -811,17 +841,18 @@
        * Internal method to pass any properties to the translet prior to
        * initiating the transformation
        */
  -    private void transferOutputProperties(AbstractTranslet translet)
  +    private void setOutputProperties(AbstractTranslet translet,
  +				     Properties properties) 
       {
   	// Return right now if no properties are set
  -	if (_properties == null) return;
  +	if (properties == null) return;
   
   	// Get a list of all the defined properties
  -	Enumeration names = _properties.propertyNames();
  +	Enumeration names = properties.propertyNames();
   	while (names.hasMoreElements()) {
   	    // Note the use of get() instead of getProperty()
   	    String name  = (String) names.nextElement();
  -	    String value = (String) _properties.get(name);
  +	    String value = (String) properties.get(name);
   
   	    // Ignore default properties
   	    if (value == null) continue;
  @@ -869,71 +900,6 @@
       }
   
       /**
  -     * This method is used to pass any properties to the output handler
  -     * when running the identity transform.
  -     */
  -    public void transferOutputProperties(TransletOutputHandler handler)
  -    {
  -	// Return right now if no properties are set
  -	if (_properties == null) return;
  -
  -	String doctypePublic = null;
  -	String doctypeSystem = null;
  -
  -	// Get a list of all the defined properties
  -	Enumeration names = _properties.propertyNames();
  -	while (names.hasMoreElements()) {
  -	    // Note the use of get() instead of getProperty()
  -	    String name  = (String) names.nextElement();
  -	    String value = (String) _properties.get(name);
  -
  -	    // Ignore default properties
  -	    if (value == null) continue;
  -
  -	    // Pass property value to translet - override previous setting
  -	    if (name.equals(OutputKeys.DOCTYPE_PUBLIC)) {
  -		doctypePublic = value;
  -	    }
  -	    else if (name.equals(OutputKeys.DOCTYPE_SYSTEM)) {
  -		doctypeSystem = value;
  -	    }
  -	    else if (name.equals(OutputKeys.MEDIA_TYPE)) {
  -		handler.setMediaType(value);
  -	    }
  -	    else if (name.equals(OutputKeys.STANDALONE)) {
  -		handler.setStandalone(value);
  -	    }
  -	    else if (name.equals(OutputKeys.VERSION)) {
  -		handler.setVersion(value);
  -	    }
  -	    else if (name.equals(OutputKeys.OMIT_XML_DECLARATION)) {
  -		handler.omitHeader(
  -		    value != null && value.toLowerCase().equals("yes"));
  -	    }
  -	    else if (name.equals(OutputKeys.INDENT)) {
  -		handler.setIndent( 
  -		    value != null && value.toLowerCase().equals("yes"));
  -	    }
  -	    else if (name.equals(OutputKeys.CDATA_SECTION_ELEMENTS)) {
  -		if (value != null) {
  -		    Hashtable table = new Hashtable();
  -		    StringTokenizer e = new StringTokenizer(value);
  -		    while (e.hasMoreTokens()) {
  -			final String token = e.nextToken();
  -			table.put(token, token);
  -		    }
  -		    handler.setCdataElements(table);
  -		}
  -	    }
  -	}
  -
  -	// Call setDoctype() if needed
  -	if (doctypePublic != null || doctypeSystem != null) {
  -	    handler.setDoctype(doctypePublic, doctypeSystem);
  -	}
  -    }
  -
  -    /**
        * Internal method to create the initial set of properties. There
        * are two layers of properties: the default layer and the base layer.
        * The latter contains properties defined in the stylesheet or by
  @@ -1070,7 +1036,7 @@
        */
       public DOMImpl retrieveDocument(String uri, int mask, Translet translet) {
   	try {
  -	    return getDOM(_uriResolver.resolve(uri, _sourceSystemId), mask);
  +	    return(getDOM(_uriResolver.resolve(uri, ""), mask));
   	}
   	catch (TransformerException e) {
   	    if (_errorListener != null)
  
  
  
  1.3.12.1  +1 -1      xml-xalan/java/src/org/apache/xalan/xsltc/trax/XSLTCSource.java
  
  Index: XSLTCSource.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/XSLTCSource.java,v
  retrieving revision 1.3
  retrieving revision 1.3.12.1
  diff -u -r1.3 -r1.3.12.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +10 -14    xml-xalan/java/src/org/apache/xalan/xsltc/util/IntegerArray.java
  
  Index: IntegerArray.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/util/IntegerArray.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- IntegerArray.java	26 Jun 2002 19:03:06 -0000	1.2
  +++ IntegerArray.java	14 Aug 2002 19:21:46 -0000	1.2.2.1
  @@ -87,9 +87,7 @@
       }
   
       public Object clone() {
  -	final IntegerArray clone = new IntegerArray(_array);
  -	clone._free = _free;
  -	return clone;
  +	return new IntegerArray(_array);
       }
   
       public int[] toIntArray() {
  @@ -107,24 +105,23 @@
       }
   
       public int indexOf(int n) {
  -	for (int i = 0; i < _free; i++) {
  -	    if (n == _array[i]) return i;
  -	}
  +	for (int i = 0; i < _free; i++)
  +	    if (n == _array[i])
  +		return i;
   	return -1;
       }
   
       public final void add(int value) {
  -	if (_free == _size) {
  +	if (_free == _size)
   	    growArray(_size * 2);
  -	}
   	_array[_free++] = value;
       }
     
       /** adds new int at the end if not already present */
       public void addNew(int value) {
  -	for (int i = 0; i < _free; i++) {
  -	    if (_array[i] == value) return;  // already in array
  -	}
  +	for (int i = 0; i < _free; i++)
  +	    if (_array[i] == value)	// already in array
  +		return;
   	add(value);
       }
   
  @@ -166,8 +163,7 @@
   	    }
   	    out.println(_array[_free - 1]);
   	}
  -	else {
  +	else
   	    out.println("IntegerArray: empty");
  -	}
       }
   }
  
  
  
  1.1.16.1  +2 -2      xml-xalan/java/src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
  
  Index: JavaCupRedirect.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/util/JavaCupRedirect.java,v
  retrieving revision 1.1
  retrieving revision 1.1.16.1
  diff -u -r1.1 -r1.1.16.1
  
  
  

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