Skip to content

Commit

Permalink
Merge pull request #601 from metanorma/xslt_displayorder
Browse files Browse the repository at this point in the history
XSLT displayorder
  • Loading branch information
Intelligent2013 authored Aug 1, 2023
2 parents 690d022 + 45cae40 commit 98f6fda
Show file tree
Hide file tree
Showing 10 changed files with 317 additions and 90 deletions.
23 changes: 0 additions & 23 deletions fonts/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,29 +82,6 @@ Source Han Sans:
Source Han Sans Normal:
- Regular

Source Code Pro:
- Regular
- Italic
- Bold Italic
- Bold

Source Sans Pro:
- Italic
- Bold Italic
- Regular
- Bold

Source Sans Pro Light:
- Regular
- Italic

Source Serif Pro:
- Bold
- Bold Italic
- Regular
- Italic


Fira Code:
- Regular

Expand Down
9 changes: 7 additions & 2 deletions xslt_src/cc.standard.core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@
</fo:static-content>
<xsl:call-template name="insertHeaderFooter"/>
<fo:flow flow-name="xsl-region-body">
<fo:block font-size="16pt" font-weight="bold" margin-bottom="17pt" role="H1">
<!-- <fo:block font-size="16pt" font-weight="bold" margin-bottom="17pt" role="H1">
<xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:title[@language = 'en']"/>
</fo:block>
</fo:block> -->
<fo:block>
<xsl:call-template name="processMainSectionsDefault"/>
</fo:block>
Expand Down Expand Up @@ -432,6 +432,11 @@
<!-- ============================= -->
<!-- ============================= -->

<xsl:template match="csd:sections/csd:p[@class = 'zzSTDTitle1']" priority="4">
<fo:block font-size="16pt" font-weight="bold" margin-bottom="17pt" role="H1">
<xsl:apply-templates />
</fo:block>
</xsl:template>

<xsl:template match="csd:title" name="title">

Expand Down
4 changes: 3 additions & 1 deletion xslt_src/common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -9542,6 +9542,8 @@
<!-- END Definition List -->
<!-- ===================== -->

<!-- default: ignore title in sections/p -->
<xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3" />

<!-- ========================= -->
<!-- Rich text formatting -->
Expand Down Expand Up @@ -17013,7 +17015,7 @@
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:template>
<xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
<xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_step1"/>
Expand Down
13 changes: 10 additions & 3 deletions xslt_src/iec.international-standard.core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1380,10 +1380,13 @@
<fo:block break-after="page"/>
</xsl:template>

<xsl:template match="*[local-name() = 'preface' or local-name() = 'sections']/iec:p[starts-with(@class, 'zzSTDTitle')]" priority="3">
<xsl:template match="*[local-name() = 'preface' or local-name() = 'sections']/iec:p[starts-with(@class, 'zzSTDTitle')]" priority="4">
<fo:block-container font-size="12pt" text-align="center">
<xsl:if test="following-sibling::*[1][not(self::iec:p[starts-with(@class, 'zzSTDTitle')])]">
<xsl:attribute name="margin-bottom">18pt</xsl:attribute>
<xsl:if test="ancestor::*[local-name() = 'sections']">
<xsl:attribute name="margin-bottom">30pt</xsl:attribute>
</xsl:if>
</xsl:if>
<fo:block>
<xsl:if test="iec:strong"> <!-- title -->
Expand All @@ -1394,6 +1397,10 @@
</fo:block-container>
</xsl:template>

<xsl:template match="*[local-name() = 'sections']/iec:p[@class = 'zzSTDTitle1']//text()" priority="4">
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
</xsl:template>

<xsl:template name="insertPrefacepages">
<xsl:param name="lang" select="$lang"/>
<fo:block break-after="page"/>
Expand Down Expand Up @@ -1439,7 +1446,7 @@
<xsl:call-template name="insertHeaderFooter"/>
<fo:flow flow-name="xsl-region-body">

<fo:block-container font-size="12pt" text-align="center" margin-bottom="36pt">
<!-- <fo:block-container font-size="12pt" text-align="center" margin-bottom="36pt">

<fo:block font-weight="bold" role="H1">

Expand All @@ -1449,7 +1456,7 @@

<fo:block>&#xa0;</fo:block>
</fo:block>
</fo:block-container>
</fo:block-container> -->

<!-- Main sections -->
<fo:block>
Expand Down
45 changes: 30 additions & 15 deletions xslt_src/ieee.standard.core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@
<fo:flow flow-name="xsl-region-body">
<!-- debugpage=<xsl:copy-of select="."/> -->

<xsl:if test="position() = 1">
<!-- <xsl:if test="position() = 1">
<xsl:choose>
<xsl:when test="$current_template = 'draft'">
Expand All @@ -1113,8 +1113,6 @@
<xsl:copy-of select="$title_prefix"/>
<xsl:copy-of select="$title"/>

<!-- <xsl:copy-of select="$draft_title_part"/> -->
</fo:block>
</xsl:when>
Expand All @@ -1126,29 +1124,20 @@
</fo:block>
</xsl:when>
<xsl:otherwise> <!-- $current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report' -->
<xsl:otherwise> --><!-- $current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report' -->

