mmidy       00/10/12 13:56:58

  Modified:    src/org/apache/xalan/xslt Stylesheet.java
  Log:
  Process top level elements (i.e variables, parameters) by order of importance
  
  Revision  Changes    Path
  1.36      +14 -10    xml-xalan/src/org/apache/xalan/xslt/Stylesheet.java
  
  Index: Stylesheet.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/Stylesheet.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- Stylesheet.java   2000/09/20 20:24:47     1.35
  +++ Stylesheet.java   2000/10/12 20:56:56     1.36
  @@ -637,7 +637,7 @@
         }
       }
       // Build a table of aliases, the key is the stylesheet uri and the
  -    // value is the result uri
  +    // value is the result uri 
       if (null != ns && null != ns2)
       {
         if (null == m_prefix_aliases)
  @@ -927,7 +927,8 @@
      */
     void setTopLevelVariable(ElemVariable var)
     {
  -    m_topLevelVariables.addElement(var);
  +             // Insert variables by order of importance.
  +    m_topLevelVariables.insertElementAt(var, 0);
     }
   
     /**
  @@ -936,14 +937,10 @@
     void pushTopLevelVariables(Vector topLevelParams, XSLTEngineImpl 
transformContext)
       throws org.xml.sax.SAXException
     {
  +             // Process parameters and variables by order of importance.
  +             // From most important to least. 
       try
  -    {
  -      int nImports = m_imports.size();
  -      for(int i = (nImports-1); i >= 0; i--)
  -      {
  -        Stylesheet stylesheet = (Stylesheet)m_imports.elementAt(i);
  -        stylesheet.pushTopLevelVariables(topLevelParams, transformContext);
  -      }
  +    {      
         int nVars = m_topLevelVariables.size();
         for(int i = 0; i < nVars; i++)
         {
  @@ -976,6 +973,12 @@
             var.execute(transformContext, transformContext.m_rootDoc, 
transformContext.m_rootDoc, null);
           }
         }
  +                     int nImports = m_imports.size();
  +      for(int i = 0; i < nImports; i++)
  +      {
  +        Stylesheet stylesheet = (Stylesheet)m_imports.elementAt(i);
  +        stylesheet.pushTopLevelVariables(topLevelParams, transformContext);
  +      }
       }
       catch(Exception e)
       {
  @@ -1055,7 +1058,8 @@
       {
         m_attributeSets = new Vector();
       }
  -    m_attributeSets.addElement(attrSet);
  +             // Insert elements by order of importance
  +    m_attributeSets.insertElementAt(attrSet, 0);
     }
   
     /**
  
  
  

Reply via email to