XHTML to DITA transformation ignores <th> tag in table
Post here questions and problems related to editing and publishing DITA content.
			- 
				oxmand
- Posts: 2
- Joined: Tue Jun 23, 2020 4:14 pm
XHTML to DITA transformation ignores <th> tag in table
Hi all,
I am trying to transform an XHTML table to DITA. The DITA output looks fine except for one thing: it omits the table header row. Here is the XHTML:
Any idea what the issue may be?
Thanks!
			
			
									
									
						I am trying to transform an XHTML table to DITA. The DITA output looks fine except for one thing: it omits the table header row. Here is the XHTML:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <link href="style.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
        <h2>Country Availability</h2>
        <h3>Australia</h3>
        <table>
            <tbody>
            	<tr>
                    <th>A</th>
                    <th>B</th>
                    <th>C</th>
                </tr>
                <tr>
                    <td>X</td>
                    <td>Y</td>
                    <td>Z</td>
                </tr>
            </tbody>
        </table>
    </body>
</html>
Thanks!
- 
				Radu
- Posts: 9545
- Joined: Fri Jul 09, 2004 5:18 pm
Re: XHTML to DITA transformation ignores <th> tag in table
Hi,
Ideally your table would have defined the header rows in a thead element like this:
but indeed the XHTML to DITA conversion stylesheets should not lose content even with your current approach, we'll look into fixing them.
We have a free Oxygen add-on which is more maintained than the conversion stylesheets:
https://github.com/oxygenxml/oxygen-resources-converter
The add-on should convert the HTML to DITA without losing data, but it will still not mark that first row as a header row because it was not defined inside a <thead>.
Regards,
Radu
			
			
									
									Ideally your table would have defined the header rows in a thead element like this:
Code: Select all
<table>
            <thead>
                <tr>
                    <th>A</th>
                    <th>B</th>
                    <th>C</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>X</td>
                    <td>Y</td>
                    <td>Z</td>
                </tr>
            </tbody>
        </table>We have a free Oxygen add-on which is more maintained than the conversion stylesheets:
https://github.com/oxygenxml/oxygen-resources-converter
The add-on should convert the HTML to DITA without losing data, but it will still not mark that first row as a header row because it was not defined inside a <thead>.
Regards,
Radu
Radu Coravu 
<oXygen/> XML Editor
http://www.oxygenxml.com
						<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
			
				Jump to
				
			
		
			
			
	
	- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service