Skip to content

Commit

Permalink
xslt updated for PDF/UA compliance, metanorma/mn2pdf#295
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 committed Sep 28, 2024
1 parent 2d25fde commit 5a06a68
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 15 deletions.
15 changes: 15 additions & 0 deletions xslt_src/common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -20615,4 +20615,19 @@
</xsl:if>
</xsl:template>

<xsl:template match="@*|node()" mode="set_table_role_skip">
<xsl:copy>
<xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
</xsl:copy>
</xsl:template>

<xsl:template match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
<xsl:copy>
<xsl:apply-templates select="@*" mode="set_table_role_skip"/>
<xsl:attribute name="role">SKIP</xsl:attribute>
<xsl:apply-templates select="node()" mode="set_table_role_skip"/>
</xsl:copy>
</xsl:template>


</xsl:stylesheet>
38 changes: 23 additions & 15 deletions xslt_src/iso.international-standard.core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,7 @@

<xsl:template name="insertCoverPage">
<xsl:if test="$isGenerateTableIF = 'false'"> <!-- no need cover page for auto-layout algorithm -->
<xsl:variable name="fo_cover_page">
<!-- cover page -->
<xsl:choose>
<xsl:when test="$layoutVersion = '1951'">
Expand Down Expand Up @@ -1792,7 +1793,7 @@
<!-- International
Standard -->
<fo:table-cell number-columns-spanned="2" padding-left="6mm">
<fo:block-container height="46mm">
<fo:block-container height="46mm" role="SKIP">
<fo:block font-size="20pt" font-weight="bold" line-height="1.25" margin-top="3mm">

<xsl:variable name="updates-document-type" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:updates-document-type"/>
Expand Down Expand Up @@ -1863,7 +1864,7 @@

<fo:table-row height="46mm">
<fo:table-cell number-columns-spanned="2" border-right="{$cover_page_border}">
<fo:block>&#xa0;</fo:block>
<fo:block role="SKIP"><fo:wrapper role="artifact">&#xA0;</fo:wrapper></fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="2" display-align="after" padding-left="6mm">
<fo:block font-size="19pt" font-weight="bold" line-height="1">
Expand All @@ -1876,12 +1877,12 @@
</fo:table-row>

<fo:table-row height="1.4mm" font-size="0pt">
<fo:table-cell border-bottom="{$cover_page_border}"><fo:block>&#xa0;</fo:block></fo:table-cell>
<fo:table-cell number-columns-spanned="2"><fo:block>&#xa0;</fo:block></fo:table-cell>
<fo:table-cell border-bottom="{$cover_page_border}"><fo:block>&#xa0;</fo:block></fo:table-cell>
<fo:table-cell border-bottom="{$cover_page_border}"><fo:block role="SKIP"><fo:wrapper role="artifact">&#xA0;</fo:wrapper></fo:block></fo:table-cell>
<fo:table-cell number-columns-spanned="2"><fo:block role="SKIP"><fo:wrapper role="artifact">&#xA0;</fo:wrapper></fo:block></fo:table-cell>
<fo:table-cell border-bottom="{$cover_page_border}"><fo:block role="SKIP"><fo:wrapper role="artifact">&#xA0;</fo:wrapper></fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row height="1.4mm" font-size="0pt">
<fo:table-cell number-columns-spanned="4"><fo:block>&#xa0;</fo:block></fo:table-cell>
<fo:table-cell number-columns-spanned="4"><fo:block role="SKIP"><fo:wrapper role="artifact">&#xA0;</fo:wrapper></fo:block></fo:table-cell>
</fo:table-row>

<fo:table-row>
Expand Down Expand Up @@ -1917,7 +1918,7 @@
</fo:block-container>
</fo:table-cell>
<fo:table-cell number-columns-spanned="2" padding-left="6mm">
<fo:block margin-top="2.5mm" line-height="1.1">
<fo:block margin-top="2.5mm" line-height="1.1" role="SKIP">

