Skip to content

Colspan attribute is not preserved when transforming XML to HTML #57

@larsgw

Description

@larsgw

The fulltext.xml file of https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4723141/ contains the following table component:

...
<thead>
  <tr>
    <th align="left" rowspan="1" colspan="1"/>
    <th align="left" rowspan="1" colspan="1"/>
    <th align="center" colspan="2" rowspan="1">
      <italic>Picea abies</italic>
    </th>
    <th align="center" colspan="2" rowspan="1">
      <italic>Pinus contorta</italic>
    </th>
    <th align="center" colspan="3" rowspan="1">
      <italic>Pinus sylvestris</italic>
    </th>
  </tr>
  <tr>
    <th align="center" rowspan="1" colspan="1"/>
    <th align="center" rowspan="1" colspan="1"/>
    <th align="center" rowspan="1" colspan="1">15 yr</th>
    <th align="center" rowspan="1" colspan="1">30 yr</th>
    <th align="center" rowspan="1" colspan="1">85 yr</th>
    <th align="center" rowspan="1" colspan="1">15 yr</th>
    <th align="center" rowspan="1" colspan="1">30 yr</th>
    <th align="center" rowspan="1" colspan="1">15 yr</th>
    <th align="center" rowspan="1" colspan="1">30 yr</th>
  </tr>
</thead>
...

When converted to HTML by norma, the code looks like this:

<thead>
    <tr>
      <th></th>
      <th></th>
      <th>
          <i>Picea abies</i>
      </th>
      <th>
          <i>Pinus contorta</i>
      </th>
      <th>
          <i>Pinus sylvestris</i>
      </th>
    </tr>
    <tr>
      <th></th>
      <th></th>
      <th>15 yr</th>
      <th>30 yr</th>
      <th>85 yr</th>
      <th>15 yr</th>
      <th>30 yr</th>
      <th>15 yr</th>
      <th>30 yr</th>
    </tr>
</thead>

This breaks the table, as seen below.

table

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions