Menu

#422 teitoX: support passing configuration to saxon

AMBER
closed
5(default)
2014-11-18
2013-01-10
No

I'd like sometimes to be able to have saxon do a trace when invoked as part of the teitoX tools. I do not currently see a way to do this. I read saxon's documentation but do not see there a way to cause the saxon instances launched by the teitoX tools to get parameters elsewhere than from the ant task launched by teitoX. In particular, I see no way to set an environment variable that would affect saxon's configuration. Saxon supports a configuration file (since version 9.4 in Saxon-HE) but I do not see in the saxon documentation any default file path for a configuration file. (But this is buggy, see below.) In other words, saxon will not read any configuration file unless told so explicitly.

(Someone could probably hack something together by creating a custom jar and using --saxonjar, but yuck!)

I've experimented with a modified version of teitodocx and a corresponding build-to.xml so as to have saxon read a configuration from a configuration file but I was not able to get it to work because of a bug reported here:

https://saxonica.plan.io/issues/1676

I still think that once the bug fix makes it through latest stable release, this will be the way to go.

In the meantime, I've continued experimenting to obtain at least a trace. I'm attaching some patches to this feature request. This is not a complete solution because if no listener class is specified by the user, then http://saxon.sf.net/feature/traceListenerClass is set to an empty string, which saxon interprets as a class name, which it tries to load and then crashes. This is because if no listener class is specified then the factory net.sf.saxon.TransformerFactoryImpl should be instantiated without any attributes, rather than attributes set to empty strings. Certainly possible to get something nicer but I don't see how to do it without seriously refactoring build-to.xml. (But my ant-fu is very rusty so maybe there's a very simple solution I'm not seeing.) I'd rather not spend more effort on this given that, as I mentioned earlier, the ultimate solution will be to provide support to get saxon to read a configuration file.

Discussion

  • Louis-Dominique Dubeau

     
  • Louis-Dominique Dubeau

     
  • James Cummings

    James Cummings - 2013-11-10
    • Group: --> RED
    • Priority: 5 --> 5(default)
     
  • James Cummings

    James Cummings - 2013-11-10

    Marking as AMBER, needs discussion.

     
  • James Cummings

    James Cummings - 2013-11-13
    • Group: RED --> AMBER
     
  • James Cummings

    James Cummings - 2013-11-13

    Marking as Amber really now.

     
  • Sebastian Rahtz

    Sebastian Rahtz - 2014-11-18
    • status: open --> closed
     
  • Sebastian Rahtz

    Sebastian Rahtz - 2014-11-18

    I think this needs redoing as a pull request on Github Stylesheets, if you dont mind. So I am closing it here. Its a bit beyond me, to be honest