Ok... I'm trying to build a Saxon tree straight from XML to return from the resolve call of my own URIResolver.  Here's my code:
        ByteArrayInputStream inBytes = new ByteArrayInputStream(outBytes.toByteArray());    // outBytes contains the XML
        InputSource inSource = new InputSource(inBytes);
        SAXSource saxSource = new SAXSource(inSource);
        TinyBuilder builder = new TinyBuilder();
        return builder.build(saxSource);
When I do this, I get the following exception when I transform:
        at com.icl.saxon.StandardErrorListener.getExpandedMessage(StandardErrorListener.java:180)
        at com.icl.saxon.StandardErrorListener.warning(StandardErrorListener.java:69)
        at com.icl.saxon.Controller.reportRecoverableError(Controller.java:532)
        at com.icl.saxon.functions.Document.makeDoc(Document.java:239)
        at com.icl.saxon.functions.Document.getDocuments(Document.java:134)
        at com.icl.saxon.functions.Document.evaluate(Document.java:70)
        at com.icl.saxon.functions.Document.reduce(Document.java:299)
        at com.icl.saxon.expr.PathExpression.reduce(PathExpression.java:160)
        at com.icl.saxon.expr.NodeSetExpression.evaluate(NodeSetExpression.java:39)
        at com.icl.saxon.style.XSLGeneralVariable.getSelectValue(XSLGeneralVariable.java:251)
        at com.icl.saxon.style.XSLParam.process(XSLParam.java:65)
        at com.icl.saxon.style.XSLStyleSheet.process(XSLStyleSheet.java:626)
        at com.icl.saxon.Controller.transformDocument(Controller.java:1071)
        at com.icl.saxon.Controller.transform(Controller.java:945)
Any ideas?
-----Original Message-----
From: Michael Kay [mailto:michael.h.kay@ntlworld.com]
Sent: Thursday, June 13, 2002 6:23 AM
To: 'David Hooker'
Subject: RE: [saxon] Passing parameters to a transform

Thanks for the guidance.  The 6.5.1 document didn't have that section "Result of an extension function", so I downloaded 7.1 and it was listed there.  I'm assuming that the information is compatible with 6.5.1. 
No, unfortunately, there were changes in 7.1 and support for javax.xml.transform.Source was one of them. For a list of what's in 6.5.1, see the source code: method convertJavaObjectToXPath in class com.icl.saxon.expr.FunctionProxy - sorry about this!
If you want to supply a tree as a parameter in 6.5.1, you'll have to convert it to a Saxon tree first. One way to do this is with a JAXP identity transformation, from a DOMSource (any DOM) to a DOMResult (Saxon DOM).
Michael Kay 
My plan is to get a javax.xml.transform.sax.SAXSource corresponding to my document (which is a dom4J DOM), and pass that as the parameter.  According to extensibility.html, this should work...
  • If the returned value is an instance of javax.xml.transform.Source (other than a NodeInfo), a tree is built from the specified Source object, and the root node of this tree is returned as the result of the function.
    Thanks again.