Skip to content

Commit d38f4da

Browse files
Merge pull request #752 from metanorma/iso_historical
ISO historical
2 parents 333c9b9 + cc0286f commit d38f4da

File tree

2 files changed

+679
-125
lines changed

2 files changed

+679
-125
lines changed

xslt_src/common.xsl

+173-19
Original file line numberDiff line numberDiff line change
@@ -1837,6 +1837,9 @@
18371837
<xsl:if test="starts-with(@id, 'array_')">
18381838
<xsl:attribute name="margin-top">6pt</xsl:attribute>
18391839
</xsl:if>
1840+
<xsl:if test="$layoutVersion = '1951'">
1841+
<xsl:attribute name="font-size">inherit</xsl:attribute>
1842+
</xsl:if>
18401843
<xsl:if test="$layoutVersion = '1972' or $layoutVersion = '1979' or $layoutVersion = '1987' or $layoutVersion = '1989'">
18411844
<xsl:if test="normalize-space(@width) != 'text-width'">
18421845
<xsl:attribute name="span">all</xsl:attribute>
@@ -2221,6 +2224,9 @@
22212224
<xsl:if test="$continued = 'true'">
22222225
<xsl:attribute name="margin-bottom">2pt</xsl:attribute>
22232226
</xsl:if>
2227+
<xsl:if test="$layoutVersion = '1951'">
2228+
<xsl:attribute name="font-size">inherit</xsl:attribute>
2229+
</xsl:if>
22242230
<xsl:if test="$layoutVersion = '1972' or $layoutVersion = '1979' or $layoutVersion = '1987' or $layoutVersion = '1989'">
22252231
<xsl:attribute name="font-size">10pt</xsl:attribute>
22262232
<xsl:if test="normalize-space(../@width) != 'text-width'">
@@ -3756,6 +3762,11 @@
37563762
</xsl:if>
37573763