<xsl:if test="not($stage-abbreviation = 'DIS' or $stage-abbreviation = 'DAMD' or $stage-abbreviation = 'DAM')">
<xsl:variable name="edition_and_date">
Expand Down Expand Up @@ -2573,7 +2574,7 @@
</fo:block>
</fo:block-container>
</fo:flow>
</xsl:otherwise>
</xsl:otherwise>
</xsl:choose>


Expand Down Expand Up @@ -2775,7 +2776,11 @@
</fo:page-sequence>
</xsl:otherwise>
</xsl:choose>
</xsl:if> <!-- $isGenerateTableIF = ' false' -->
</xsl:variable>

<xsl:apply-templates select="xalan:nodeset($fo_cover_page)" mode="set_table_role_skip"/>

</xsl:if> <!-- $isGenerateTableIF = 'false' -->
</xsl:template> <!-- END insertCoverPage -->


Expand Down Expand Up @@ -4946,6 +4951,7 @@
<xsl:template name="insertLastPage_2024">
<fo:page-sequence master-reference="last-page_2024" force-page-count="no-force">
<fo:flow flow-name="xsl-region-body">
<xsl:variable name="fo_last_page">
<fo:table table-layout="fixed" width="100%" margin-bottom="-1mm">
<xsl:call-template name="insertInterFont"/>
<fo:table-column column-width="proportional-column-width(73)"/>
Expand All @@ -4959,15 +4965,15 @@
<xsl:call-template name="insertLogoImages2024"/>
</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="2"><fo:block>&#xa0;</fo:block></fo:table-cell>
<fo:table-cell number-columns-spanned="2"><fo:block role="SKIP"><fo:wrapper role="artifact">&#xA0;</fo:wrapper></fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row height="1.4mm" font-size="0pt">
<fo:table-cell border-bottom="{$cover_page_border}"><fo:block>&#xa0;</fo:block></fo:table-cell>
<fo:table-cell number-columns-spanned="2"><fo:block>&#xa0;</fo:block></fo:table-cell>
<fo:table-cell border-bottom="{$cover_page_border}"><fo:block>&#xa0;</fo:block></fo:table-cell>
<fo:table-cell border-bottom="{$cover_page_border}"><fo:block role="SKIP"><fo:wrapper role="artifact">&#xA0;</fo:wrapper></fo:block></fo:table-cell>
<fo:table-cell number-columns-spanned="2"><fo:block role="SKIP"><fo:wrapper role="artifact">&#xA0;</fo:wrapper></fo:block></fo:table-cell>
<fo:table-cell border-bottom="{$cover_page_border}"><fo:block role="SKIP"><fo:wrapper role="artifact">&#xA0;</fo:wrapper></fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row height="2mm" font-size="0pt">
<fo:table-cell number-columns-spanned="4"><fo:block>&#xa0;</fo:block></fo:table-cell>
<fo:table-cell number-columns-spanned="4"><fo:block role="SKIP"><fo:wrapper role="artifact">&#xA0;</fo:wrapper></fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row height="182mm"> <!-- 174 -->
<fo:table-cell number-columns-spanned="2" display-align="after" border-right="{$cover_page_border}">
Expand Down Expand Up @@ -5003,6 +5009,8 @@
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:variable>
<xsl:apply-templates select="xalan:nodeset($fo_last_page)" mode="set_table_role_skip"/>
</fo:flow>
</fo:page-sequence>
</xsl:template> <!-- END: insertLastPage_2024 -->
Expand Down Expand Up @@ -5324,7 +5332,7 @@
</xsl:template>

<xsl:template name="insertLastBlock">
<fo:block id="lastBlock" font-size="1pt" keep-with-previous="always" role="SKIP">&#xA0;</fo:block>
<fo:block id="lastBlock" font-size="1pt" keep-with-previous="always" role="SKIP"><fo:wrapper role="artifact">&#xA0;</fo:wrapper></fo:block>
</xsl:template>

</xsl:stylesheet>

0 comments on commit 5a06a68

Please sign in to comment.