cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Luzyanin <i...@ProZa.Lviv.UA>
Subject XSLT named teplates and xsl:param (is it a BUG?)
Date Thu, 11 Apr 2002 18:34:11 GMT
Hi!

I'm using Cocoon 2.0.2 and Tomcat 3.3.1.

Can anybody explain to me why i can't use 'xsl:param' in 'xsl:if'
clause?

Example:

<xsl:template name="TimeCell">
	<xsl:param name="cssClassNormal">TimeCell</xsl:param>
	<xsl:param name="cssClassWeekEnd">HolidayCell</xsl:param>
	<xsl:param name="dayofweek">
	<!-- Monday -->
		2
	</xsl:param>
	<td class="{$cssClassNormal}">
	<xsl:if test="{$dayofweek}=1 or {$dayofweek}=7">
		<xsl:attribute name="class">{$cssClassWeekEnd}</xsl:attribute>
	</xsl:if>
	<xsl:value-of select="."/>
	</td>
</xsl:template>

it throws:

org.apache.cocoon.ProcessingException: Exception in creating Transform
Handler: javax.xml.transform.TransformerException: Extra illegal tokens:
'{', '$', 'dayofweek}', '=', '1', 'or', '{', '$', 'dayofweek}', '=', '7'
	at
org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XSLTProcessorImpl.java:271)
	at
org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XSLTProcessorImpl.java:204)
	at
org.apache.cocoon.transformation.TraxTransformer.setup(TraxTransformer.java:295)
	at
org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java:215)
	at
org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEventPipeline.java:279)
	at
org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(CachingEventPipeline.java:142)
	at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:320)
	at
org.apache.cocoon.www.sitemap_xmap.matchN101FC(/usr/local/bin/java/jakarta-tomcat-3.3.1/work/DEFAULT/cocoon-dev/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:1569)
	at
org.apache.cocoon.www.sitemap_xmap.process(/usr/local/bin/java/jakarta-tomcat-3.3.1/work/DEFAULT/cocoon-dev/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:1338)
	at
org.apache.cocoon.www.sitemap_xmap.process(/usr/local/bin/java/jakarta-tomcat-3.3.1/work/DEFAULT/cocoon-dev/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:1274)
	at org.apache.cocoon.sitemap.Handler.process(Handler.java:222)
	at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179)
	at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:575)
	at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:998)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java)
	at
org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
	at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
	at org.apache.tomcat.core.Handler.service(Handler.java:235)
	at
org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
	at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
	at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
	at
org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
	at java.lang.Thread.run(Thread.java:484)
; SystemID:
file:/usr/local/bin/java/jakarta-tomcat-3.3.1/webapps/cocoon-dev/transforms/report2html.xsl;
Line#: 162; Column#: 50
javax.xml.transform.TransformerException: Extra illegal tokens: '{',
'$', 'dayofweek}', '=', '1', 'or', '{', '$', 'dayofweek}', '=', '7'
	at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:602)
	at
org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:165)
	at org.apache.xpath.XPath.(XPath.java:217)
	at
org.apache.xalan.processor.StylesheetHandler.createXPath(StylesheetHandler.java:197)
	at
org.apache.xalan.processor.XSLTAttributeDef.processEXPR(XSLTAttributeDef.java:575)
	at
org.apache.xalan.processor.XSLTAttributeDef.processValue(XSLTAttributeDef.java:920)
	at
org.apache.xalan.processor.XSLTAttributeDef.setAttrValue(XSLTAttributeDef.java:1078)
	at
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:375)
	at
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:311)
	at
org.apache.xalan.processor.ProcessorTemplateElem.startElement(ProcessorTemplateElem.java:122)
	at
org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:658)
	at
org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:445)
	at
org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XMLNamespaceBinder.java:832)
	at
org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.java:568)
	at
org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:808)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:752)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1454)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
	at
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:525)
	at
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:581)
	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
	at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1157)
	at
org.apache.avalon.excalibur.xml.JaxpParser.parse(JaxpParser.java:241)
	at
org.apache.cocoon.components.source.AbstractStreamSource.toSAX(AbstractStreamSource.java:206)
	at
org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XSLTProcessorImpl.java:233)
	at
org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XSLTProcessorImpl.java:204)
	at
org.apache.cocoon.transformation.TraxTransformer.setup(TraxTransformer.java:295)
	at
org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java:215)
...


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message