icaruseu / mom-ca

Monasterium.net (http://www.monasterium.net/mom) - repository and collaborative archive
https://github.com/icaruseu/mom-ca/wiki
GNU General Public License v3.0
17 stars 11 forks source link

order index names by persName instead of xml-id (#1143) #1145

Closed NTsch closed 1 year ago

NTsch commented 1 year ago

Use the (first) persName of a person instead of the xml:id for ordering the list of names in the person index.

Closes #1143.

NTsch commented 1 year ago

Might be picky.... but can you be sure that every person has a persName? This wasn't necessary with using xml:id

I can introduce a check to otherwise use the content of person. And also for the presence of name in persName.

StephanMa commented 1 year ago

Would appreciate that...

NTsch commented 1 year ago

I think a reasonably simple way to go would be to with the first non-empty descendant text node (descendant::text()[normalize-space()][1]). This takes name in the Fontenay index, else persName, else person, and could also use things like forename or surname in future indices. What do you think @StephanMa ?

StephanMa commented 1 year ago

Even when I am not very happy with the [1]-approach, I couldn't find any hit which was not like "intended"