Is there an alternative for using the sitemap as a way to pass objects to
parameters defined in a xslt   ?
In my old code I called something like
myTransformer.setParameter("mychecker", theChecker);

on my transformer.  Don't know how to simulate this in Cocoon ....

Wouter

-----Original Message-----
From: Ralph Goers [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 04, 2004 16:55
To: '[EMAIL PROTECTED]'
Subject: RE: Problems with Java extension in cocoon 2.1.4


You can't pass objects in the sitemap, only strings.  So the value
associated with mychecker is the result of the toString() method of
{session:mychecker}

Ralph

 -----Original Message-----
From:   [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent:   Thursday, March 04, 2004 5:45 AM
To:     [EMAIL PROTECTED]
Subject:        Problems with Java extension in cocoon 2.1.4


Hello,

I try to call a Java method on an class (called producer.IPMChecker)  from
within a xslt.  The object on which the method is called is passed to the
xslt as a parameter in the sitemap like this:


<map:match pattern="prodwrite">
<map:generate src="test.xml"/>
<map:transform type="xslt" src="cocoon:/prodvalidxslt">
<map:parameter name="mychecker" value="{session:mychecker}"/>
</map:transform>
<map:serialize/>
</map:match>

And in the stylesheet itself I have:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
        
xmlns:IPMChecker="xalan://producer.IPMChecker">
        <xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>

        <xsl:param name="mychecker"/>
....

<xsl:value-of select="IPMChecker:getIdAnswers($mychecker)"
disable-output-escaping="yes"/>

...


I each time get an exception of the form:


java.lang.RuntimeException: java.lang.NoSuchMethodException: For extension
function, could not find method
producer.IPMChecker.getIdAnswers([ExpressionContext,] #STRING).
Checked both static and instance methods.       
at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3411)

at
org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerH
andlerImpl.java:427)    
at
org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:91)

at
org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer
.java:583)      
at
org.apache.cocoon.components.sax.XMLTeePipe.endDocument(XMLTeePipe.java:102)

at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)

at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)

at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)    
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)         
...


However, the method getIdAnswers without any arguments does exist on the
class producer.IPMChecker 

Does anyone has an idea ?

Thanks a lot !

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to