You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Paul O'Neill <Pa...@gradient.ie> on 2001/07/05 13:35:35 UTC

XSLTC: creating a translet (template) object from a precompiled translet ( .class file)

Hi,
	sorry if this is a stupid question but I am trying to resuse Translets
without recompiling the XSL source. (not from command line) and Im wondering
is there some way I can specify a .class file that I want to be used as my
translet object?

e.g
        if(compiledXSLFile.lastModified() < XSLSourceFile.lastModified())
        {
          Templates translet = tFactory.newTemplates(XSLSource);
        }
        else
        {
	    Templates translet = new File(compiledXSLFile); ***what should go
here?*****
	  }

thanks for any help,

Paul.


RE: XSLTC: creating a translet (template) object from a precompiled translet ( .class file)

Posted by Paul O'Neill <Pa...@gradient.ie>.
Hi,
	I have just noticed that it is possible to construct a Transformer from a
Translet class name

         Class transletClass =
Class.forName(getFileNameNoExtension(XSLinURI));
         Transformer transformer = (Transformer)transletClass.newInstance();
	   transformer.transform(XML,output);

would this be any use to you?

Paul.


-----Original Message-----
From: Christian Sunesson [mailto:christian@codesense.com]
Sent: Friday, July 06, 2001 9:31 AM
To: xalan-dev@xml.apache.org
Subject: RE: XSLTC: creating a translet (template) object from a
precompiled translet ( .class file)



I've been awaiting an answer to your question for a while, because I want
something similar. I would like to look up a Translet class name, and
construct a Templates object from that, thus eleminating compilation.

What have stopped me so far is that I do not want to put effort into
a solution that wont be supported by following XalanJ releases. Is there
any API for this that will go into XalanJ and that will stay?

i.e.

Class transclass = Class.forName(transclass);
Translet translet = (Translet)transclass.newInstance();
Templates template = new TransletTemplates(translet);


-----Original Message-----
From: Paul O'Neill [mailto:Paul.ONeill@gradient.ie]
Sent: den 5 juli 2001 13:36
To: xalan-dev@xml.apache.org
Subject: XSLTC: creating a translet (template) object from a precompiled
translet ( .class file)
Importance: High


Hi,
	sorry if this is a stupid question but I am trying to resuse Translets
without recompiling the XSL source. (not from command line) and Im wondering
is there some way I can specify a .class file that I want to be used as my
translet object?

e.g
        if(compiledXSLFile.lastModified() < XSLSourceFile.lastModified())
        {
          Templates translet = tFactory.newTemplates(XSLSource);
        }
        else
        {
	    Templates translet = new File(compiledXSLFile); ***what should go
here?*****
	  }

thanks for any help,

Paul.



RE: XSLTC: creating a translet (template) object from a precompiled translet ( .class file)

Posted by Christian Sunesson <ch...@codesense.com>.
I've been awaiting an answer to your question for a while, because I want
something similar. I would like to look up a Translet class name, and
construct a Templates object from that, thus eleminating compilation.

What have stopped me so far is that I do not want to put effort into
a solution that wont be supported by following XalanJ releases. Is there
any API for this that will go into XalanJ and that will stay?

i.e.

Class transclass = Class.forName(transclass);
Translet translet = (Translet)transclass.newInstance();
Templates template = new TransletTemplates(translet);


-----Original Message-----
From: Paul O'Neill [mailto:Paul.ONeill@gradient.ie]
Sent: den 5 juli 2001 13:36
To: xalan-dev@xml.apache.org
Subject: XSLTC: creating a translet (template) object from a precompiled
translet ( .class file)
Importance: High


Hi,
	sorry if this is a stupid question but I am trying to resuse Translets
without recompiling the XSL source. (not from command line) and Im wondering
is there some way I can specify a .class file that I want to be used as my
translet object?

e.g
        if(compiledXSLFile.lastModified() < XSLSourceFile.lastModified())
        {
          Templates translet = tFactory.newTemplates(XSLSource);
        }
        else
        {
	    Templates translet = new File(compiledXSLFile); ***what should go
here?*****
	  }

thanks for any help,

Paul.