mmidy       00/09/20 13:24:49

  Modified:    src/org/apache/xalan/xslt KeyTable.java Stylesheet.java
               src/org/apache/xalan/xslt/res XSLTErrorResources.java
  Log:
  No longer support recursive key()(addendum to XSLT1.1). Improve performance.
  
  Revision  Changes    Path
  1.16      +7 -5      xml-xalan/src/org/apache/xalan/xslt/KeyTable.java
  
  Index: KeyTable.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/KeyTable.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- KeyTable.java     2000/08/18 20:57:22     1.15
  +++ KeyTable.java     2000/09/20 20:24:47     1.16
  @@ -64,6 +64,8 @@
   import org.apache.xalan.xpath.XPathSupport; 
   import org.apache.xalan.xpath.KeyDeclaration;
   import org.apache.xalan.xpath.xml.XMLParserLiaisonDefault;
  +import org.apache.xalan.xslt.res.XSLTErrorResources;
  +import org.apache.xalan.xpath.xml.XSLMessages;
   
   // import org.apache.xalan.xpath.dtm.*;
   
  @@ -103,7 +105,7 @@
      * @param xmlLiaison The parser liaison for support of 
getNodeData(useNode).
      */
     KeyTable(Node doc, Node startNode, 
org.apache.xalan.xpath.xml.PrefixResolver nscontext, 
  -           String name, Vector keyDeclarations, XMLParserLiaison xmlLiaison)
  +           Vector keyDeclarations, XMLParserLiaison xmlLiaison)
      throws org.xml.sax.SAXException
     {    
       m_docKey = doc;
  @@ -292,15 +294,15 @@
             {
               KeyDeclaration kd = (KeyDeclaration)keyDeclarations.elementAt(i);
               
  -            if(!kd.m_name.equals(name)) 
  -              continue;
  +            //if(!kd.m_name.equals(name)) 
  +            //  continue;
               // We are currently processing this key declaration.
               // More than likely, the key function was called in the 
               // xsl:key declaration using the same key name.
               //if( kd.m_buildState == KeyDeclaration.BUILDING)
               if (execContext.getInConstruction(kd))
               {
  -              return;
  +                                                     throw new 
org.xml.sax.SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_KEY_CALL,
 null));
                 // break;
               }  
               //kd.m_buildState = KeyDeclaration.BUILDING;
  @@ -408,7 +410,7 @@
               
               //kd.m_buildState = KeyDeclaration.BUILT;
               execContext.endConstruction(kd);
  -            break;
  +            //break;  
   
             } // end for(int i = 0; i < nDeclarations; i++)
             nodeIndex++;
  
  
  
  1.35      +1 -1      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.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Stylesheet.java   2000/06/22 04:43:17     1.34
  +++ Stylesheet.java   2000/09/20 20:24:47     1.35
  @@ -1141,7 +1141,7 @@
         }
         if((null == nl || nl.getLength() == 0) && !foundDoc && 
m_needToBuildKeysTable)
         {
  -        KeyTable kt = new KeyTable(doc, doc, nscontext, name, 
m_keyDeclarations,
  +        KeyTable kt = new KeyTable(doc, doc, nscontext, m_keyDeclarations,
                                      tcontext.m_parserLiaison);
           tcontext.m_key_tables.addElement(kt);
           if(doc == kt.m_docKey)
  
  
  
  1.24      +6 -1      
xml-xalan/src/org/apache/xalan/xslt/res/XSLTErrorResources.java
  
  Index: XSLTErrorResources.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/src/org/apache/xalan/xslt/res/XSLTErrorResources.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- XSLTErrorResources.java   2000/08/17 18:31:41     1.23
  +++ XSLTErrorResources.java   2000/09/20 20:24:48     1.24
  @@ -76,7 +76,7 @@
   public static final String ERROR_SUFFIX = "ER";  
   public static final String WARNING_SUFFIX = "WR";
   
  -public static final int MAX_CODE = 104;                  // this is needed 
to keep track of the number of messages          
  +public static final int MAX_CODE = 105;                  // this is needed 
to keep track of the number of messages          
   public static final int MAX_WARNING = 26;             // this is needed to 
keep track of the number of warnings
   public static final int MAX_OTHERS = 41;
   public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING +1;
  @@ -635,6 +635,11 @@
   public static final int ER_IN_ELEMTEMPLATEELEM_READOBJECT = 104;
   static {contents[ER_IN_ELEMTEMPLATEELEM_READOBJECT][1] 
             = "In ElemTemplateElement.readObject: {0}";      
  +}
  +
  +public static final int ER_INVALID_KEY_CALL = 105;
  +static {contents[ER_INVALID_KEY_CALL][1] 
  +          = "Invalid function call: recursive key()calls are not allowed";   
   
   }
   
   // Warnings...
  
  
  

Reply via email to