@@ -704,15 +704,22 @@ declare function epub:frus-div-to-li($div as element(tei:div), $suppress-documen
704
704
</li>
705
705
(: show all divs with @xml:id :)
706
706
else
707
+ let $child-docs := $div/tei:div [@type eq "document" ]
708
+ let $labels := if ($div/ancestor::tei:back) then ("Appendix" , "Appendixes" ) else ("Document" , "Documents" )
709
+ let $label := if (count ($child-docs) eq 1 ) then $labels[1 ] else $labels[2 ]
710
+ return
707
711
if ($options = 'mobi' ) then
708
712
<blockquote xmlns = "http://www.w3.org/1999/xhtml" >
709
713
<a href = "{concat ($div/@xml:id, '.html' )} " >{
710
714
normalize-space (frus:head-sans-note ($div))
711
715
}</a>
712
716
{
713
- if ($div[tei: div /@ type eq 'document' ] ) then
717
+ if ($child-docs ) then
714
718
if ($suppress-documents) then
715
- concat (' (Documents ' , $div/tei:div [@n][1 ]/@n, '-' , $div/tei:div [@n][last ()]/@n, ')' )
719
+ if (count ($child-docs) gt 1 ) then
720
+ concat (' (' , $label, ' ' , $child-docs[@n][1 ]/@n, '–' , $child-docs[@n][last ()]/@n, ')' )
721
+ else
722
+ concat (' (' , $label, ' ' , $child-docs[@n][1 ]/@n, ')' )
716
723
else ()
717
724
else
718
725
()
@@ -728,9 +735,12 @@ declare function epub:frus-div-to-li($div as element(tei:div), $suppress-documen
728
735
normalize-space (frus:head-sans-note ($div))
729
736
}</a>
730
737
{
731
- if ($div[tei: div /@ type eq 'document' ] ) then
738
+ if ($child-docs ) then
732
739
if ($suppress-documents) then
733
- concat (' (Documents ' , $div/tei:div [@n][1 ]/@n, '-' , $div/tei:div [@n][last ()]/@n, ')' )
740
+ if (count ($child-docs) gt 1 ) then
741
+ concat (' (' , $label, ' ' , $child-docs[@n][1 ]/@n, '–' , $child-docs[@n][last ()]/@n, ')' )
742
+ else
743
+ concat (' (' , $label, ' ' , $child-docs[@n][1 ]/@n, ')' )
734
744
else ()
735
745
else
736
746
()
0 commit comments