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

register extension function when running within an xproc pipeline #429

Open
frank-steimke opened this issue Oct 31, 2023 · 1 comment
Open

Comments

@frank-steimke
Copy link

Hi,

i try to use the xslTNG Stylesheets within an xproc pipeline with the recent version of xmlcalabash 1 (outside of oxygen). Seems to work, but image sizes are not correct. The docbook-xsltng.jar is part of the classpath. Maybe because the extension functions are not registered?

Is there a way to use and register extension functions when using calabash? Is it possible with the saxon HE edition that is part of the stylesheets?

Greetings, Frank

@ndw
Copy link
Contributor

ndw commented Jan 31, 2024

I'm quite surprised that I haven't implemented a way to do this, but a quick look around in the source code suggests that I have not :-(

In the meantime, you can do it in a Saxon configuration file with a resources element.

The resources section you need is something like this:

 <resources>
    <extensionFunction>org.docbook.xsltng.extensions.Cwd</extensionFunction>
    <extensionFunction>org.docbook.xsltng.extensions.ImageProperties</extensionFunction>
    <extensionFunction>org.docbook.xsltng.extensions.Pygmentize</extensionFunction>
    <extensionFunction>org.docbook.xsltng.extensions.PygmentizeAvailable</extensionFunction>
    <extensionFunction>org.docbook.xsltng.extensions.XInclude</extensionFunction>
    <extensionFunction>org.docbook.xsltng.extensions.ValidateRNG</extensionFunction>
    <extensionFunction>org.docbook.xsltng.extensions.ImageMetadata</extensionFunction>
</resources>

Bearing in mind that ImageMetadata may not initiailize successfully unless the metadata-extractor classes are also on the classpath.

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

2 participants