You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by zo...@apache.org on 2004/11/16 20:57:17 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler CallTemplate.java

zongaro     2004/11/16 11:57:17

  Modified:    java/src/org/apache/xalan/xsltc/compiler CallTemplate.java
  Log:
  Patch for bug report XALANJ-1994.
  
  The CallTemplate.getCalleeTemplate() method was searching through a Vector of
  all templates defined by the logical stylesheet, and picked out the first with
  the same name referenced by the current xsl:call-template instruction.  However,
  that failed to account for import precedence.  The SymbolTable.lookupTemplate
  method takes into account import precedence, and should be used instead.
  
  Patch was reviewed by Christine Li (jycli@ca.ibm.com)
  
  Revision  Changes    Path
  1.19      +5 -12     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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- CallTemplate.java	24 Feb 2004 02:57:28 -0000	1.18
  +++ CallTemplate.java	16 Nov 2004 19:57:17 -0000	1.19
  @@ -184,17 +184,10 @@
        * template is not a simple named template.
        */
       public Template getCalleeTemplate() {
  -    	Stylesheet stylesheet = getXSLTC().getStylesheet();
  -    	Vector templates = stylesheet.getAllValidTemplates();
  -        
  -    	int size = templates.size();
  -    	for (int i = 0; i < size; i++) {
  -    	    Template t = (Template)templates.elementAt(i);
  -    	    if (t.getName() == _name && t.isSimpleNamedTemplate()) {
  -    	    	return t;
  -    	    }
  -    	}
  -    	return null;
  +    	Template foundTemplate
  +            = getXSLTC().getParser().getSymbolTable().lookupTemplate(_name);
  +
  +        return foundTemplate.isSimpleNamedTemplate() ? foundTemplate : null;
       }
       
       /**
  
  
  

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