sboag 99/12/17 17:30:40
Modified: src/org/apache/xalan/xslt ElemCallTemplate.java
Log:
xsl:call-template should not accept an attribute value template, and no
longer does. This was left over from a previous XSLT draft, which specified
that it should accept this.
Revision Changes Path
1.2 +24 -31 xml-xalan/src/org/apache/xalan/xslt/ElemCallTemplate.java
Index: ElemCallTemplate.java
===================================================================
RCS file:
/home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemCallTemplate.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ElemCallTemplate.java 1999/11/08 20:56:18 1.1
+++ ElemCallTemplate.java 1999/12/18 01:30:40 1.2
@@ -64,8 +64,9 @@
public class ElemCallTemplate extends ElemTemplateElement
{
- public AVT m_name_avt = null;
-
+ public QName m_templateName = null;
+ ElemTemplateElement m_template = null;
+
public int getXSLToken()
{
return Constants.ELEMNAME_CALLTEMPLATE;
@@ -85,12 +86,11 @@
String aname = atts.getName(i);
if(aname.equals(Constants.ATTRNAME_NAME))
{
- m_name_avt = new AVT(aname, atts.getType(i), atts.getValue(i),
- this, m_stylesheet, processor);
+ m_templateName = new QName(aname, m_stylesheet.m_namespaces);
}
else if(!isAttrOK(aname, atts, i))
{
- processor.error(XSLTErrorResources.ERROR0002,new Object[]
{name, aname}); //name+" has an illegal attribute: "+aname);
+ processor.error(XSLTErrorResources.ERROR0002,new Object[] {name,
aname}); //name+" has an illegal attribute: "+aname);
}
}
}
@@ -107,36 +107,29 @@
{
super.execute(processor, sourceTree, sourceNode, mode);
XPathSupport execContext = processor.getXMLProcessorLiaison();
- String templateName = m_name_avt.evaluate(execContext, sourceNode, this,
- new StringBuffer());
- if(null != templateName)
+ if(null == m_template)
{
- QName qualifiedTemplName = new QName(templateName, this);
- ElemTemplateElement template
- = processor.m_stylesheetRoot.findNamedTemplate(qualifiedTemplName);
- if(null != template)
- {
- processor.m_variableStacks.pushContextMarker(template, sourceNode);
-
- processor.m_variableStacks.pushParams(processor.getExecContext(),
- m_stylesheet,
- this,
- sourceTree,
- sourceNode, mode, template);
-
- // template.executeChildren(processor, sourceTree, sourceNode, mode);
- template.execute(processor, sourceTree, sourceNode, mode);
-
- processor.m_variableStacks.popCurrentContext();
- }
- else
- {
- processor.error(XSLTErrorResources.ERROR0007, new Object[]
{templateName}); //"Could not find template named: '"+templateName+"'");
- }
+ m_template
+ = processor.m_stylesheetRoot.findNamedTemplate(m_templateName);
+ }
+ if(null != m_template)
+ {
+ processor.m_variableStacks.pushContextMarker(m_template, sourceNode);
+
+ processor.m_variableStacks.pushParams(processor.getExecContext(),
+ m_stylesheet,
+ this,
+ sourceTree,
+ sourceNode, mode, m_template);
+
+ // template.executeChildren(processor, sourceTree, sourceNode, mode);
+ m_template.execute(processor, sourceTree, sourceNode, mode);
+
+ processor.m_variableStacks.popCurrentContext();
}
else
{
- processor.error(XSLTErrorResources.ERROR0008); //"Could not resolve
name AVT in xsl:call-template.");
+ processor.error(XSLTErrorResources.ERROR0007, new Object[]
{m_templateName}); //"Could not find template named: '"+templateName+"'");
}
}