zongaro     2003/08/27 10:38:28

  Modified:    java/src/org/apache/xalan/xsltc/compiler Stylesheet.java
  Log:
  Applying patch for bug 19973 from Christine Li ([EMAIL PROTECTED]).
  A call to buildKeys (for xsl:key) should be generated before a call to 
topLevel
  (to handle top-level variable and parameter declarations) because top-level
  variables and parameters can contain references to the key() function, but not
  the other way around.
  
  Revision  Changes    Path
  1.53      +15 -13    
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.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- Stylesheet.java   1 Aug 2003 00:49:26 -0000       1.52
  +++ Stylesheet.java   27 Aug 2003 17:38:28 -0000      1.53
  @@ -1051,6 +1051,20 @@
                                           "("+OUTPUT_HANDLER_SIG+")V");
        il.append(new INVOKEVIRTUAL(index));
   
  +        // Compile buildKeys -- TODO: omit if not needed                
  +        
  +        final String keySig = compileBuildKeys(classGen);
  +        final int    keyIdx = cpg.addMethodref(getClassName(),
  +                                               "buildKeys", keySig);
  +        il.append(classGen.loadTranslet());     // The 'this' pointer
  +        il.append(classGen.loadTranslet());
  +        il.append(new GETFIELD(domField));      // The DOM reference
  +        il.append(transf.loadIterator());       // Not really used, but...
  +        il.append(transf.loadHandler());        // The output handler
  +        il.append(new PUSH(cpg, DTM.ROOT_NODE)); // Start with the root node
  +        il.append(new INVOKEVIRTUAL(keyIdx));
  +
  +
       // Look for top-level elements that need handling
        final Enumeration toplevel = elements();
        if ((_globals.size() > 0) || (toplevel.hasMoreElements())) {
  @@ -1069,18 +1083,6 @@
            il.append(new INVOKEVIRTUAL(topLevelIdx));
        }
        
  -     // Compile buildKeys -- TODO: omit if not needed                
  -     
  -     final String keySig = compileBuildKeys(classGen);
  -     final int    keyIdx = cpg.addMethodref(getClassName(),
  -                                            "buildKeys", keySig);
  -     il.append(classGen.loadTranslet());     // The 'this' pointer
  -     il.append(classGen.loadTranslet());
  -     il.append(new GETFIELD(domField));      // The DOM reference
  -     il.append(transf.loadIterator());       // Not really used, but...
  -     il.append(transf.loadHandler());        // The output handler
  -     il.append(new PUSH(cpg, DTM.ROOT_NODE)); // Start with the root node
  -     il.append(new INVOKEVIRTUAL(keyIdx));
   
   
   
  
  
  

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

Reply via email to