XSLT validation scenario with Saxon initializer class

Here should go questions about transforming XML with XSLT and FOP.
Patrik
Posts: 216
Location: Hamburg/Germany

XSLT validation scenario with Saxon initializer class

Thu Mar 09, 2017 11:26 am

Hi,

I have configured a transformations scenario using a Saoxn initializer class to register a custom extension function. When validating the root file being used by this transformaton scenario the validation works fine.

I also created a validation scenario for xslt files included by this root file and set the file to be validated accordingly. Now when validating using this validations cenario I get an error that my custom function is unknown. But in the validtion scenario I foundno place to configure my Saxon initializer!?

Thanks and regards,
Patrik
alex_jitianu
Posts: 600

Re: XSLT validation scenario with Saxon initializer class

Thu Mar 09, 2017 5:29 pm

Hi Patrik,

Currently you can't set Saxon options in a validation scenario. In the version 19 (to be released in mid April) though, things will be better: we will detect the transformation scenario associated with the master and we will use it when validation. All you will have to do in the validation unit is to have to use <Default engine> as the engine used to validate the master.

Unfortunately, right now I don't see an easy solution for your use case because the Initializer class can only be set in the scenario options.

Best regards,
Alex
Patrik
Posts: 216
Location: Hamburg/Germany

Re: XSLT validation scenario with Saxon initializer class

Fri Mar 10, 2017 12:45 pm

Hi Alex,

thanks for the information.

Im just wondering if it wouldn't be easier to implement (and teasier to understand for a user) if you would allow to set Saxon configurations in a validation scenario as well. Especially since there are use-cases when you don't have a transformation scenario at all. For instance I have some XSLT code that is only being executed from my custom Java code (be it as oXygen or DITA-OT plugin). Of course I could still just create a dummy transformation scenario that will never be executed and is just to handle the validation correctly - it just doesn't feel straight forward.

Regards,
Patrik
alex_jitianu
Posts: 600

Re: XSLT validation scenario with Saxon initializer class

Fri Mar 10, 2017 4:13 pm

Hi Patrik,

I agree. Having a Saxon configuration inside the validation scenario itself is the proper way to handle such situations. I've also added an issue for this feature but it's not going to make it in version 19 (development is currently frozen).

Best regards,
Alex

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest