Trying:
   public void setParams(org.w3c.dom.Element docInput)
 
produces:

Fatal error: Error in call to extension function {public void com.xslroot.servlet.transform.SessionParams.setParams(org.w3c.dom.Element) throws java.lang.ClassNotFoundException,java.io.IOException}: Cannot convert supplied XPath value to the required type for the extension function;

And no, it didn't actually work in the past with the parameter type org.jdom.Element. It did work in Saxon 7.8 with type org.w3c.dom.Element which doesn't work now.

Is org.w3c.dom.Element the wrong type here?

Roger Kovack

Michael Kay wrote:
A node constructed in your stylesheet will always use the TinyTree
implementation. For DOM, there's a wrapper interface available that makes a
TinyTree node look like a DOM node, so calling an extension function that
expects a DOM node is OK. There's no equivalent for JDOM (or XOM or DOM4J).
I'm surprised that setParams(Object x) doesn't work, but the object you got
would be a Saxon NodeInfo. I'm also surprised that you say it worked in the
past: Saxon has only ever supported read access to JDOM.

Michael Kay
http://www.saxonica.com/

  
-----Original Message-----
From: saxon-help-bounces@lists.sourceforge.net 
[mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf 
Of Roger Kovack
Sent: 06 September 2006 21:48
To: Mailing list for SAXON XSLT queries
Subject: [saxon] Pass an element to an extension function

Using Saxon 8.8  (This works great in Saxon 7.8)  From the stylesheet:
        <xsl:variable name="newParam">
            <doc>
                <act/>
                <xsl:copy-of select="$params/(login | username)"/>
            </doc>
        </xsl:variable>
        <xsl:value-of select="session:setParams($httpSession, 
$newParam)"/>

To the java:
   public void setParams(org.jdom.Element docInput)

returns

Fatal error: Error in call to extension function {public void
com.xslroot.servlet.transform.SessionParams.setParams(org.jdom
.Element)
throws java.lang.ClassNotFoundException,java.io.IOException}: 
Cannot convert supplied XPath value to the required type for 
the extension function;

Checking the archives, I've also tried
   public void setParams(Object docInput)
   public void setParams(List docInput)

with the same results. The directory that contains saxon8.jar 
also contains saxon8-dom.jar, saxon8-jdom.jar, 
saxon8-xom.jar. Should I try a different parameter type? 
Would XOM be more likely to work?

Thanks again!

Roger Kovack


--------------------------------------------------------------
-----------
Using Tomcat but need to do more? Need to support web 
services, security?
Get stuff done quickly with pre-integrated technology to make 
your job easier Download IBM WebSphere Application Server 
v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&
dat=121642
_______________________________________________
saxon-help mailing list
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help
    


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
saxon-help mailing list
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help