Home

ISOSTS XHTML table to CALS conversion

The script isosts2cals.xsl transforms XHTML tables into CALS tables targeting the OASIS Exchange Table model DTD TR 9901:1999. The script requires an XSLT 2 processor and has been tested with Saxon 9.4 HE.

The resulting CALS table use the namespace prefix "oasis" which is bound to the identifier '-//OASIS//DTD XML Exchange Table Model 19990315//EN'. To remove the namespace from the resulting CALS tables use the script remove_oasis_ns.xsl.

The full package can be downloaded as a zip.

Mapping definition

Table border

XHTML CALS Comments
<table> <table frame="none">
<table border="1"> <table frame="all" colsep="yes" rowsep="yes"> Implicitly sets the default col and row separator
<table frame="box|border"> <table frame="all">
<table frame="above"> <table frame="top">
<table frame="below"> <table frame="bottom">
<table frame="hsides"> <table frame="topbot">
<table frame="lhs|rhs|void"> <table frame="none">
<table frame="vsides"> <table frame="side">

Default table colsep and rowsep and the impact of @rules

NOTE: separators generated through the @rules settings are always generated, regardless individual CSS settings of the table cell.

XHTML CALS Comments
<table border="1"> <table colsep="yes" rowsep="yes"> colsep and rowsep can be overwritten by individual cell CSS
<table rules="all"> <table colsep="yes" rowsep="yes"> creates row and col separator for any cell
<table rules="rows"> <table frame="all" colsep="no" rowsep="yes"> creates row separator for any cell
<table rules="cols"> <table colsep="yes" rowsep="no"> creates col separator for any cell
<table rules="groups"> <table colsep="no" rowsep="no"> creates row separator for cells in last row of table header, body and footer

Table cell border

The border of individual table cell are defined as CSS in the XHTML table model. How the different CSS settings translate into CALS @colsep and @rowsep attributes is documented in the following test cases. The fact that the CSS settings of the next cell or row can impact the current cell separator settings is taken into account. For example "border-left: solid 1px" of the next cell will generate a visual separator between the current and next cell.

Because the CALS DTD doesn't allow different border styles or thicknesses, any border style other than none or hidden and any border thickness greater than 0 will generate a separator (colsep=yes, rowsep=yes).

Validation

The ISOSTS DTD only defines the XHTML table model and a converted file with CALS tables will not be valid anymore against this DTD. To test the generated CALS tables against the CALS DTD the script flatten_cals.xsl can be used to generate an XML containing only CALS tables without namespace prefix. This XML can then be validated against a test version of the CALS DTD. This version is slightly modified to allow multiple tables in a single file.

Test cases

ISOSTS with XHTML HTML preview CALS conversion
isosts_tables.xml isosts_tables.html isosts_tables.cals.xml

Items to discuss, things you want to share ...

Please see on ISO Connect.