eerohele / saxon-gradle

A Gradle plugin for running XSLT transformations with Saxon
MIT License
16 stars 6 forks source link

support --multipleSchemaImports #10

Closed lionelmoi closed 6 years ago

lionelmoi commented 6 years ago

I am using saxon Enterprise Edition to perform schema-aware transformation.

Because of the structure of my schemas I have to import them several times and therefore get the following kind of message:

Warning at xs:import on line 11 column 56 of relationships.xsd:
  The schema document at technical_data_structure.xsd is not being read because schema
  components for this namespace are already available. To force the schema document to be
  read, set --multipleSchemaImports:on

I do not think it is possible to set --multipleSchemaImports:on with saxon-gradle.

eerohele commented 6 years ago

You're right, it's not.

I'll need to go through the available options for the paid Saxon editions and add support for those in the plugin. Shouldn't be a big job.

eerohele commented 6 years ago

It looks like Saxon doesn't actually have a command-line option called -multipleSchemaImports.

Can you find anything in the Saxon documentation that would correspond with that option?

eerohele commented 6 years ago

Oh, maybe it's just undocumented…? Saxon does indeed seem to recognize --multipleSchemaImports:on (with two dashes).

eerohele commented 6 years ago

Looks like you can set it in the Saxon configuration file. Have you given that a go?

lionelmoi commented 6 years ago

The config file is ok when you have a specific config file for a transform, it gets more complicated when you have different configurations for different transforms...

I have tried it and it works, but setting the option from the plugin would be a plus in certain situation I think.

eerohele commented 6 years ago

I understand.

I think adding support for passing in options as described in the last paragraph on this page is the way to go.

lionelmoi commented 6 years ago

Yep, that would do the trick đŸ˜„

eerohele commented 6 years ago

0.5.0 adds support for the multipleSchemaImports option, among other things.

Can you give it a go and let me know whether it works for you?

lionelmoi commented 6 years ago

multipleSchemaImports works. I have not tested the others.

eerohele commented 6 years ago

Great, good to hear! I'll close this issue.