37583764
<xsl:if test="$namespace = 'iso'">
3765+
<xsl:if test="$layoutVersion = '1951'">
3766+
<!-- <xsl:if test="$revision_date_num &lt; 19680101"> -->
3767+
<xsl:attribute name="font-size">8.5pt</xsl:attribute>
3768+
<!-- </xsl:if> -->
3769+
</xsl:if>
37593770
<xsl:if test="$layoutVersion = '1972' or $layoutVersion = '1979' or $layoutVersion = '1987' or $layoutVersion = '1989'">
37603771
<xsl:attribute name="font-size">9pt</xsl:attribute>
37613772
</xsl:if>
@@ -3864,6 +3875,11 @@
38643875
</xsl:if>
38653876
<xsl:if test="$namespace = 'iso'">
38663877
<xsl:variable name="note_name" select="*[local-name() = 'name']"/>
3878+
<xsl:if test="$layoutVersion = '1951'">
3879+
<xsl:if test="$revision_date_num"> <!-- &lt; 19610101 -->
3880+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
3881+
</xsl:if>
3882+
</xsl:if>
38673883
<xsl:if test="$layoutVersion = '1987'">
38683884
<xsl:attribute name="padding-right">1mm</xsl:attribute>
38693885
<xsl:if test="not(translate($note_name,'0123456789','') = $note_name)"> <!-- NOTE with number -->
@@ -5463,6 +5479,11 @@
54635479
</xsl:if>
54645480
</xsl:if>
54655481
<xsl:if test="$namespace = 'iso'">
5482+
<xsl:if test="$layoutVersion = '1951'">
5483+
<xsl:if test="$revision_date_num &gt;= 19680101">
5484+
<xsl:attribute name="font-size">9pt</xsl:attribute>
5485+
</xsl:if>
5486+
</xsl:if>
54665487
<xsl:if test="$layoutVersion = '1972' or $layoutVersion = '1979' or $layoutVersion = '1987' or $layoutVersion = '1989'">
54675488
<xsl:attribute name="font-size">9pt</xsl:attribute>
54685489
</xsl:if>
@@ -7664,6 +7685,9 @@
76647685
$namespace = 'rsd'">
76657686
<fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
76667687
<xsl:if test="$namespace = 'iso'">
7688+
<xsl:if test="$layoutVersion = '1951'">
7689+
<xsl:attribute name="font-size">inherit</xsl:attribute>
7690+
</xsl:if>
76677691
<xsl:if test="$layoutVersion = '2024'">
76687692
<xsl:attribute name="margin-top">12pt</xsl:attribute>
76697693
<xsl:attribute name="margin-bottom">2pt</xsl:attribute>
@@ -9003,15 +9027,28 @@
90039027
</xsl:choose>
90049028
</xsl:variable>
90059029
<xsl:variable name="current_fn_number_text">
9006-
<xsl:value-of select="$current_fn_number"/>
9030+
<xsl:choose>
9031+
<xsl:when test="$namespace = 'iso'">
9032+
<xsl:choose>
9033+
<xsl:when test="$layoutVersion = '1951' and translate($current_fn_number, '0123456789', '') = ''">
9034+
<!-- replace number to asterisks -->
9035+
<xsl:call-template name="repeat">
9036+
<xsl:with-param name="char" select="'*'"/>
9037+
<xsl:with-param name="count" select="$current_fn_number"/>
9038+
</xsl:call-template>
9039+
</xsl:when>
9040+
<xsl:otherwise><xsl:value-of select="$current_fn_number"/><xsl:text>)</xsl:text></xsl:otherwise>
9041+
</xsl:choose>
9042+
</xsl:when>
9043+
<xsl:otherwise>
9044+
<xsl:value-of select="$current_fn_number"/>
9045+
</xsl:otherwise>
9046+
</xsl:choose>
90079047
<xsl:if test="$namespace = 'bsi'">
90089048
<xsl:if test="$document_type = 'PAS'">
90099049
<xsl:text>)</xsl:text>
90109050
</xsl:if>
90119051
</xsl:if>
9012-
<xsl:if test="$namespace = 'iso'">
9013-
<xsl:text>)</xsl:text>
9014-
</xsl:if>
90159052
<xsl:if test="$namespace = 'jis'">
90169053
<fo:inline font-weight="normal">)</fo:inline>
90179054
</xsl:if>
@@ -10819,13 +10856,24 @@
1081910856
</fo:inline>
1082010857
</xsl:template>
1082110858

