TEIC / Stylesheets

TEI XSL Stylesheets
228 stars 124 forks source link

xml:id on list element does not give a HTML id #616

Closed Dominique-M closed 9 months ago

Dominique-M commented 11 months ago

For multilingual quotations I list-item-cit-quote-p (a few items). If I give an xml:id to each of these five elements, the ul element in HTML gets no id. See ul class="horiz" without an id, line 76 in the code of page https://d-meeus.be/marxisme/classiques/MEideall-I.html. I did test an xml:id to the five elements list xml:id="MEideall-list2003p7" rend="horiz" item xml:id="MEideall-item2003p7" style="width: 48%;" cit xml:id="MEideall-cit2003p7" xml:lang="de" quote xml:id="MEideall-quote2003p7" p xml:id="MEideall2003p7" rend="alinea" (line 13727 in the TEI XML source https://d-meeus.be/marxisme/classiques/lectures.xml) where only the first fails to pass to HTML. These xml:ids are of course not all needed, but one could like to point to the list as a whole.

sydb commented 11 months ago

This post is a bit confusing, but I am pretty sure what @Dominique-M is (correctly) complaining about is that the <list> element, when transformed to HTML, does not retain its ID. My personal opinion is that any input element that is transformed to one output element should retain its ID (if it has one).[1] So I think this is a bug that should be fixed, and is probably not that hard to fix. (Famous last words.)

Note [1] Obviously if an input element is dropped there is nowhere to put the ID; and if it is transformed to 2+ elements we would not know which one should get the ID.

sydb commented 11 months ago

@Dominique-M — Could you be a little more specific about which program you are using to convert input TEI to output HTML?

Dominique-M commented 11 months ago

Once upon a time, Sebastian R. provided a stylesheet/lib/saxon9he.jar and a sh script, saxon, to call the jar. I still use this. (Except that I rewrote the script to point to the /usr/share/java/Saxon-HE.jar — HE 9.9.1.5 in Ubuntu 23.04.) I apply this saxon sh script to the TEI stylesheets 7.55.0 with some more xsl for my parameters or small personal changes of templates.

sydb commented 11 months ago

Right. What I was poking at was precisely which stylesheet you are invoking (there are some 218 actual stylesheets one could be trying to run, only a few of which make any sense, of course) with what parameters. But it may not matter. I think I have fixed all the cases where a <list> is processed into one or more HTML elements. (I am not sure, however.) There are also 2 cases (when type="bibl" or when either type="inline", @rend contains “inline”, or the <list> is a descendant of a <head> or <label>) for which no HTML output element is generated, so there was no place to put the ID.

sydb commented 11 months ago

(BTW, when I said “I have fixed”, I meant of course that I have fixed it in a branch. It will not show up in the main branch until reviewed and pulled. It won’t show up in the released Stylesheets until the next release, which I would bet will be in the Fall.)

Dominique-M commented 11 months ago

Sorry to be imprecise (I am a not a professional). To produce the lectures.html, URL proposed as example above, my lectures.xsl first imports xml/tei/stylesheet/html/html.xsl then writes some param elements named in html_param.xsl, etc. Then saxon -o:"lectures.html" "lectures.xml" "lectures.xsl". (Where saxon is Sebastian’s script.)