Hi Christian --

Adding the path to Saxon to a shell environment variable CLASSPATH didn't
work. There was no pre-existing CLASSPATH, so I suspect the current Fedora
Java setup is doing something clever somewhere, and I'd have to go
comprehend it.  Since I expect to be deploying this particular bit of BXS
and XQuery on various platforms, I would like to keep the solution as much
"inside" BaseX as possible.

It will probably be the case that I'm going to want to run the transform
with either Saxon-EE or Saxon-PE when both are available.  So having some
way to select a transformer would be welcome.  Some way to specify
extensions that should be added to the class path would also be welcome.
(We have, for example, a little bit of java that is used to return image
properties being used in the XSLT, and that has to go on the classpath
somehow.)

Related to this, setting the catalog for use by xslt:transform() is
defeating me.

https://docs.basex.org/wiki/Catalog_Resolver provides an example:
(# db:catfile xmlcatalog/catalog.xml #) {
  xslt:transform(db:open('acme_content')[1], '../acmecustom/acmehtml.xsl')
}
https://docs.basex.org/wiki/Options#CATFILE suggests I might want the full
path. (But no.)  Relative path relative to the xquery file? no.
document-uri of the catalog as loaded into the context db? Also no.  No
matter which of these options I try, I get the same "File not found"
exception about the system component of the doctype. The exact catalog I am
attempting to reference is in production on multiple systems, so I am
disinclined to think it's got an error.

What am I doing wrong with the catalog?  Is there a better means of saying
"use this one with this transform"?   Some way to pass the catalog
parameter through to Saxon?

Thanks!
Graydon


On Thu, Nov 4, 2021 at 3:36 AM Christian Grün <christian.gr...@gmail.com>
wrote:

> Hi Graydon,
>
> > I can get xslt:transform() to pick up a licensed saxon if I go into the
> appropriate script (basexgui, etc.) and add it to the class path there.
> (but not, oddly, from the environment class path on Linux.) That's going to
> be annoying as BaseX updates with laudable frequency.
>
> Saxon must be found in the Java classpath in order to be used. I
> assume that’s not the case if it’s added to the environment class path
> on Linux (but I may be wrong: How do you proceed here?).
>
> If you use a full distribution of BaseX, you can simply place Saxon in
> the lib/custom directory; there’ll be no need then to modify the
> classpath.
>
> > Is there some way, particularly in the context of a BXS file or as an
> option to xslt:transform(), to set which transformer I want to use?
>
> If multiple transformers are available, we could possibly add such an
> option. We haven’t done so yet, as most users who add Saxon to the
> classpath want to use it exclusively.
>
> Hope this helps,
> Christian
>

Reply via email to