Page 1 of 1

Using a customer TransformerFactory

Posted: Mon Nov 14, 2005 5:20 pm
by timjohncarpenter
I am trying to use a custom TransformerFactory when debugger XSL transformations using Oxygen. Reason is that I need to use a specal URIResolver to find some imported templates that might live in various different directories and the resolver needs to go and search for them.

I created by TransformerFactory, an extension of the xerces TransformerFactoryImpl, and and my URIResolver and put the classes into oxygen/classes and added this directory to the class path in oxygen.bat

I set the javax.xml.transform.TransformerFactory property in the Options .. Preferences .. XSLT Options panel but when I run a transformation from the editor perspective or the debugger perspective my TransformerFactory is not used.

Is there anything else I need to do?

Thanks.

Re: Using a customer TransformerFactory

Posted: Mon Nov 14, 2005 6:41 pm
by sorin_ristache
Hello,
timjohncarpenter wrote:I am trying to use a custom TransformerFactory when debugger XSL transformations using Oxygen. Reason is that I need to use a specal URIResolver to find some imported templates that might live in various different directories and the resolver needs to go and search for them.
The bad news is that debugging can be performed only with the transformers listed in the transformers combo of the XSLT Debugger perspective :(

- for XSLT 1.0: Saxon 6.5.4, Saxon 8 B, Saxon 8 SA, Xalan

- for XSLT 2.0: only Saxon 8 B or Saxon 8 SA.

The limitation comes from the fact that there is no standard debugging API so the transformers need to be unified under the same GUI interface in a specific way different for each of them.

The good news :D is that you have control over the location where the imported templates or other documents (using the document() function) are loaded: map the URIs used in the XSLT stylesheet to the imported stylesheets that you want using XML catalogs. You will find many posts with instructions about using XML catalogs on this forum.
timjohncarpenter wrote:I set the javax.xml.transform.TransformerFactory property in the Options .. Preferences .. XSLT Options panel but when I run a transformation from the editor perspective or the debugger perspective my TransformerFactory is not used.
XSLT Options are not applied to the debugger. The debugger options are grouped in the Debugger panel. Please read the User Manual section about the debugger options.

Best regards,
Sorin

Posted: Mon Nov 14, 2005 7:52 pm
by george
Hi,

Please note that adding something to the classpath in the batch file will not make that visible to oXygen, you need to place what you want to add in the lib folder and oXygen will load automatically the classes from all the jars present there (and also the lib folder itself is in the oXygen classpath).

Best Regards,
George

Posted: Mon Nov 14, 2005 7:53 pm
by george
Ahh, I forgot to point you to the article from our documentation page that describes how to set up a transformer through JAXP:
http://www.oxygenxml.com/doc/HowToConfi ... former.pdf

Best Regards,
George