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

Open
larsgw opened this Issue Nov 6, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@larsgw

larsgw commented Nov 6, 2016

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

@petermr

This comment has been minimized.

Show comment
Hide comment
@petermr

petermr Nov 7, 2016

Member

I believe the conversion is done in

https://github.com/ContentMine/norma/blob/master/src/main/resources/org/xmlcml/norma/pubstyle/nlm/toHtml.xsl
Member

petermr commented Nov 7, 2016

I believe the conversion is done in

https://github.com/ContentMine/norma/blob/master/src/main/resources/org/xmlcml/norma/pubstyle/nlm/toHtml.xsl

egonw added a commit to egonw/norma that referenced this issue Nov 26, 2016

egonw added a commit to egonw/norma that referenced this issue Jan 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment