Hi, Ulrich.

"Ulrich Heeger" <[EMAIL PROTECTED]> wrote on 2007-01-26 05:34:21 AM:
> I have a problem. Previously I had no problem to add a node as parameter 
to
> the XSLT-Processor like:
> 
> TransformerFactory tFactory =  TransformerFactory.newInstance();
> Transformer transformer = tFactory.newTransformer(new 
StreamSource(xsl));
> Document doc =
> DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
> Element node = doc.createElement("Root");Element child =
> doc.createElement("NAME");
> child.appendChild(doc.createTextNode("MyName"));
> node.appendChild(child);
> transformer.setParameter("Node", node);

> now I want use translets:
> When calling the transformation process within my translet I get 
something
> like following exception:
> 
> javax.xml.transform.TransformerException: java.lang.RuntimeException: 
Not
> valid conversion from 'org.apache.xerces.dom.ElementImpl' to 'node-set'
> 
> Do you know what is wrong?

This is a known limitation of XSLTC.  See, for instance, Jira issue 
XALANJ-2057.[1]

One workaround would be to use the document function inside your 
stylesheet with a URI of your choosing.  Then install a URIResolver on the 
Transformer.  The URIResolver.resolve method should be implemented to look 
for that URI and return a DOMSource like the one you've described above.

I hope that helps.

Thanks,

Henry
[1] https://issues.apache.org/jira/browse/XALANJ-2057
------------------------------------------------------------------
Henry Zongaro      XSLT Processors Development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:[EMAIL PROTECTED]

Reply via email to