You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sb...@apache.org on 2003/04/24 01:37:16 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/templates ElemCallTemplate.java

sboag       2003/04/23 16:37:16

  Modified:    java/src/org/apache/xalan/templates ElemCallTemplate.java
  Log:
  Made it a static error in compose(...) if a reference is made to a non-existent template.  Note this might cause some existing stylesheets to not work, since the error would never have been flagged if the code was not run.  Note the old code was marked for %REVIEW%, so I don't think this was ever resolved.  I think it's clear that this should be a static error.
  
  Revision  Changes    Path
  1.24      +14 -7     xml-xalan/java/src/org/apache/xalan/templates/ElemCallTemplate.java
  
  Index: ElemCallTemplate.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemCallTemplate.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- ElemCallTemplate.java	30 Jan 2003 18:45:50 -0000	1.23
  +++ ElemCallTemplate.java	23 Apr 2003 23:37:16 -0000	1.24
  @@ -59,6 +59,7 @@
   import javax.xml.transform.SourceLocator;
   import javax.xml.transform.TransformerException;
   
  +import org.apache.xalan.res.XSLMessages;
   import org.apache.xalan.res.XSLTErrorResources;
   import org.apache.xalan.transformer.TransformerImpl;
   import org.apache.xml.utils.QName;
  @@ -157,13 +158,19 @@
         ewp.compose(sroot);
       }
       
  -    if ((null != m_templateName) && (null == m_template))
  -    {
  -      m_template =
  -        this.getStylesheetRoot().getTemplateComposed(m_templateName);
  -        
  -      if(null == m_template)
  -        return; // %REVIEW% error?
  +	if ((null != m_templateName) && (null == m_template)) {
  +		m_template =
  +			this.getStylesheetRoot().getTemplateComposed(m_templateName);
  +
  +		if (null == m_template) {
  +			String themsg =
  +				XSLMessages.createMessage(
  +					XSLTErrorResources.ER_ELEMTEMPLATEELEM_ERR,
  +					new Object[] { m_templateName });
  +
  +			throw new TransformerException(themsg, this);
  +			//"Could not find template named: '"+templateName+"'");
  +		}
       
         length = getParamElemCount();
         for (int i = 0; i < length; i++) 
  
  
  

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