Edirom-Online icon indicating copy to clipboard operation
Edirom-Online copied to clipboard

getLinkTarget.xql fails if window title not found for mei:work

Open bwbohl opened this issue 2 years ago • 6 comments

https://github.com/Edirom/Edirom-Online/blob/914ccfd7dc9f3f10cbbf9ab9640980e764dc2f04/add/data/xql/getLinkTarget.xql#L170

e.g. in MEI 4.0.1 work does no longer contain titleStmt

bwbohl avatar Jun 13 '23 10:06 bwbohl

https://github.com/Edirom/Edirom-Online/blob/914ccfd7dc9f3f10cbbf9ab9640980e764dc2f04/add/data/xql/getLinkTarget.xql#L172

fails for MEI 4 upward because mei:workDesc was replaced with mei:workList

bwbohl avatar Jun 20 '24 08:06 bwbohl

Is the function failing by throwing an error or is it returning "unknown" where you would expect some title text?

peterstadler avatar Sep 05 '24 11:09 peterstadler

I have tested this with an MEI 5 file. I hade to delete a lot of titles before nothing was returned, but I was not able to force a fail. At the end an emptry string was retuned.

Since @bwbohl mentioned #118 here: Special characters and hard linebreaks have been a problem since I can remember. The linebreak issue was simply fixed by normalizing the space. But also with a title containing the apostrophe I am not able to reproduce this case. @bwbohl Could you provide me a title-Container that I can copy&paste into my test set?

riedde avatar Sep 11 '24 07:09 riedde

The current implelemtation

https://github.com/Edirom/Edirom-Online/blob/d3f4ce45220f9d30c42d632eec43b7c9fc5a461b/add/data/xql/getLinkTarget.xql#L150-L189

As we can see from the above, normalize-space() is only called for source objects We should apply it to all object types

bwbohl avatar Sep 11 '24 07:09 bwbohl

The normalisation already happens in eutil:getLocalizedTitle()

riedde avatar Sep 11 '24 08:09 riedde

hmm… please test #103 it fails in my local instance

bwbohl avatar Sep 11 '24 08:09 bwbohl

Regrettably 8accbac0d0fa96c4fcfc99726e5ff45be21c304b wasn't enough to fix the mei4+ issues. The structure turned from

<workDesc>
    <work>
        <titleStmt>
            <title></title>
        </titleStmt>
    </work>
</workDesc>

to

<workList>
    <work>
        <title></title>
    </work>
<workList>

i.e., the titleStmt is missing in the new structure. Yet, add/data/xql/getLinkTarget.xql still looks for titleStmt.

peterstadler avatar Dec 10 '24 17:12 peterstadler

I'll have an eye on that!

riedde avatar Dec 11 '24 15:12 riedde