wlpotter / csv-to-srophe

A set of XQuery modules for converting CSV data to Srophe-compliant TEI XML records. Developed for Syriaca.org
GNU General Public License v3.0
1 stars 1 forks source link

Pass the URI-base as a parameter to the main transform function #36

Open wlpotter opened 3 years ago

wlpotter commented 3 years ago

The only real issue with the current setup is it breaks unit tests when we have a different entity selected in config.xml.

The benefit of the call to the $config:uri-base global variable is it cuts down on redundancy. I suppose this is also achieved if the variable is just passed down through the call stack as a parameter? But it is nice to have something as static as the URI base be stored in a globally-available variable.

The argument against this is it makes the unit tests dependent, which goes against the cardinal purpose of a unit test. I'm not sure of a way to rewrite the tests to get around this, so maybe change the implementation of URI base references?