[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Table structure checking, how?


Subject: Re: [xsl] Table structure checking, how?
From: "Michael Müller-Hillebrand mmh@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 3 Mar 2016 13:50:57 -0000

Thanks a lot, Gerrit,

As the CALS table specification in https://www.oasis-open.org/specs/tm9901.htm
says:

> If the number of columns consumed is less than the number of columns
specified in the tgroup's cols attribute, then the missing entrys (without
spanning or straddling) are implicitly present, and their colsep and rowsep
rulings are inherited.


So, as a first step I will extend my normalizing routine to add any missing
cells, which seems to be acceptable.

For the potentially bigger problem of extra cells which should be removed
because of a morerows straddle, we will consider your solution, to avoid
getting malformed data in our CMS.

- Michael

PS: Wait, I have to mention Andrew Welch one more time :-)


> Am 03.03.2016 um 09:54 schrieb Imsieke, Gerrit, le-tex
gerrit.imsieke@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>:
>
> Try calstable:check-normalized(), as seen in this example:
>
https://github.com/transpect/xslt-util/blob/master/calstable/xsl/example.xsl
> It is based on Andrew Welchbs table normalization.
>
> Gerrit
>
> On 03.03.2016 09:37, Michael MC<ller-Hillebrand mmh@xxxxxxxxx wrote:
>> Hi folks,
>>
>> We came across a CALS table with a "missing" cell in the first row, like
this:
>>
>> <tgroup cols="2">
>>   <tbody>
>>     <row>
>>       <entry colname="col1" morerows="1"><p>Text</p></entry>
>>       <!-- MISSING second column cell -->
>>     </row>
>>     <row>
>>       <!-- skipped first cell because of morerows -->
>>       <entry colname="col2"><p>Text</p></entry>
>>     </row>
>>   </tbody>
>> </tgroup>
>>
>> This table is technically valid, but creates problems when processed
further.
>>
>> Are you aware of a tool or method to check that the table data is correct
regarding any available colspan or rowspan definitions? I fear there is no way
to have that checked using just e.g. XPath.
>>
>> My next step would be to look at Andrew Welch's table normalizer, which I
have used in a number of projects. It is currently based on the assumption
that the first row of a table is complete (after expanding any colspan
definitions).
>>
>> http://andrewjwelch.com/code/xslt/table/table-normalization.html
>>
>> Any hints are very welcome,
>>
>> - Michael

[demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]


Current Thread