icatproject/python-icat

Make it easier to configure custom XSLT files for processing the input to icat.ingest.IngestReader

Closed this issue · 0 comments

The input data format that class icat.ingest.IngestReader accepts may be changed by providing customized XSD and XSLT files. This is controlled by the methods get_xsd() and get_xslt() that may inspect the input data and return the path of an XSD and XSLT file respectively to process that data.

The provided default version of get_xsd() is controlled by a class variable XSD_Map that maps tuples of element name and version attribute of the root element in the input data to an XSD file name. In the current version, get_xslt() returns a static file name that is controlled by the class variable XSLT_name. This is based on the assumption that XSLT is powerful enough in itself that a single file may be sufficient to cover all input variants.

This design decision now proves inconvenient for implementing a custom ingest reader class that should only add their own input data variants additional to the standard format already defined by python-icat. Because if only one single custom XSLT file is configured, it would need to cover both, the standard and the custom format and would need to be updated with each new standard version implemented by python-icat.