10822-
<xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
10859+
<xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
10860+
<xsl:param name="txt"/>
1082310861
<!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
10824-
<xsl:variable name="text" select="."/>
10862+
<xsl:variable name="text">
10863+
<xsl:choose>
10864+
<xsl:when test="$txt != ''">
10865+
<xsl:value-of select="$txt"/>
10866+
</xsl:when>
10867+
<xsl:otherwise>
10868+
<xsl:value-of select="."/>
10869+
</xsl:otherwise>
10870+
</xsl:choose>
10871+
</xsl:variable>
1082510872
<xsl:variable name="ratio_">
1082610873
<xsl:choose>
1082710874
<xsl:when test="$namespace = 'iso'">
1082810875
<xsl:choose>
10876+
<xsl:when test="$layoutVersion = '1951'">0.9</xsl:when>
1082910877
<xsl:when test="$layoutVersion = '2024'">0.8</xsl:when>
1083010878
<xsl:otherwise>0.75</xsl:otherwise>
1083110879
</xsl:choose>
@@ -12775,13 +12823,25 @@
1277512823
</xsl:if>
1277612824
</xsl:if>
1277712825
<xsl:if test="$namespace = 'iso'">
12778-
<xsl:if test="$layoutVersion = '1987'">
12826+
<xsl:if test="$layoutVersion = '1951' or $layoutVersion = '1987'">
1277912827
<xsl:if test="following-sibling::*[1][self::iso:note] and not(preceding-sibling::*[1][self::iso:note])">
1278012828
<!-- NOTES -->
1278112829
<fo:block font-size="9.5pt" keep-with-next="always" margin-bottom="6pt" text-transform="uppercase">
12782-
<xsl:call-template name="getLocalizedString">
12783-
<xsl:with-param name="key">Note.pl</xsl:with-param>
12784-
</xsl:call-template>
12830+
<xsl:variable name="i18n_notes">
12831+
<xsl:call-template name="getLocalizedString">
12832+
<xsl:with-param name="key">Note.pl</xsl:with-param>
12833+
</xsl:call-template>
12834+
</xsl:variable>
12835+
<xsl:choose>
12836+
<xsl:when test="$layoutVersion = '1951'">
12837+
<xsl:call-template name="smallcaps">
12838+
<xsl:with-param name="txt" select="$i18n_notes"/>
12839+
</xsl:call-template>
12840+
</xsl:when>
12841+
<xsl:otherwise>
12842+
<xsl:value-of select="$i18n_notes"/>
12843+
</xsl:otherwise>
12844+
</xsl:choose>
1278512845
</fo:block>
1278612846
</xsl:if>
1278712847
</xsl:if>
@@ -15483,11 +15543,16 @@
1548315543
<xsl:choose>
1548415544
<xsl:when test="$namespace = 'bsi' or
1548515545
$namespace = 'iho' or
15486-
$namespace = 'iso' or
1548715546
$namespace = 'jcgm' or
1548815547
$namespace = 'm3d' or
1548915548
$namespace = 'ogc' or
1549015549
$namespace = 'rsd'">inline</xsl:when> <!-- display first Example paragraph on the same line as EXAMPLE title -->
15550+
<xsl:when test="$namespace = 'iso'">
15551+
<xsl:choose>
15552+
<xsl:when test="$layoutVersion = '1951' and $revision_date_num &lt; 19610101">list</xsl:when>
15553+
<xsl:otherwise>inline</xsl:otherwise>
15554+
</xsl:choose>
15555+
</xsl:when>
1549115556
<xsl:when test="$namespace = 'iec'">
1549215557
<xsl:choose>
1549315558
<!-- if example contains only one (except 'name') element (paragraph for example), then display it on the same line as EXAMPLE title -->
@@ -15532,18 +15597,22 @@
1553215597

1553315598
<xsl:when test="contains(normalize-space($fo_element), 'list')">
1553415599

15535-
<xsl:variable name="provisional_distance_between_starts">
15600+
<xsl:variable name="provisional_distance_between_starts_">
1553615601
<xsl:choose>
15602+
<xsl:when test="$namespace = 'iso'">45</xsl:when>
1553715603
<xsl:when test="$namespace = 'jis'"><xsl:value-of select="10 + $text_indent"/></xsl:when>
1553815604
<xsl:otherwise>7</xsl:otherwise>
1553915605
</xsl:choose>
1554015606
</xsl:variable>
15541-
<xsl:variable name="indent">
15607+
<xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
15608+
<xsl:variable name="indent_">
1554215609
<xsl:choose>
15610+
<xsl:when test="$namespace = 'iso'">28</xsl:when>
1554315611
<xsl:when test="$namespace = 'jis'"><xsl:value-of select="$text_indent"/></xsl:when>
1554415612
<xsl:otherwise>0</xsl:otherwise>
1554515613
</xsl:choose>
1554615614
</xsl:variable>
15615+
<xsl:variable name="indent" select="normalize-space($indent_)"/>
1554715616

1554815617
<fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
1554915618
<fo:list-item>
@@ -15632,7 +15701,18 @@
1563215701

