xalan-j-users@xml.apache.org
[Top] [All Lists]

Re: usage of compiled translet without original xslt-file

Subject: Re: usage of compiled translet without original xslt-file
From: Henry Zongaro
Date: Mon, 17 Dec 2007 09:48:15 -0500

Hi, Thomas.

tm001 <tm001@xxxxxxxxxxxxxx> wrote on 2007-12-17 09:07:50 AM:
> how am i supposed to use my compiled translet class in a java application? i
> found no documentation about that issue, but only how to do this from the
> cmdline.

I think you're looking for the XSLTC TransformerFactory "use-classpath" attribute.  See [1] for documentation on the attribute itself.

If you have program segment that looks like the following, XSLTC will attempt to load a translet class named "mystylesheet" from the class path instead of reading the file mystylesheet.xsl and compiling that into a class file.

TransformerFactory tf = TransformerFactory.newInstance();
tf.setAttribute("use-classpath", Boolean.TRUE);
Transformer t = Transformer.newTransformer(new StreamSource("mystylesheet.xsl"));

I hope that helps.

Thanks,

Henry

[1] http://xml.apache.org/xalan-j/xsltc_usage.html#api-attributes
------------------------------------------------------------------
Henry Zongaro      XSLT Processors Development
IBM SWS Toronto Lab   T/L 313-6044;  Phone +1 905 413-6044
mailto:zongaro@xxxxxxxxxx


<Prev in Thread] Current Thread [Next in Thread>