aso2101 / satavahana-inscriptions

1 stars 0 forks source link

app:browse-get-persons should order by "real" name, not by xml:id #30

Closed aso2101 closed 7 years ago

aso2101 commented 7 years ago

Since my practice is to prefix an abbreviated place name to the xml:ids for people, I think it's better for app:browse-get-persons to order the hits by the "real" name (the first persName in the record), rather than by the xml:id (so the person with the xml:id Hi-Rakṣita is sorted under R rather than H). However, when I try setting $name to $i//tei:persName[1]/text(), we end up with multiple entries having the same value for $name, which doesn't work. Maybe you have an easy solution @wsalesky?

wsalesky commented 7 years ago

This adds a parameter to the app:abc-filter() function, so you can pass in the element you want to sort on.

Use case:

for $i in util:eval(concat("$persons",app:abc-filter('tei:person[1]/tei:persName[1]'),facet:facet-filter($facet-def)))
let $name := $i//tei:person[1]/tei:persName[1]
order by $name
return $i

@aso2101 if this works as desired you can close it. We will also use this for the bibliographic browse.

aso2101 commented 7 years ago

yes, this fixes it.