1563315702
<xsl:variable name="num"><xsl:number/></xsl:variable>
1563415703
<xsl:variable name="element">
15635-
<xsl:if test="$namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'rsd'">
15704+
<xsl:if test="$namespace = 'iso'">
15705+
<xsl:choose>
15706+
<xsl:when test="$num = 1 and not(contains($fo_element, 'block'))">inline</xsl:when>
15707+
<xsl:otherwise>
15708+
<xsl:choose>
15709+
<xsl:when test="$layoutVersion = '1951' and $revision_date_num &lt; 19610101">list</xsl:when>
15710+
<xsl:otherwise>block</xsl:otherwise>
15711+
</xsl:choose>
15712+
</xsl:otherwise>
15713+
</xsl:choose>
15714+
</xsl:if>
15715+
<xsl:if test="$namespace = 'jcgm' or $namespace = 'rsd'">
1563615716
<xsl:choose>
1563715717
<xsl:when test="$num = 1 and not(contains($fo_element, 'block'))">inline</xsl:when>
1563815718
<xsl:otherwise>block</xsl:otherwise>
@@ -16021,7 +16101,14 @@
1602116101
</xsl:choose>
1602216102
</xsl:if>
1602316103
<xsl:if test="$namespace = 'ieee'">1</xsl:if>
16024-
<xsl:if test="$namespace = 'iso' or $namespace = 'jcgm'">
16104+
<xsl:if test="$namespace = 'iso'">
16105+
<xsl:choose>
16106+
<xsl:when test="$layoutVersion = '1951'">2</xsl:when>
16107+
<xsl:when test="$depth = 2">3</xsl:when>
16108+
<xsl:otherwise>4</xsl:otherwise>
16109+
</xsl:choose>
16110+
</xsl:if>
16111+
<xsl:if test=" $namespace = 'jcgm'">
1602516112
<xsl:choose>
1602616113
<xsl:when test="$depth = 2">3</xsl:when>
1602716114
<xsl:otherwise>4</xsl:otherwise>
@@ -16561,7 +16648,14 @@
1656116648
<label level="3" font-size="75%">o</label> <!-- white circle -->
1656216649
</xsl:when>
1656316650
<xsl:when test="$namespace = 'iso'">
16564-
<label>&#x2014;</label> <!-- em dash -->
16651+
<xsl:choose>
16652+
<xsl:when test="$layoutVersion = '1951'">
16653+
<label>&#x2013;</label> <!-- en dash -->
16654+
</xsl:when>
16655+
<xsl:otherwise>
16656+
<label>&#x2014;</label> <!-- em dash -->
16657+
</xsl:otherwise>
16658+
</xsl:choose>
1656516659
</xsl:when>
1656616660
<xsl:when test="$namespace = 'jcgm'">
1656716661
<label level="1">&#x2014;</label> <!-- em dash -->
@@ -16671,14 +16765,19 @@
1667116765
</xsl:when>
1667216766
<xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
1667316767

16674-
<xsl:variable name="label">
16768+
<xsl:variable name="type" select="../@type"/>
1667516769

16676-
<xsl:variable name="type" select="../@type"/>
16770+
<xsl:variable name="label">
1667716771

