Closed ronaldtse closed 7 months ago
@ronaldtse these lists are independent lists (the tables actually in the terms of XSL-FO). The auto-layout table width algorithm in mn2pdf
applies independently for each table:
The columns widths calculated for the 9.10.2.1:
<fo:table-column column-width="proportional-column-width(620)"/>
<fo:table-column column-width="proportional-column-width(1142)"/>
The columns widths calculated for the 9.10.2.2 are:
<fo:table-column column-width="proportional-column-width(620)"/>
<fo:table-column column-width="proportional-column-width(1678)"/>
@opoudjis I don't remember exactly, but looks like we have the feature for definition list columns width for another SDOs. Do you remember it?
@opoudjis I don't remember exactly, but looks like we have the feature for definition list columns width for another SDOs. Do you remember it?
It was indeed felt desirable, because some SDOs did in fact implement definition lists as tables in Word. NIST certainly does it, for terms as well as definitions.
I can't find any other examples, although I'm convinced this has come up with ISO in the past...
@opoudjis so is the solution to use a manual table (instead of a definition list) that includes manually set column widths?
This is key to fixing https://github.com/openitu/X.icd-schemas/issues/21
That is one way of solving it, but it would need to be done in Presentation XML if so, so that it carries across to all formats.
This use of interrupted tables to render definition lists is a malfeature on the part of the organisation, as they need to manually tweak all their tables to line up, but we are stuck with it.
ITU want definition lists rendered as tables. The approach I had taken here was to leave the definition list in the Presentation XML as dl/dt, dl/dd, and leave the rendering as a Table downstream, as a PDF auto-table, a CSS grid in HTML, and a table in Word.
The supposed problem is that this means the definition list columns won't line up with each other.
Addressing this by imposing a uniform width on definition list tables is inevitably going to lead sooner or later to someone on ITU whining about some exception. When that time comes, they will be told the stock Metanorma answer to requests by SDOs to perpetuate formatting inconsistencies: if they want to keep authoring documents in Word, they know where to find it.
I am going to turn all definition lists in ITU into tables of class "dl", with 20% width for terms, in Presentation XML.
Note that definition lists are left alone if they are the children of tables, figures, or formulas (so we do not get intractable nesting of tables.)
Now, ITU XSLT renders so:
Issues:
<th width="20%"
and <td width="80%"
, because XSLT expects the table columns widths is the table/colgroup/col/@width
table
with class="dl"
Presentation XML:
<table id="_1552205f-c9f1-d661-4863-f429d21f7a93" class="dl">
<tbody>
<tr>
<th width="20%">Description</th>
<td width="80%">
<p id="_2439a912-2533-8ffe-b47a-c62db3378761">The name of the entity</p>
</td>
</tr>
<tr>
<th width="20%">Requirement</th>
<td width="80%">
<p id="_fae9297d-7fd5-51b3-681f-f83ec47129e9">
<tt>recommended</tt>
</p>
</td>
</tr>
</tbody>
</table>
I have to fix ITU XSLT.
ITU XSLT updated:
My turn to fix this:
<colgroup>
<col col="20%"/>
<col col="80%"/>
</colgroup>
as that is what @Intelligent2013 processes—even though that is not legitimately part of dl
table[@class = 'dl']
before further processing
Reported by @taddhar in https://github.com/openitu/X.icd-schemas/issues/21 :