Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to check for the version of Saxon? #317

Open
ndw opened this issue May 26, 2021 · 5 comments
Open

Is it possible to check for the version of Saxon? #317

ndw opened this issue May 26, 2021 · 5 comments

Comments

@ndw
Copy link
Owner

ndw commented May 26, 2021

If you try to combine Saxon 9 with the XML Calabash release for Saxon 10, or vice versa, bad things happen.

Is it possible to check this before the bad things happen?

@fgeorges
Copy link

Hi Norm. What I used on a project is simply to use net.sf.saxon.Version methods, they have not changed in years, and it was enough for my needs at the time.

https://www.saxonica.com/documentation10/index.html#!javadoc/net.sf.saxon/Version

@michaelhkay
Copy link

I think that if you have more than one version of the Saxon classes on the classpath, it's very unpredictable which is going to be loaded, and in general you get a mixture of the two, which causes something random to fall over (eventually). It also means it's unpredictable which version of net.sf.saxon.Version you're going to pick up if there's more than one.

@ndw
Copy link
Owner Author

ndw commented May 26, 2021

Yes, the version properties that @fgeorges identifies are the ones I had in mind. And I understand that it's unpredictable which will be found first by the classloader.

If I expect 9 and get 9, or expect 10 and get 10, I'll assume things are going to be ok. Maybe they'll fall over later, that's as it will be. But if I expect 9 and get 10, or vice versa, I'd like to give a better error message than you get when the APIs collide.

@ndw
Copy link
Owner Author

ndw commented May 26, 2021

I guess my issue title is misleading. I know it's possible to check the version. What I am unsure about is whether I can put that check into the process before an API missmatch throws up a security exception or class not found error.

@ndw
Copy link
Owner Author

ndw commented Jun 12, 2021

Curiously, XML Calabash doesn't seem to know if it's the 9.9 edition or the 10.0 edition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants