Edirom / Edirom-Online

Edirom Online is a tool for presenting historical-critical music editions in digital form.
GNU General Public License v3.0
19 stars 18 forks source link

Fix: adjust return values to function signatures #310

Closed peterstadler closed 1 year ago

peterstadler commented 1 year ago

This is my try to fix #309. I basically replaced /string(@attribute) with /@attribute => string() to make sure the return type is xs:string even when the leading XPath expression returns the empty sequence.

NB, no error checking was introduced, so if e.g., (for any reason) there are multiple edirom:language with the same @xml:lang, the function edition:getLanguageFileURI will break.

bwbohl commented 1 year ago

Maybe we should do a systematic search across all XQueries if such cases still appear

peterstadler commented 1 year ago

Maybe we should do a systematic search across all XQueries if such cases still appear

Yes, imho the Edirom would benefit a lot from systematic refactoring but I dare to say that this is out of scope of the current issue.