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

Use XQuery 3.1's map function to pass and access the various column label indices #38

Open wlpotter opened 2 years ago

wlpotter commented 2 years ago

These are currently created separately and then bundled as a sequence of all indices to be passed to the sub-modules. Each sub-module of csv2srophe has to debundle these by using something like $indices/self::headword. This is both cumbersome and tedious.

Instead, try a map with keys that are the index type and values the index itself, e.g.

let $index := {'headwords': $headwordsIndex, 'names': $namesIndex, ...}

Then, instead of unzipping the indices, a given index can simply be accessed by, e.g., $index('headwords')

wlpotter commented 10 months ago

Might be worthwhile, might not be