Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

larsgw opened this issue Nov 6, 2016 · 1 comment

Comments

@larsgw
Copy link

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
Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants