You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sinming Law <sl...@smallworld.com> on 2000/02/23 16:24:53 UTC

template problem with Xalan in Cocoon 1.6

Hi, I am having problem using Xalan in Cocoon 1.6.  The xsl file (included
in the bottom) has a call-template in there, but when this is used in the
cocoon, it gives me the following error:

org.apache.xalan.xslt.XSLProcessorException: 
	at
org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1520)
	at
org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1429)
	at
org.apache.xalan.xslt.ElemCallTemplate.execute(ElemCallTemplate.java:132)
	at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java, Compiled Code)
	at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java,
Compiled Code)
	at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java, Compiled Code)
	at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java,
Compiled Code)
	at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java, Compiled Code)
	at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java,
Compiled Code)
	at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java, Compiled Code)
	at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java,
Compiled Code)
	at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java, Compiled Code)
	at
org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement
.java:1094)
	at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemp
lateElement.java, Compiled Code)
	at
org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:152
)
	at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java, Compiled Code)
	at org.apache.xalan.xslt.ElemTemplate.execute(ElemTemplate.java:141)
	at org.apache.xalan.xslt.StylesheetRoot.process(StylesheetRoot.java,
Compiled Code)
	at org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java,
Compiled Code)
	at
org.apache.cocoon.transformer.XalanTransformer.transform(XalanTransformer.ja
va:94)
	at
org.apache.cocoon.processor.xslt.XSLTProcessor.process(XSLTProcessor.java:10
3)
	at org.apache.cocoon.Engine.handle(Engine.java, Compiled Code)
	at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
	at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
	at org.apache.jserv.JServConnection.run(JServConnection.java:188)
	at java.lang.Thread.run(Thread.java:479)

The error message that was printed in the apache log is: 

XSL Error: Could not find template named: crm_reg
XSL Error: SAX Exception

I have tried the command line Xalan, and that works.  Is it because Cocoon
is using a different XSLT processor?  But from the error message, it seems
that it has directed to the xalan xslt processor successfully, although it
is not recognizing the template.  This is part of my cocoon file:


# Apache Xalan (http://xml.apache.org/)
transformer = org.apache.cocoon.transformer.XalanTransformer

# XSL Transformations (XSLT)
processor.type.xslt = org.apache.cocoon.processor.xslt.XSLTProcessor


This is the xsl file. The call-template is near the middle.  Any help is
appreciated. Thank you!

Sinming Law



<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	
<xsl:import
href="http://localhost/politics_game/xsl_libraries/library.xsl"/>
<xsl:import
href="http://localhost/politics_game/xsl_libraries/crm_reg.xsl"/>

<xsl:template match="/">
	<xsl:apply-templates/>
</xsl:template>

	<xsl:template match="PAGE">
	<html>
		<table width="628" cellpadding="0" cellspacing="0"
border="0">
			
				
        	<tr>
				<td valign="top" align="center">
				<xsl:call-template name="crm_reg"/>
					<br/>
				</td>
			</tr>
		</table>

</html>		
</xsl:template>

</xsl:stylesheet>	


Re: template problem with Xalan in Cocoon 1.6

Posted by Mike Engelhart <me...@earthtrip.com>.
Sinming Law wrote:

> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 
> <xsl:import href="http://localhost/politics_game/xsl_libraries/library.xsl"/>
> <xsl:import href="http://localhost/politics_game/xsl_libraries/crm_reg.xsl"/>
You don't show the contents of the crm_reg.xsl file so it's hard to say.

Is there a 
<xsl:template name="crm_reg.xsl">

</xsl:template>

in the file located at:
/politics_game/xsl_libraries/crm_reg.xsl
??

Mike