You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Joseph Kesselman <ke...@us.ibm.com> on 2003/05/27 20:50:11 UTC

TrAX and Translets: What am I missing?




I don't see any way to use TrAX to load and run a precompiled translet. We
don't seem to have any examples of doing this, as far as I can tell, either
in the samples directory or in our documentation pages.

Is it just something like "pass the .class file's name to the
TransformerFactory rather than the .xsl file's name"? Is there some other
pluperfectly obvious idiom that I'm staring right past? Or did we really
forget to provide a way to do this?
______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


Re: TrAX and Translets: What am I missing?

Posted by sc...@us.ibm.com.
In a hack in some offline code I'm doing I did:

transformer = new org.apache.xalan.xsltc.trax.TransformerImpl(
                translet, 
(org.apache.xalan.xsltc.trax.TransformerFactoryImpl) tfactory);

That will at least get you a generic transform object.

I think the proper way to do it is:

tfactory.setAttribute("use-classpath", Boolean.TRUE);

which will cause the newTemplates(Source source) method to surmise the 
translet name from the stylesheet name, and load the translet from the 
classpath (I think).

-scott


Joseph Kesselman <ke...@us.ibm.com> wrote on 05/27/2003 02:50:11 PM:

> 
> 
> 
> 
> I don't see any way to use TrAX to load and run a precompiled translet. 
We
> don't seem to have any examples of doing this, as far as I can tell, 
either
> in the samples directory or in our documentation pages.
> 
> Is it just something like "pass the .class file's name to the
> TransformerFactory rather than the .xsl file's name"? Is there some 
other
> pluperfectly obvious idiom that I'm staring right past? Or did we really
> forget to provide a way to do this?
> ______________________________________
> Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
> "The world changed profoundly and unpredictably the day Tim Berners Lee
> got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk
>