Edirom / MerMEId

Metadata Editor and Repository for MEI Data
https://mermeid.edirom.de/
Apache License 2.0
12 stars 5 forks source link

broken round tripping via `filter_get.xsl` and `filter_put.xsl` #90

Open peterstadler opened 3 years ago

peterstadler commented 3 years ago

Just recognised while reviewing #89 and we've been there before with #66 :

  1. These scripts are hard to understand and most code seems not to be called at all
  2. More severe: filter_get.xsl transforms the MEI input file in various ways (adding "default" attributes with empty values, removing the music section, transform some elements to HTML), which are only in parts undone or reconstructed by its counterpart filter_put.xsl. E.g. the example file "nielsen_maskarade.xml" features some <mei:rend rend="sup"> in <mei:identifier>s which are transformed into <html:sup>. This is not re-transformed by filter_put.xsl, so modifying (and saving) that file with MerMEId (at any location) will write that <sup> into the MEI file (as string!).

I think the best way forward would be to rewrite those files and

  1. only transform MEI elements into HTML when those are input of the TinyMCE editor
  2. add a proper wrapper/attribute breadcrumb for those changes so we can filter them out later
  3. the XML display of the files (accessible from the main list) should display the unfiltered file. For use with orbeon we should add a URL parameter (e.g. mode=orbeon) to filter_get.xsl. NB. It might be easier to add a URL parameter for the "raw" view, but I think of the "raw" view as the default ant the "orbeon" view as the special case.
peterstadler commented 1 year ago

Processing instructions are getting lost on the way, see https://github.com/Edirom/MerMEId/pull/184#pullrequestreview-1740171453