<xsl:attribute name="font-family">Calibri Light</xsl:attribute>
<!-- <xsl:attribute name="font-family">Calibri Light</xsl:attribute>
<xsl:attribute name="font-size">12pt</xsl:attribute>
<fo:block font-family="Arial Black" font-size="20pt" margin-top="18pt">
<xsl:copy-of select="$title"/>
<!-- <xsl:copy-of select="$draft_title_part"/> -->
</fo:block>
<xsl:call-template name="addBlueBox"/>
<!-- <fo:block font-size="1" margin-top="3mm">
<fo:instream-foreign-object content-width="57mm" content-height="3mm" scaling="non-uniform" fox:alt-text="Image Box">
<xsl:call-template name="insertImageBoxSVG">
<xsl:with-param name="color"><xsl:value-of select="$color_blue"/></xsl:with-param>
</xsl:call-template>
</fo:instream-foreign-object>
</fo:block>
<fo:block margin-top="12pt" margin-bottom="12pt">&#xa0;</fo:block> -->
<fo:block margin-bottom="12pt">&#xa0;</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:if> -->

<xsl:apply-templates select="*" mode="page"/>
<xsl:if test="position() = last()"><fo:block id="lastBlockMain"/></xsl:if>
Expand Down Expand Up @@ -1781,6 +1770,32 @@
</xsl:choose>
</xsl:template>

<xsl:template match="ieee:p[@class = 'zzSTDTitle1']" priority="4">
<xsl:choose>
<xsl:when test="$current_template = 'draft'">
<fo:block font-family="Arial" font-size="23pt" font-weight="bold" margin-top="70pt" margin-bottom="48pt">
<xsl:if test="contains('amendment corrigendum erratum', $subdoctype) and $subdoctype != ''">
<xsl:attribute name="font-size">24pt</xsl:attribute>
</xsl:if>
<xsl:apply-templates />
</fo:block>
</xsl:when>
<xsl:when test="$current_template = 'standard'">
<fo:block font-family="Arial" font-weight="bold" margin-top="13mm" space-after="12pt">
<xsl:apply-templates />
</fo:block>
</xsl:when>
<xsl:otherwise> <!-- $current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report' -->

<fo:block font-family="Arial Black" font-size="20pt" margin-top="18pt">
<xsl:apply-templates />
</fo:block>
<xsl:call-template name="addBlueBox"/>
<fo:block margin-bottom="12pt">&#xa0;</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="node()">
<xsl:apply-templates />
</xsl:template>
Expand Down
36 changes: 29 additions & 7 deletions xslt_src/iso.international-standard.core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1414,12 +1414,9 @@
<fo:flow flow-name="xsl-region-body">


<fo:block-container>
<!-- Information and documentation — Codes for transcription systems -->
<!-- <fo:block font-size="16pt" font-weight="bold" margin-bottom="18pt">
<xsl:value-of select="$title-en"/>
</fo:block>
-->
<!-- Information and documentation — Codes for transcription systems -->
<!-- <fo:block-container>
<fo:block font-size="18pt" font-weight="bold" margin-top="40pt" margin-bottom="20pt" line-height="1.1" role="H1">
<fo:block role="SKIP">
Expand All @@ -1445,7 +1442,7 @@
</fo:block>
</fo:block-container>
</fo:block-container> -->
<!-- Clause(s) -->
<fo:block>

Expand Down Expand Up @@ -1825,6 +1822,31 @@
</xsl:if>
</xsl:template>

<xsl:template match="iso:sections/iso:p[@class = 'zzSTDTitle1']" priority="4">
<fo:block font-size="18pt" font-weight="bold" margin-top="40pt" margin-bottom="20pt" line-height="1.1" role="H1">
<xsl:if test="following-sibling::*[1][self::iso:p][starts-with(@class, 'zzSTDTitle')]">
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
</xsl:if>
<xsl:apply-templates />
</fo:block>
</xsl:template>

<xsl:template match="iso:sections/iso:p[@class = 'zzSTDTitle1']/iso:span[@class = 'nonboldtitle']" priority="3">
<!-- Example: <span class="nonboldtitle">Part 1:</span> -->
<fo:block font-weight="normal" margin-top="12pt" line-height="1.1" role="SKIP">
<xsl:apply-templates />
</fo:block>
</xsl:template>


<xsl:template match="iso:sections/iso:p[@class = 'zzSTDTitle2']" priority="4">
<!-- Example: <p class="zzSTDTitle2" displayorder="3">AMENDMENT 1: Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</p> -->
<xsl:if test="$doctype = 'amendment'">
<fo:block font-size="18pt" margin-top="12pt" margin-bottom="20pt" margin-right="0mm" font-weight="normal" line-height="1.1" role="H1">
<xsl:apply-templates />
</fo:block>
</xsl:if>
</xsl:template>

<!-- ==================== -->
<!-- END display titles -->
Expand Down
Loading

0 comments on commit 98f6fda

Please sign in to comment.