1667816772
<xsl:variable name="style_prefix_">
1667916773
<xsl:if test="$type = 'roman'">
1668016774
<xsl:if test="$namespace = 'bipm'">(</xsl:if> <!-- Example: (i) -->
1668116775
</xsl:if>
16776+
<xsl:if test="$type = 'alphabet'">
16777+
<xsl:if test="$namespace = 'iso'">
16778+
<xsl:if test="$layoutVersion = '1951'">(</xsl:if> <!-- Example: (a) -->
16779+
</xsl:if>
16780+
</xsl:if>
1668216781
</xsl:variable>
1668316782
<xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
1668416783

@@ -16717,13 +16816,28 @@
1671716816
<xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
1671816817
<xsl:value-of select="$style_prefix"/>
1671916818
</xsl:if>
16819+
1672016820
<xsl:value-of select="@label"/>
16821+
1672116822
<xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
1672216823
<xsl:value-of select="$style_suffix"/>
1672316824
</xsl:if>
1672416825
</xsl:variable>
1672516826

16726-
<xsl:value-of select="normalize-space($label)"/>
16827+
16828+
<xsl:choose>
16829+
<xsl:when test="$namespace = 'iso'">
16830+
<xsl:choose>
16831+
<xsl:when test="$layoutVersion = '1951' and $type = 'alphabet'">(<fo:inline font-style="italic"><xsl:value-of select="@label"/></fo:inline>)</xsl:when>
16832+
<xsl:otherwise>
16833+
<xsl:value-of select="normalize-space($label)"/>
16834+
</xsl:otherwise>
16835+
</xsl:choose>
16836+
</xsl:when>
16837+
<xsl:otherwise>
16838+
<xsl:value-of select="normalize-space($label)"/>
16839+
</xsl:otherwise>
16840+
</xsl:choose>
1672716841

1672816842
</xsl:when>
1672916843
<xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -16842,6 +16956,39 @@
1684216956
</xsl:when>
1684316957
<xsl:otherwise>
1684416958
<xsl:choose>
16959+
<xsl:when test="$namespace = 'iso'">
16960+
<xsl:choose>
16961+
<xsl:when test="$layoutVersion = '1951' and local-name() = 'ul'">
16962+
<fo:block-container margin-left="8mm">
16963+
<xsl:if test="ancestor::*[local-name() = 'sections' or local-name() = 'annex']">
16964+
<xsl:variable name="level">
16965+
<xsl:for-each select="ancestor::*[1]">
16966+
<xsl:call-template name="getLevel"/>
16967+
</xsl:for-each>
16968+
</xsl:variable>
16969+
<!-- 5 + 6 (from list-block provisional-distance-between-starts) mm -->
16970+
<xsl:attribute name="margin-left">
16971+
<xsl:value-of select="5 + (($level - 1) * 6)"/>mm
16972+
</xsl:attribute>
16973+
</xsl:if>
16974+
<fo:block-container margin-left="0">
16975+
<fo:block role="SKIP">
16976+
<xsl:apply-templates select="." mode="list">
16977+
<xsl:with-param name="indent" select="$indent"/>
16978+
</xsl:apply-templates>
16979+
</fo:block>
16980+
</fo:block-container>
16981+
</fo:block-container>
16982+
</xsl:when>
16983+
<xsl:otherwise>
16984+
<fo:block role="SKIP">
16985+
<xsl:apply-templates select="." mode="list">
16986+
<xsl:with-param name="indent" select="$indent"/>
16987+
</xsl:apply-templates>
16988+
</fo:block>
16989+
</xsl:otherwise>
16990+
</xsl:choose>
16991+
</xsl:when>
1684516992
<xsl:when test="$namespace = 'jis'">
1684616993
<fo:block-container role="SKIP">
1684716994
<xsl:if test="ancestor::jis:ol or ancestor::jis:ul">
@@ -16968,6 +17115,13 @@
1696817115
<xsl:attribute name="provisional-distance-between-starts">5mm</xsl:attribute>
1696917116
</xsl:if>
1697017117
</xsl:if>
17118+
17119+
<xsl:if test="$namespace = 'iso'">
17120+
<xsl:if test="$layoutVersion = '1951' and local-name() = 'ul'">
17121+
<xsl:attribute name="provisional-distance-between-starts">5mm</xsl:attribute>
17122+
</xsl:if>
17123+
</xsl:if>
17124+
1697117125
<xsl:if test="$namespace = 'gb' or $namespace = 'm3d' or $namespace = 'mpfd'">
1697217126
<xsl:if test="local-name() = 'ol'">
1697317127
<xsl:attribute name="provisional-distance-between-starts">7mm</xsl:attribute>

0 commit comments

Comments
 (0)