[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Followup about Saxon-HE and Oracle Unified Directo

Subject: Re: Followup about Saxon-HE and Oracle Unified Directory (OUD) problem
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 24 Aug 2023 21:50:58 -0000
Re:  Followup about Saxon-HE and Oracle Unified Directo
For reference the SO thread is here:

https://stackoverflow.com/questions/76971336/

>
> Michael has posted some comment on my SO topic, but I am still a little
puzzled about why just having Saxon-HE in the dependencies is causing the OUD
instance itself to fail to start, and also how, or even "if" it is possible to
get it to work?
>
...
>
> Comparing the above and what Michael has said on SO, I am wondering if I
added the Saxon-HE dependency back to the plugin code, but also added a line
to plugin code like:
>
> System.setProperty("javax.xml.transform.TransformerFactory",
"net.sf.saxon.TransformerFactoryImpl");
>
> Would THAT eliminate the problem and allow the OUD instance to start AND the
XSLT being used in the plugin to also work?
>

Sorry if I haven't managed to explain it to you (but I'm not sure that forking
the discussion to a different forum is going to be helpful).

Getting your own code to use Saxon isn't going to be a problem. You can either
instantiate the Saxon TransformerFactory explicitly (using `new
net.sf.saxon.TransformerFactoryImpl()`) or you can use Saxon's s9api interface
instead of JAXP.

Your challenge is to ensure that the code in OUD, over which you have no
control, DOESN'T use Saxon when you add Saxon to the classpath. It's a design
weakness of the JAXP API that when code calls
"TransformerFactory.newInstance()` it gets whatever XSLT engine it finds on
the classpath, and unless the application code was written to be completely
portable, that can cause a failure, which is almost certainly what is
happening in this case. For example, it will cause a failure if the stylesheet
that is invoked contains any Xalan extensions.

You definitely don't want to set the system property
"javax.xml.transform.TransformerFactory" to the Saxon TransformerFactory, you
want to set it to the TransformerFactory that OUD is expecting to use
internally, which is probably Xalan.

Without knowing OUD, it's impossible to say whether setting the system
property from the plugin is going to set it early enough to have any effect.
The safest way would be to set it using the -D option on the command line at
the time the Java VM is initialized.

Michael Kay
Saxonica

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.