metanorma-iso 1.9.0.1 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/asciidoctor/iso/cleanup.rb +3 -4
- data/lib/asciidoctor/iso/front_id.rb +7 -2
- data/lib/asciidoctor/iso/isodoc.rng +52 -11
- data/lib/asciidoctor/iso/isostandard.rng +4 -1
- data/lib/asciidoctor/iso/reqt.rng +15 -4
- data/lib/asciidoctor/iso/section.rb +7 -1
- data/lib/asciidoctor/iso/validate_section.rb +18 -20
- data/lib/asciidoctor/iso/validate_style.rb +17 -9
- data/lib/isodoc/iso/index.rb +48 -24
- data/lib/isodoc/iso/iso.amendment.xsl +387 -151
- data/lib/isodoc/iso/iso.international-standard.xsl +387 -151
- data/lib/isodoc/iso/metadata.rb +28 -16
- data/lib/isodoc/iso/presentation_xml_convert.rb +21 -12
- data/lib/metanorma/iso/processor.rb +1 -1
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/asciidoctor/base_spec.rb +2 -1
- data/spec/asciidoctor/blocks_spec.rb +41 -2
- data/spec/asciidoctor/cleanup_spec.rb +2 -2
- data/spec/asciidoctor/refs_spec.rb +1 -1
- data/spec/isodoc/inline_spec.rb +250 -219
- data/spec/isodoc/terms_spec.rb +30 -0
- metadata +2 -2
@@ -529,7 +529,7 @@
|
|
529
529
|
|
530
530
|
<fo:block-container border-top="1mm double black" line-height="1.1" margin-top="3mm">
|
531
531
|
<fo:block margin-right="5mm">
|
532
|
-
<fo:block font-size="18pt" font-weight="bold" margin-top="6pt">
|
532
|
+
<fo:block font-size="18pt" font-weight="bold" margin-top="6pt" role="H1">
|
533
533
|
<xsl:if test="normalize-space($title-intro) != ''">
|
534
534
|
<xsl:value-of select="$title-intro"/>
|
535
535
|
<xsl:text> — </xsl:text>
|
@@ -541,7 +541,7 @@
|
|
541
541
|
|
542
542
|
<xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-amd']"/>
|
543
543
|
<xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
|
544
|
-
<fo:block margin-top="12pt">
|
544
|
+
<fo:block margin-top="12pt" role="H1">
|
545
545
|
<xsl:call-template name="printAmendmentTitle"/>
|
546
546
|
</fo:block>
|
547
547
|
</xsl:if>
|
@@ -549,7 +549,7 @@
|
|
549
549
|
</fo:block>
|
550
550
|
|
551
551
|
<fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
|
552
|
-
<fo:block font-size="11pt" font-style="italic" line-height="1.5">
|
552
|
+
<fo:block font-size="11pt" font-style="italic" line-height="1.5" role="H1">
|
553
553
|
|
554
554
|
<xsl:if test="normalize-space($title-intro-fr) != ''">
|
555
555
|
<xsl:value-of select="$title-intro-fr"/>
|
@@ -562,7 +562,7 @@
|
|
562
562
|
|
563
563
|
<xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-amd']"/>
|
564
564
|
<xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
|
565
|
-
<fo:block margin-top="6pt">
|
565
|
+
<fo:block margin-top="6pt" role="H1">
|
566
566
|
<xsl:call-template name="printAmendmentTitle">
|
567
567
|
<xsl:with-param name="lang" select="'fr'"/>
|
568
568
|
</xsl:call-template>
|
@@ -654,7 +654,7 @@
|
|
654
654
|
<xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date"/> -->
|
655
655
|
<xsl:if test="$doctype = 'amendment'">
|
656
656
|
<fo:block text-align="right" margin-right="0.5mm">
|
657
|
-
<fo:block font-weight="bold" margin-top="4pt">
|
657
|
+
<fo:block font-weight="bold" margin-top="4pt" role="H1">
|
658
658
|
<xsl:variable name="title-amendment">
|
659
659
|
<xsl:call-template name="getTitle">
|
660
660
|
<xsl:with-param name="name" select="'title-amendment'"/>
|
@@ -724,7 +724,7 @@
|
|
724
724
|
<fo:table-cell>
|
725
725
|
<fo:block-container border-top="1mm double black" line-height="1.1">
|
726
726
|
<fo:block margin-right="5mm">
|
727
|
-
<fo:block font-size="18pt" font-weight="bold" margin-top="12pt">
|
727
|
+
<fo:block font-size="18pt" font-weight="bold" margin-top="12pt" role="H1">
|
728
728
|
|
729
729
|
<xsl:if test="normalize-space($title-intro) != ''">
|
730
730
|
<xsl:value-of select="$title-intro"/>
|
@@ -746,14 +746,14 @@
|
|
746
746
|
</xsl:if> -->
|
747
747
|
<xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-amd']"/>
|
748
748
|
<xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
|
749
|
-
<fo:block margin-right="-5mm" margin-top="12pt">
|
749
|
+
<fo:block margin-right="-5mm" margin-top="12pt" role="H1">
|
750
750
|
<xsl:call-template name="printAmendmentTitle"/>
|
751
751
|
</fo:block>
|
752
752
|
</xsl:if>
|
753
753
|
</fo:block>
|
754
754
|
|
755
755
|
<fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
|
756
|
-
<fo:block font-size="11pt" font-style="italic" line-height="1.5">
|
756
|
+
<fo:block font-size="11pt" font-style="italic" line-height="1.5" role="H1">
|
757
757
|
|
758
758
|
<xsl:if test="normalize-space($title-intro-fr) != ''">
|
759
759
|
<xsl:value-of select="$title-intro-fr"/>
|
@@ -766,7 +766,7 @@
|
|
766
766
|
|
767
767
|
<xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-amd']"/>
|
768
768
|
<xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
|
769
|
-
<fo:block margin-right="-5mm" margin-top="6pt">
|
769
|
+
<fo:block margin-right="-5mm" margin-top="6pt" role="H1">
|
770
770
|
<xsl:call-template name="printAmendmentTitle">
|
771
771
|
<xsl:with-param name="lang" select="'fr'"/>
|
772
772
|
</xsl:call-template>
|
@@ -857,7 +857,7 @@
|
|
857
857
|
|
858
858
|
<fo:block-container border-top="1mm double black" line-height="1.1">
|
859
859
|
<fo:block margin-right="40mm">
|
860
|
-
<fo:block font-size="18pt" font-weight="bold" margin-top="12pt">
|
860
|
+
<fo:block font-size="18pt" font-weight="bold" margin-top="12pt" role="H1">
|
861
861
|
|
862
862
|
<xsl:if test="normalize-space($title-intro) != ''">
|
863
863
|
<xsl:value-of select="$title-intro"/>
|
@@ -880,7 +880,7 @@
|
|
880
880
|
</fo:block>
|
881
881
|
|
882
882
|
<fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
|
883
|
-
<fo:block font-size="11pt" font-style="italic" line-height="1.5">
|
883
|
+
<fo:block font-size="11pt" font-style="italic" line-height="1.5" role="H1">
|
884
884
|
|
885
885
|
<xsl:if test="normalize-space($title-intro-fr) != ''">
|
886
886
|
<xsl:value-of select="$title-intro-fr"/>
|
@@ -972,7 +972,7 @@
|
|
972
972
|
</fo:block-container>
|
973
973
|
<fo:block-container font-size="16pt">
|
974
974
|
<!-- Information and documentation — Codes for transcription systems -->
|
975
|
-
<fo:block font-weight="bold">
|
975
|
+
<fo:block font-weight="bold" role="H1">
|
976
976
|
|
977
977
|
<xsl:if test="normalize-space($title-intro) != ''">
|
978
978
|
<xsl:value-of select="$title-intro"/>
|
@@ -995,7 +995,7 @@
|
|
995
995
|
</fo:block>
|
996
996
|
|
997
997
|
<fo:block font-size="12pt"><xsl:value-of select="$linebreak"/></fo:block>
|
998
|
-
<fo:block>
|
998
|
+
<fo:block role="H1">
|
999
999
|
<xsl:if test="normalize-space($title-intro-fr) != ''">
|
1000
1000
|
<xsl:value-of select="$title-intro-fr"/>
|
1001
1001
|
<xsl:text> — </xsl:text>
|
@@ -1073,79 +1073,80 @@
|
|
1073
1073
|
<fo:block break-after="page"/>
|
1074
1074
|
</xsl:if>
|
1075
1075
|
<fo:block-container font-weight="bold">
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
<xsl:call-template name="getLocalizedString">
|
1081
|
-
<xsl:with-param name="key">table_of_contents</xsl:with-param>
|
1082
|
-
</xsl:call-template>
|
1083
|
-
</fo:inline>
|
1084
|
-
<fo:inline keep-together.within-line="always">
|
1085
|
-
<fo:leader leader-pattern="space"/>
|
1086
|
-
<fo:inline font-weight="normal" font-size="10pt">
|
1087
|
-
<!-- Page -->
|
1076
|
+
<fo:block role="TOC">
|
1077
|
+
<fo:block text-align-last="justify" font-size="16pt" margin-top="10pt" margin-bottom="18pt">
|
1078
|
+
<fo:inline font-size="16pt" font-weight="bold" role="H1">
|
1079
|
+
<!-- Contents -->
|
1088
1080
|
<xsl:call-template name="getLocalizedString">
|
1089
|
-
|
1090
|
-
|
1081
|
+
<xsl:with-param name="key">table_of_contents</xsl:with-param>
|
1082
|
+
</xsl:call-template>
|
1091
1083
|
</fo:inline>
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
<xsl:variable name="margin-left">12</xsl:variable>
|
1103
|
-
<xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
|
1084
|
+
<fo:inline keep-together.within-line="always">
|
1085
|
+
<fo:leader leader-pattern="space"/>
|
1086
|
+
<fo:inline font-weight="normal" font-size="10pt">
|
1087
|
+
<!-- Page -->
|
1088
|
+
<xsl:call-template name="getLocalizedString">
|
1089
|
+
<xsl:with-param name="key">locality.page</xsl:with-param>
|
1090
|
+
</xsl:call-template>
|
1091
|
+
</fo:inline>
|
1092
|
+
</fo:inline>
|
1093
|
+
</fo:block>
|
1104
1094
|
|
1105
|
-
<
|
1106
|
-
<xsl:
|
1107
|
-
|
1108
|
-
|
1109
|
-
<xsl:
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1095
|
+
<xsl:if test="$debug = 'true'">
|
1096
|
+
<xsl:text disable-output-escaping="yes"><!--</xsl:text>
|
1097
|
+
DEBUG
|
1098
|
+
contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
|
1099
|
+
<xsl:text disable-output-escaping="yes">--></xsl:text>
|
1100
|
+
</xsl:if>
|
1101
|
+
|
1102
|
+
<xsl:variable name="margin-left">12</xsl:variable>
|
1103
|
+
<xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
|
1104
|
+
|
1105
|
+
<fo:block role="TOCI">
|
1106
|
+
<xsl:if test="@level = 1">
|
1107
|
+
<xsl:attribute name="margin-top">5pt</xsl:attribute>
|
1116
1108
|
</xsl:if>
|
1117
|
-
<xsl:
|
1118
|
-
<xsl:
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1109
|
+
<xsl:if test="@level = 3">
|
1110
|
+
<xsl:attribute name="margin-top">-0.7pt</xsl:attribute>
|
1111
|
+
</xsl:if>
|
1112
|
+
<fo:list-block>
|
1113
|
+
<xsl:attribute name="margin-left"><xsl:value-of select="$margin-left * (@level - 1)"/>mm</xsl:attribute>
|
1114
|
+
<xsl:if test="@level >= 2 or @type = 'annex'">
|
1115
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
1116
|
+
</xsl:if>
|
1117
|
+
<xsl:attribute name="provisional-distance-between-starts">
|
1118
|
+
<xsl:choose>
|
1119
|
+
<!-- skip 0 section without subsections -->
|
1120
|
+
<xsl:when test="@level >= 3"><xsl:value-of select="$margin-left * 1.2"/>mm</xsl:when>
|
1121
|
+
<xsl:when test="@section != ''"><xsl:value-of select="$margin-left"/>mm</xsl:when>
|
1122
|
+
<xsl:otherwise>0mm</xsl:otherwise>
|
1123
|
+
</xsl:choose>
|
1124
|
+
</xsl:attribute>
|
1125
|
+
<fo:list-item>
|
1126
|
+
<fo:list-item-label end-indent="label-end()">
|
1127
|
+
<fo:block>
|
1128
|
+
<xsl:value-of select="@section"/>
|
1129
|
+
</fo:block>
|
1130
|
+
</fo:list-item-label>
|
1131
|
+
<fo:list-item-body start-indent="body-start()">
|
1132
|
+
<fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
|
1133
|
+
<fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
|
1136
1134
|
|
1137
|
-
|
1138
|
-
|
1139
|
-
<fo:inline
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1135
|
+
<xsl:apply-templates select="title"/>
|
1136
|
+
|
1137
|
+
<fo:inline keep-together.within-line="always">
|
1138
|
+
<fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
|
1139
|
+
<fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
|
1140
|
+
</fo:inline>
|
1141
|
+
</fo:basic-link>
|
1142
|
+
</fo:block>
|
1143
|
+
</fo:list-item-body>
|
1144
|
+
</fo:list-item>
|
1145
|
+
</fo:list-block>
|
1146
|
+
</fo:block>
|
1147
|
+
|
1148
|
+
</xsl:for-each>
|
1149
|
+
</fo:block>
|
1149
1150
|
</fo:block-container>
|
1150
1151
|
</xsl:otherwise>
|
1151
1152
|
</xsl:choose>
|
@@ -1179,7 +1180,7 @@
|
|
1179
1180
|
|
1180
1181
|
<xsl:variable name="title-intro-doc-lang" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-intro']"/>
|
1181
1182
|
|
1182
|
-
<fo:block>
|
1183
|
+
<fo:block role="H1">
|
1183
1184
|
<xsl:if test="normalize-space($title-intro-doc-lang) != ''">
|
1184
1185
|
<xsl:value-of select="$title-intro-doc-lang"/>
|
1185
1186
|
<xsl:text> — </xsl:text>
|
@@ -1201,13 +1202,13 @@
|
|
1201
1202
|
</xsl:if>
|
1202
1203
|
</xsl:if>
|
1203
1204
|
</fo:block>
|
1204
|
-
<fo:block>
|
1205
|
+
<fo:block role="H1">
|
1205
1206
|
<xsl:value-of select="$title-part-doc-lang"/>
|
1206
1207
|
</fo:block>
|
1207
1208
|
|
1208
1209
|
<xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-amd']"/>
|
1209
1210
|
<xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
|
1210
|
-
<fo:block margin-top="12pt">
|
1211
|
+
<fo:block margin-top="12pt" role="H1">
|
1211
1212
|
<xsl:call-template name="printAmendmentTitle"/>
|
1212
1213
|
</fo:block>
|
1213
1214
|
</xsl:if>
|
@@ -1454,7 +1455,10 @@
|
|
1454
1455
|
|
1455
1456
|
|
1456
1457
|
<xsl:template match="iso:license-statement//iso:title">
|
1457
|
-
<
|
1458
|
+
<xsl:variable name="level">
|
1459
|
+
<xsl:call-template name="getLevel"/>
|
1460
|
+
</xsl:variable>
|
1461
|
+
<fo:block text-align="center" font-weight="bold" role="H{$level}">
|
1458
1462
|
<xsl:apply-templates/>
|
1459
1463
|
</fo:block>
|
1460
1464
|
</xsl:template>
|
@@ -1482,7 +1486,7 @@
|
|
1482
1486
|
</fo:block> -->
|
1483
1487
|
|
1484
1488
|
<xsl:template match="iso:copyright-statement/iso:clause[1]/iso:title">
|
1485
|
-
<fo:block margin-bottom="3mm">
|
1489
|
+
<fo:block margin-bottom="3mm" role="H1">
|
1486
1490
|
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="14mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/>
|
1487
1491
|
<!-- <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold">COPYRIGHT PROTECTED DOCUMENT</fo:inline> -->
|
1488
1492
|
<fo:inline padding-left="6mm" font-size="12pt" font-weight="bold"><xsl:apply-templates/></fo:inline>
|
@@ -1519,8 +1523,9 @@
|
|
1519
1523
|
<xsl:call-template name="titleAmendment"/>
|
1520
1524
|
</xsl:when>
|
1521
1525
|
<xsl:otherwise>
|
1522
|
-
<fo:block font-size="16pt" text-align="center" margin-bottom="48pt" keep-with-next="always">
|
1526
|
+
<fo:block font-size="16pt" text-align="center" margin-bottom="48pt" keep-with-next="always" role="H1">
|
1523
1527
|
<xsl:apply-templates/>
|
1528
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
1524
1529
|
</fo:block>
|
1525
1530
|
</xsl:otherwise>
|
1526
1531
|
</xsl:choose>
|
@@ -1533,7 +1538,7 @@
|
|
1533
1538
|
<xsl:call-template name="titleAmendment"/>
|
1534
1539
|
</xsl:when>
|
1535
1540
|
<xsl:otherwise>
|
1536
|
-
<fo:block font-size="16pt" font-weight="bold" text-align="center" margin-top="6pt" margin-bottom="36pt" keep-with-next="always">
|
1541
|
+
<fo:block font-size="16pt" font-weight="bold" text-align="center" margin-top="6pt" margin-bottom="36pt" keep-with-next="always" role="H1">
|
1537
1542
|
<xsl:apply-templates/>
|
1538
1543
|
</fo:block>
|
1539
1544
|
</xsl:otherwise>
|
@@ -1566,8 +1571,9 @@
|
|
1566
1571
|
|
1567
1572
|
<xsl:choose>
|
1568
1573
|
<xsl:when test="$doctype = 'amendment' and not(ancestor::iso:preface)">
|
1569
|
-
<fo:block font-size="11pt" font-style="italic" margin-bottom="12pt" keep-with-next="always">
|
1574
|
+
<fo:block font-size="11pt" font-style="italic" margin-bottom="12pt" keep-with-next="always" role="H{$level}">
|
1570
1575
|
<xsl:apply-templates/>
|
1576
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
1571
1577
|
</fo:block>
|
1572
1578
|
</xsl:when>
|
1573
1579
|
|
@@ -1593,6 +1599,7 @@
|
|
1593
1599
|
</xsl:choose>
|
1594
1600
|
</xsl:attribute>
|
1595
1601
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1602
|
+
<xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
|
1596
1603
|
<xsl:if test="$element-name = 'fo:inline'">
|
1597
1604
|
<xsl:choose>
|
1598
1605
|
<xsl:when test="$lang = 'zh'">
|
@@ -1604,6 +1611,7 @@
|
|
1604
1611
|
</xsl:choose>
|
1605
1612
|
</xsl:if>
|
1606
1613
|
<xsl:apply-templates/>
|
1614
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
1607
1615
|
</xsl:element>
|
1608
1616
|
|
1609
1617
|
<xsl:if test="$element-name = 'fo:inline' and not(following-sibling::iso:p)">
|
@@ -1784,8 +1792,11 @@
|
|
1784
1792
|
<xsl:apply-templates select="."/>
|
1785
1793
|
</xsl:template>
|
1786
1794
|
|
1787
|
-
<xsl:template match="iso:preferred">
|
1788
|
-
<
|
1795
|
+
<xsl:template match="iso:preferred">
|
1796
|
+
<xsl:variable name="levelTerm">
|
1797
|
+
<xsl:call-template name="getLevelTermName"/>
|
1798
|
+
</xsl:variable>
|
1799
|
+
<fo:block line-height="1.1" role="H{$levelTerm}">
|
1789
1800
|
<fo:block font-weight="bold" keep-with-next="always">
|
1790
1801
|
<xsl:apply-templates select="ancestor::iso:term/iso:name" mode="presentation"/>
|
1791
1802
|
</fo:block>
|
@@ -1949,7 +1960,7 @@
|
|
1949
1960
|
<fo:block id="{@id}" span="all">
|
1950
1961
|
<xsl:apply-templates select="iso:title"/>
|
1951
1962
|
</fo:block>
|
1952
|
-
<fo:block>
|
1963
|
+
<fo:block role="Index">
|
1953
1964
|
<xsl:apply-templates select="*[not(local-name() = 'title')]"/>
|
1954
1965
|
</fo:block>
|
1955
1966
|
</fo:flow>
|
@@ -1958,7 +1969,7 @@
|
|
1958
1969
|
|
1959
1970
|
<!-- <xsl:template match="iso:clause[@type = 'index']/iso:title" priority="4"> -->
|
1960
1971
|
<xsl:template match="iso:indexsect/iso:title" priority="4">
|
1961
|
-
<fo:block font-size="16pt" font-weight="bold" margin-bottom="84pt">
|
1972
|
+
<fo:block font-size="16pt" font-weight="bold" margin-bottom="84pt" role="H1">
|
1962
1973
|
<!-- Index -->
|
1963
1974
|
<xsl:apply-templates/>
|
1964
1975
|
</fo:block>
|
@@ -2003,7 +2014,7 @@
|
|
2003
2014
|
<xsl:template name="insertHeaderFooter">
|
2004
2015
|
<xsl:param name="font-weight" select="'bold'"/>
|
2005
2016
|
<xsl:call-template name="insertHeaderEven"/>
|
2006
|
-
<fo:static-content flow-name="footer-even">
|
2017
|
+
<fo:static-content flow-name="footer-even" role="artifact">
|
2007
2018
|
<fo:block-container> <!-- display-align="after" -->
|
2008
2019
|
<fo:table table-layout="fixed" width="100%">
|
2009
2020
|
<fo:table-column column-width="33%"/>
|
@@ -2042,12 +2053,12 @@
|
|
2042
2053
|
</fo:block>
|
2043
2054
|
</fo:block-container>
|
2044
2055
|
</fo:static-content>
|
2045
|
-
<fo:static-content flow-name="header-odd">
|
2056
|
+
<fo:static-content flow-name="header-odd" role="artifact">
|
2046
2057
|
<fo:block-container height="24mm" display-align="before">
|
2047
2058
|
<fo:block font-size="12pt" font-weight="bold" text-align="right" padding-top="12.5mm"><xsl:value-of select="$ISOname"/></fo:block>
|
2048
2059
|
</fo:block-container>
|
2049
2060
|
</fo:static-content>
|
2050
|
-
<fo:static-content flow-name="footer-odd">
|
2061
|
+
<fo:static-content flow-name="footer-odd" role="artifact">
|
2051
2062
|
<fo:block-container> <!-- display-align="after" -->
|
2052
2063
|
<fo:table table-layout="fixed" width="100%">
|
2053
2064
|
<fo:table-column column-width="33%"/>
|
@@ -2075,7 +2086,7 @@
|
|
2075
2086
|
</fo:static-content>
|
2076
2087
|
</xsl:template>
|
2077
2088
|
<xsl:template name="insertHeaderEven">
|
2078
|
-
<fo:static-content flow-name="header-even">
|
2089
|
+
<fo:static-content flow-name="header-even" role="artifact">
|
2079
2090
|
<fo:block-container height="24mm" display-align="before">
|
2080
2091
|
<fo:block font-size="12pt" font-weight="bold" padding-top="12.5mm"><xsl:value-of select="$ISOname"/></fo:block>
|
2081
2092
|
</fo:block-container>
|
@@ -2326,8 +2337,9 @@
|
|
2326
2337
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
2327
2338
|
<xsl:attribute name="white-space">pre</xsl:attribute>
|
2328
2339
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
2340
|
+
<xsl:attribute name="role">Code</xsl:attribute>
|
2329
2341
|
|
2330
|
-
<xsl:attribute name="font-family">Courier</xsl:attribute>
|
2342
|
+
<xsl:attribute name="font-family">Courier New</xsl:attribute>
|
2331
2343
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
2332
2344
|
|
2333
2345
|
|
@@ -2350,8 +2362,13 @@
|
|
2350
2362
|
|
2351
2363
|
</xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
|
2352
2364
|
|
2353
|
-
</xsl:attribute-set><xsl:attribute-set name="
|
2354
|
-
</xsl:attribute-set><xsl:attribute-set name="
|
2365
|
+
</xsl:attribute-set><xsl:attribute-set name="subject-style">
|
2366
|
+
</xsl:attribute-set><xsl:attribute-set name="inherit-style">
|
2367
|
+
</xsl:attribute-set><xsl:attribute-set name="description-style">
|
2368
|
+
</xsl:attribute-set><xsl:attribute-set name="specification-style">
|
2369
|
+
</xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
|
2370
|
+
</xsl:attribute-set><xsl:attribute-set name="verification-style">
|
2371
|
+
</xsl:attribute-set><xsl:attribute-set name="import-style">
|
2355
2372
|
</xsl:attribute-set><xsl:attribute-set name="recommendation-style">
|
2356
2373
|
|
2357
2374
|
|
@@ -2418,6 +2435,7 @@
|
|
2418
2435
|
|
2419
2436
|
|
2420
2437
|
|
2438
|
+
|
2421
2439
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2422
2440
|
<xsl:attribute name="margin-top">8pt</xsl:attribute>
|
2423
2441
|
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
@@ -2443,7 +2461,9 @@
|
|
2443
2461
|
|
2444
2462
|
|
2445
2463
|
|
2446
|
-
</xsl:attribute-set><xsl:
|
2464
|
+
</xsl:attribute-set><xsl:variable name="table-border_">
|
2465
|
+
|
2466
|
+
</xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
|
2447
2467
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
2448
2468
|
|
2449
2469
|
|
@@ -2573,7 +2593,8 @@
|
|
2573
2593
|
|
2574
2594
|
|
2575
2595
|
|
2576
|
-
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
2596
|
+
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
2597
|
+
<xsl:attribute name="role">BlockQuote</xsl:attribute>
|
2577
2598
|
|
2578
2599
|
|
2579
2600
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
@@ -2663,7 +2684,7 @@
|
|
2663
2684
|
</xsl:attribute-set><xsl:attribute-set name="tt-style">
|
2664
2685
|
|
2665
2686
|
|
2666
|
-
<xsl:attribute name="font-family">Courier</xsl:attribute>
|
2687
|
+
<xsl:attribute name="font-family">Courier New</xsl:attribute>
|
2667
2688
|
|
2668
2689
|
|
2669
2690
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
|
@@ -2771,9 +2792,13 @@
|
|
2771
2792
|
<fo:block> </fo:block>
|
2772
2793
|
</xsl:if> -->
|
2773
2794
|
|
2795
|
+
|
2796
|
+
<!-- Display table's name before table as standalone block -->
|
2774
2797
|
<!-- $namespace = 'iso' or -->
|
2775
2798
|
|
2776
|
-
|
2799
|
+
|
2800
|
+
|
2801
|
+
|
2777
2802
|
|
2778
2803
|
|
2779
2804
|
|
@@ -2849,6 +2874,12 @@
|
|
2849
2874
|
|
2850
2875
|
|
2851
2876
|
|
2877
|
+
|
2878
|
+
|
2879
|
+
|
2880
|
+
<!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
|
2881
|
+
|
2882
|
+
|
2852
2883
|
<xsl:variable name="table_width">
|
2853
2884
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
2854
2885
|
100%
|
@@ -2869,6 +2900,7 @@
|
|
2869
2900
|
</xsl:if>
|
2870
2901
|
|
2871
2902
|
|
2903
|
+
|
2872
2904
|
<xsl:if test="ancestor::*[local-name() = 'table']">
|
2873
2905
|
<!-- for internal table in table cell -->
|
2874
2906
|
<attribute name="border">0.5pt solid black</attribute>
|
@@ -2903,6 +2935,8 @@
|
|
2903
2935
|
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
2904
2936
|
</xsl:if>
|
2905
2937
|
|
2938
|
+
|
2939
|
+
|
2906
2940
|
<xsl:choose>
|
2907
2941
|
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
2908
2942
|
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
@@ -3198,9 +3232,13 @@
|
|
3198
3232
|
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
|
3199
3233
|
<xsl:with-param name="continued">true</xsl:with-param>
|
3200
3234
|
</xsl:apply-templates>
|
3201
|
-
|
3202
|
-
|
3203
|
-
|
3235
|
+
|
3236
|
+
|
3237
|
+
<xsl:for-each select="ancestor::*[local-name()='table'][1]">
|
3238
|
+
<xsl:call-template name="fn_name_display"/>
|
3239
|
+
</xsl:for-each>
|
3240
|
+
|
3241
|
+
|
3204
3242
|
|
3205
3243
|
<fo:block text-align="right" font-style="italic">
|
3206
3244
|
<xsl:text> </xsl:text>
|
@@ -3289,7 +3327,11 @@
|
|
3289
3327
|
|
3290
3328
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
3291
3329
|
|
3292
|
-
<xsl:
|
3330
|
+
<xsl:variable name="isNoteOrFnExistShowAfterTable">
|
3331
|
+
|
3332
|
+
</xsl:variable>
|
3333
|
+
|
3334
|
+
<xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
|
3293
3335
|
|
3294
3336
|
<xsl:variable name="cols-count">
|
3295
3337
|
<xsl:choose>
|
@@ -3318,6 +3360,8 @@
|
|
3318
3360
|
</xsl:choose>
|
3319
3361
|
</xsl:for-each>
|
3320
3362
|
|
3363
|
+
|
3364
|
+
|
3321
3365
|
<xsl:choose>
|
3322
3366
|
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
3323
3367
|
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
@@ -3356,6 +3400,7 @@
|
|
3356
3400
|
|
3357
3401
|
|
3358
3402
|
|
3403
|
+
|
3359
3404
|
<!-- for BSI (not PAS) display Notes before footnotes -->
|
3360
3405
|
|
3361
3406
|
|
@@ -3432,21 +3477,29 @@
|
|
3432
3477
|
|
3433
3478
|
<fo:table-body>
|
3434
3479
|
|
3435
|
-
<xsl:variable name="
|
3480
|
+
<xsl:variable name="title_continued_">
|
3436
3481
|
<xsl:call-template name="getTitle">
|
3437
3482
|
<xsl:with-param name="name" select="'title-continued'"/>
|
3438
3483
|
</xsl:call-template>
|
3439
3484
|
</xsl:variable>
|
3440
3485
|
|
3486
|
+
<xsl:variable name="title_continued">
|
3487
|
+
<xsl:value-of select="$title_continued_"/>
|
3488
|
+
|
3489
|
+
</xsl:variable>
|
3490
|
+
|
3441
3491
|
<xsl:variable name="title_start" select="ancestor::*[local-name()='table'][1]/*[local-name()='name']/node()[1][self::text()]"/>
|
3442
3492
|
<xsl:variable name="table_number" select="substring-before($title_start, '—')"/>
|
3443
3493
|
|
3444
3494
|
<fo:table-row height="0" keep-with-next.within-page="always">
|
3445
3495
|
<fo:table-cell>
|
3496
|
+
|
3497
|
+
|
3446
3498
|
|
3447
3499
|
|
3448
3500
|
<fo:marker marker-class-name="table_continued"/>
|
3449
3501
|
|
3502
|
+
|
3450
3503
|
<fo:block/>
|
3451
3504
|
</fo:table-cell>
|
3452
3505
|
</fo:table-row>
|
@@ -3466,6 +3519,19 @@
|
|
3466
3519
|
|
3467
3520
|
</fo:table-body>
|
3468
3521
|
|
3522
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
|
3523
|
+
<xsl:choose>
|
3524
|
+
<xsl:when test="substring-after(., '—') != ''">
|
3525
|
+
<xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
|
3526
|
+
</xsl:when>
|
3527
|
+
<xsl:otherwise>
|
3528
|
+
<xsl:value-of select="."/>
|
3529
|
+
</xsl:otherwise>
|
3530
|
+
</xsl:choose>
|
3531
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
|
3532
|
+
<xsl:apply-templates mode="presentation_name"/>
|
3533
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
|
3534
|
+
<xsl:apply-templates select="."/>
|
3469
3535
|
</xsl:template><xsl:template match="*[local-name()='tr']">
|
3470
3536
|
<xsl:variable name="parent-name" select="local-name(..)"/>
|
3471
3537
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
@@ -3493,6 +3559,8 @@
|
|
3493
3559
|
|
3494
3560
|
|
3495
3561
|
|
3562
|
+
|
3563
|
+
|
3496
3564
|
</xsl:if>
|
3497
3565
|
<xsl:if test="$parent-name = 'tfoot'">
|
3498
3566
|
|
@@ -3511,6 +3579,8 @@
|
|
3511
3579
|
|
3512
3580
|
|
3513
3581
|
|
3582
|
+
|
3583
|
+
|
3514
3584
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
3515
3585
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
3516
3586
|
</xsl:if> -->
|
@@ -3664,14 +3734,12 @@
|
|
3664
3734
|
<xsl:apply-templates/>
|
3665
3735
|
</xsl:template><xsl:template name="fn_display">
|
3666
3736
|
<xsl:variable name="references">
|
3737
|
+
|
3667
3738
|
<xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
|
3668
|
-
<
|
3669
|
-
|
3670
|
-
|
3671
|
-
<xsl:apply-templates/>
|
3672
|
-
</fn>
|
3739
|
+
<xsl:call-template name="create_fn"/>
|
3673
3740
|
</xsl:for-each>
|
3674
3741
|
</xsl:variable>
|
3742
|
+
|
3675
3743
|
<xsl:for-each select="xalan:nodeset($references)//fn">
|
3676
3744
|
<xsl:variable name="reference" select="@reference"/>
|
3677
3745
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
@@ -3710,6 +3778,12 @@
|
|
3710
3778
|
</fo:block>
|
3711
3779
|
</xsl:if>
|
3712
3780
|
</xsl:for-each>
|
3781
|
+
</xsl:template><xsl:template name="create_fn">
|
3782
|
+
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
3783
|
+
|
3784
|
+
|
3785
|
+
<xsl:apply-templates/>
|
3786
|
+
</fn>
|
3713
3787
|
</xsl:template><xsl:template name="fn_name_display">
|
3714
3788
|
<!-- <xsl:variable name="references">
|
3715
3789
|
<xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
|
@@ -3838,7 +3912,7 @@
|
|
3838
3912
|
|
3839
3913
|
|
3840
3914
|
|
3841
|
-
<xsl:if test="ancestor::*[local-name()='
|
3915
|
+
<xsl:if test="ancestor::*[local-name()='table']">
|
3842
3916
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
3843
3917
|
<!-- <xsl:attribute name="alignment-baseline">hanging</xsl:attribute> -->
|
3844
3918
|
<xsl:attribute name="baseline-shift">15%</xsl:attribute>
|
@@ -4711,12 +4785,43 @@
|
|
4711
4785
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
4712
4786
|
</xsl:call-template>
|
4713
4787
|
|
4788
|
+
|
4789
|
+
|
4714
4790
|
<xsl:variable name="mathml">
|
4715
4791
|
<xsl:apply-templates select="." mode="mathml"/>
|
4716
4792
|
</xsl:variable>
|
4717
4793
|
<fo:instream-foreign-object fox:alt-text="Math">
|
4718
4794
|
|
4719
4795
|
|
4796
|
+
<xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
|
4797
|
+
<xsl:variable name="comment_text_">
|
4798
|
+
<xsl:choose>
|
4799
|
+
<xsl:when test="normalize-space($comment_text_following) != ''">
|
4800
|
+
<xsl:value-of select="$comment_text_following"/>
|
4801
|
+
</xsl:when>
|
4802
|
+
<xsl:otherwise>
|
4803
|
+
<xsl:value-of select="normalize-space(translate(.,' ',' '))"/>
|
4804
|
+
</xsl:otherwise>
|
4805
|
+
</xsl:choose>
|
4806
|
+
</xsl:variable>
|
4807
|
+
<xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
|
4808
|
+
|
4809
|
+
<xsl:if test="normalize-space($comment_text) != ''">
|
4810
|
+
<!-- put Mathin Alternate Text -->
|
4811
|
+
<xsl:attribute name="fox:alt-text">
|
4812
|
+
<xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
|
4813
|
+
</xsl:attribute>
|
4814
|
+
</xsl:if>
|
4815
|
+
|
4816
|
+
<xsl:variable name="mathml_content">
|
4817
|
+
<xsl:apply-templates select="." mode="mathml_actual_text"/>
|
4818
|
+
</xsl:variable>
|
4819
|
+
<!-- put MathML in Actual Text -->
|
4820
|
+
<xsl:attribute name="fox:actual-text">
|
4821
|
+
<xsl:value-of select="$mathml_content"/>
|
4822
|
+
</xsl:attribute>
|
4823
|
+
|
4824
|
+
|
4720
4825
|
<xsl:if test="count(ancestor::*[local-name() = 'table']) > 1">
|
4721
4826
|
<xsl:attribute name="width">95%</xsl:attribute>
|
4722
4827
|
<xsl:attribute name="content-height">100%</xsl:attribute>
|
@@ -4728,6 +4833,27 @@
|
|
4728
4833
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
4729
4834
|
</fo:instream-foreign-object>
|
4730
4835
|
</fo:inline>
|
4836
|
+
</xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
|
4837
|
+
<!-- <xsl:text>a+b</xsl:text> -->
|
4838
|
+
<xsl:text><</xsl:text>
|
4839
|
+
<xsl:value-of select="local-name()"/>
|
4840
|
+
<xsl:if test="local-name() = 'math'">
|
4841
|
+
<xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
|
4842
|
+
</xsl:if>
|
4843
|
+
<xsl:for-each select="@*">
|
4844
|
+
<xsl:text> </xsl:text>
|
4845
|
+
<xsl:value-of select="local-name()"/>
|
4846
|
+
<xsl:text>="</xsl:text>
|
4847
|
+
<xsl:value-of select="."/>
|
4848
|
+
<xsl:text>"</xsl:text>
|
4849
|
+
</xsl:for-each>
|
4850
|
+
<xsl:text>></xsl:text>
|
4851
|
+
<xsl:apply-templates mode="mathml_actual_text"/>
|
4852
|
+
<xsl:text></</xsl:text>
|
4853
|
+
<xsl:value-of select="local-name()"/>
|
4854
|
+
<xsl:text>></xsl:text>
|
4855
|
+
</xsl:template><xsl:template match="text()" mode="mathml_actual_text">
|
4856
|
+
<xsl:value-of select="normalize-space()"/>
|
4731
4857
|
</xsl:template><xsl:template match="@*|node()" mode="mathml">
|
4732
4858
|
<xsl:copy>
|
4733
4859
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
@@ -4737,19 +4863,6 @@
|
|
4737
4863
|
<!-- replace start and end spaces to non-break space -->
|
4738
4864
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
|
4739
4865
|
</xsl:copy>
|
4740
|
-
</xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
|
4741
|
-
<xsl:copy>
|
4742
|
-
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
4743
|
-
</xsl:copy>
|
4744
|
-
<xsl:choose>
|
4745
|
-
<!-- if in msub, then don't add space -->
|
4746
|
-
<xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
|
4747
|
-
<!-- if next char in digit, don't add space -->
|
4748
|
-
<xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
|
4749
|
-
<xsl:otherwise>
|
4750
|
-
<mathml:mspace width="0.5ex"/>
|
4751
|
-
</xsl:otherwise>
|
4752
|
-
</xsl:choose>
|
4753
4866
|
</xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
4754
4867
|
<xsl:variable name="target">
|
4755
4868
|
<xsl:choose>
|
@@ -4802,7 +4915,10 @@
|
|
4802
4915
|
</fo:block>
|
4803
4916
|
<xsl:apply-templates/>
|
4804
4917
|
</xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
|
4805
|
-
<
|
4918
|
+
<xsl:variable name="level">
|
4919
|
+
<xsl:call-template name="getLevel"/>
|
4920
|
+
</xsl:variable>
|
4921
|
+
<fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
|
4806
4922
|
</xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
|
4807
4923
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
|
4808
4924
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -4837,9 +4953,10 @@
|
|
4837
4953
|
|
4838
4954
|
</xsl:variable>
|
4839
4955
|
|
4956
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
4840
4957
|
<xsl:choose>
|
4841
|
-
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
|
4842
|
-
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
|
4958
|
+
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
|
4959
|
+
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
|
4843
4960
|
</xsl:choose>
|
4844
4961
|
<xsl:apply-templates/>
|
4845
4962
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
@@ -4985,7 +5102,10 @@
|
|
4985
5102
|
</fo:block>
|
4986
5103
|
</xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
|
4987
5104
|
<xsl:if test="normalize-space() != ''">
|
4988
|
-
<
|
5105
|
+
<xsl:variable name="level">
|
5106
|
+
<xsl:call-template name="getLevelTermName"/>
|
5107
|
+
</xsl:variable>
|
5108
|
+
<fo:inline role="H{$level}">
|
4989
5109
|
<xsl:apply-templates/>
|
4990
5110
|
<!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
|
4991
5111
|
<xsl:text>.</xsl:text>
|
@@ -5058,7 +5178,24 @@
|
|
5058
5178
|
</fo:instream-foreign-object>
|
5059
5179
|
</xsl:when>
|
5060
5180
|
<xsl:otherwise>
|
5061
|
-
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"
|
5181
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
5182
|
+
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
5183
|
+
|
5184
|
+
<xsl:variable name="img_src">
|
5185
|
+
<xsl:choose>
|
5186
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
5187
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
5188
|
+
</xsl:choose>
|
5189
|
+
</xsl:variable>
|
5190
|
+
|
5191
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
5192
|
+
<xsl:if test="number($scale) < 100">
|
5193
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
5194
|
+
</xsl:if>
|
5195
|
+
|
5196
|
+
</xsl:if>
|
5197
|
+
|
5198
|
+
</fo:external-graphic>
|
5062
5199
|
</xsl:otherwise>
|
5063
5200
|
</xsl:choose>
|
5064
5201
|
|
@@ -5229,11 +5366,13 @@
|
|
5229
5366
|
<xsl:attribute name="width">100%</xsl:attribute>
|
5230
5367
|
<xsl:attribute name="content-height">100%</xsl:attribute>
|
5231
5368
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5369
|
+
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
5370
|
+
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
5232
5371
|
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
5233
5372
|
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
5234
5373
|
<!-- effective height / width = 1.48, 1.4 - with title -->
|
5235
|
-
<xsl:if test="
|
5236
|
-
<xsl:variable name="width" select="((
|
5374
|
+
<xsl:if test="$svg_height > ($svg_width * 1.4)"> <!-- for images with big height -->
|
5375
|
+
<xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
|
5237
5376
|
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
5238
5377
|
</xsl:if>
|
5239
5378
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
@@ -5250,6 +5389,23 @@
|
|
5250
5389
|
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
5251
5390
|
<xsl:value-of select="."/>
|
5252
5391
|
</xsl:attribute>
|
5392
|
+
</xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
|
5393
|
+
<xsl:copy>
|
5394
|
+
<xsl:apply-templates select="@*" mode="svg_update"/>
|
5395
|
+
<xsl:variable name="viewbox">
|
5396
|
+
<xsl:call-template name="split">
|
5397
|
+
<xsl:with-param name="pText" select="@viewBox"/>
|
5398
|
+
<xsl:with-param name="sep" select="' '"/>
|
5399
|
+
</xsl:call-template>
|
5400
|
+
</xsl:variable>
|
5401
|
+
<xsl:attribute name="width">
|
5402
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
|
5403
|
+
</xsl:attribute>
|
5404
|
+
<xsl:attribute name="height">
|
5405
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
|
5406
|
+
</xsl:attribute>
|
5407
|
+
<xsl:apply-templates mode="svg_update"/>
|
5408
|
+
</xsl:copy>
|
5253
5409
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
5254
5410
|
<xsl:variable name="svg_content" select="document(@src)"/>
|
5255
5411
|
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
@@ -5580,6 +5736,7 @@
|
|
5580
5736
|
</xsl:when>
|
5581
5737
|
<xsl:otherwise>
|
5582
5738
|
<xsl:apply-templates/>
|
5739
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
5583
5740
|
</xsl:otherwise>
|
5584
5741
|
</xsl:choose>
|
5585
5742
|
</fo:block>
|
@@ -5720,14 +5877,6 @@
|
|
5720
5877
|
<fo:block>
|
5721
5878
|
<fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
|
5722
5879
|
</fo:block>
|
5723
|
-
</xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
|
5724
|
-
<fo:block xsl:use-attribute-sets="requirement-subject-style">
|
5725
|
-
<xsl:text>Target Type </xsl:text><xsl:apply-templates/>
|
5726
|
-
</fo:block>
|
5727
|
-
</xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
|
5728
|
-
<fo:block xsl:use-attribute-sets="requirement-inherit-style">
|
5729
|
-
<xsl:text>Dependency </xsl:text><xsl:apply-templates/>
|
5730
|
-
</fo:block>
|
5731
5880
|
</xsl:template><xsl:template match="*[local-name() = 'recommendation']">
|
5732
5881
|
<fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
|
5733
5882
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -5744,6 +5893,38 @@
|
|
5744
5893
|
<fo:block xsl:use-attribute-sets="recommendation-label-style">
|
5745
5894
|
<xsl:apply-templates/>
|
5746
5895
|
</fo:block>
|
5896
|
+
</xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
|
5897
|
+
<fo:block xsl:use-attribute-sets="subject-style">
|
5898
|
+
<xsl:text>Target Type </xsl:text><xsl:apply-templates/>
|
5899
|
+
</fo:block>
|
5900
|
+
</xsl:template><xsl:template match="*[local-name() = 'subject']">
|
5901
|
+
<fo:block xsl:use-attribute-sets="subject-style">
|
5902
|
+
<xsl:text>Target Type </xsl:text><xsl:apply-templates/>
|
5903
|
+
</fo:block>
|
5904
|
+
</xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
|
5905
|
+
<fo:block xsl:use-attribute-sets="inherit-style">
|
5906
|
+
<xsl:text>Dependency </xsl:text><xsl:apply-templates/>
|
5907
|
+
</fo:block>
|
5908
|
+
</xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
|
5909
|
+
<fo:block xsl:use-attribute-sets="description-style">
|
5910
|
+
<xsl:apply-templates/>
|
5911
|
+
</fo:block>
|
5912
|
+
</xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
|
5913
|
+
<fo:block xsl:use-attribute-sets="specification-style">
|
5914
|
+
<xsl:apply-templates/>
|
5915
|
+
</fo:block>
|
5916
|
+
</xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
|
5917
|
+
<fo:block xsl:use-attribute-sets="measurement-target-style">
|
5918
|
+
<xsl:apply-templates/>
|
5919
|
+
</fo:block>
|
5920
|
+
</xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
|
5921
|
+
<fo:block xsl:use-attribute-sets="verification-style">
|
5922
|
+
<xsl:apply-templates/>
|
5923
|
+
</fo:block>
|
5924
|
+
</xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
|
5925
|
+
<fo:block xsl:use-attribute-sets="import-style">
|
5926
|
+
<xsl:apply-templates/>
|
5927
|
+
</fo:block>
|
5747
5928
|
</xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
5748
5929
|
<fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
|
5749
5930
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
@@ -5895,7 +6076,19 @@
|
|
5895
6076
|
</fo:inline>
|
5896
6077
|
</xsl:if>
|
5897
6078
|
</xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
|
5898
|
-
<
|
6079
|
+
<xsl:variable name="element">inline
|
6080
|
+
|
6081
|
+
</xsl:variable>
|
6082
|
+
<xsl:choose>
|
6083
|
+
<xsl:when test="contains($element, 'block')">
|
6084
|
+
<fo:block xsl:use-attribute-sets="example-p-style">
|
6085
|
+
<xsl:apply-templates/>
|
6086
|
+
</fo:block>
|
6087
|
+
</xsl:when>
|
6088
|
+
<xsl:otherwise>
|
6089
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
6090
|
+
</xsl:otherwise>
|
6091
|
+
</xsl:choose>
|
5899
6092
|
</xsl:template><xsl:template match="*[local-name() = 'example']">
|
5900
6093
|
<fo:block id="{@id}" xsl:use-attribute-sets="example-style">
|
5901
6094
|
|
@@ -6442,6 +6635,7 @@
|
|
6442
6635
|
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
|
6443
6636
|
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
6444
6637
|
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
6638
|
+
|
6445
6639
|
<xsl:apply-templates/>
|
6446
6640
|
</fo:block>
|
6447
6641
|
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
@@ -6481,7 +6675,6 @@
|
|
6481
6675
|
</xsl:template><xsl:template name="processBibitem">
|
6482
6676
|
|
6483
6677
|
|
6484
|
-
<!-- end BIPM bibitem processing-->
|
6485
6678
|
|
6486
6679
|
|
6487
6680
|
|
@@ -6637,6 +6830,9 @@
|
|
6637
6830
|
<fo:block-container border="1pt solid black" width="50%">
|
6638
6831
|
<fo:block> </fo:block>
|
6639
6832
|
</fo:block-container>
|
6833
|
+
</xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
|
6834
|
+
<fo:inline padding-right="5mm"> </fo:inline>
|
6835
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
6640
6836
|
</xsl:template><xsl:template name="convertDate">
|
6641
6837
|
<xsl:param name="date"/>
|
6642
6838
|
<xsl:param name="format" select="'short'"/>
|
@@ -6875,6 +7071,26 @@
|
|
6875
7071
|
<xsl:value-of select="$level"/>
|
6876
7072
|
</xsl:otherwise>
|
6877
7073
|
</xsl:choose>
|
7074
|
+
</xsl:template><xsl:template name="getLevelTermName">
|
7075
|
+
<xsl:choose>
|
7076
|
+
<xsl:when test="normalize-space(../@depth) != ''">
|
7077
|
+
<xsl:value-of select="../@depth"/>
|
7078
|
+
</xsl:when>
|
7079
|
+
<xsl:otherwise>
|
7080
|
+
<xsl:variable name="title_level_">
|
7081
|
+
<xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
|
7082
|
+
<xsl:call-template name="getLevel"/>
|
7083
|
+
</xsl:for-each>
|
7084
|
+
</xsl:variable>
|
7085
|
+
<xsl:variable name="title_level" select="normalize-space($title_level_)"/>
|
7086
|
+
<xsl:choose>
|
7087
|
+
<xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
|
7088
|
+
<xsl:otherwise>
|
7089
|
+
<xsl:call-template name="getLevel"/>
|
7090
|
+
</xsl:otherwise>
|
7091
|
+
</xsl:choose>
|
7092
|
+
</xsl:otherwise>
|
7093
|
+
</xsl:choose>
|
6878
7094
|
</xsl:template><xsl:template name="split">
|
6879
7095
|
<xsl:param name="pText" select="."/>
|
6880
7096
|
<xsl:param name="sep" select="','"/>
|
@@ -6972,20 +7188,40 @@
|
|
6972
7188
|
</xsl:call-template>
|
6973
7189
|
</xsl:if>
|
6974
7190
|
</xsl:template><xsl:template name="getLocalizedString">
|
6975
|
-
<xsl:param name="key"/>
|
7191
|
+
<xsl:param name="key"/>
|
7192
|
+
<xsl:param name="formatted">false</xsl:param>
|
6976
7193
|
|
6977
7194
|
<xsl:variable name="curr_lang">
|
6978
7195
|
<xsl:call-template name="getLang"/>
|
6979
7196
|
</xsl:variable>
|
6980
7197
|
|
6981
|
-
<xsl:variable name="data_value"
|
7198
|
+
<xsl:variable name="data_value">
|
7199
|
+
<xsl:choose>
|
7200
|
+
<xsl:when test="$formatted = 'true'">
|
7201
|
+
<xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
7202
|
+
</xsl:when>
|
7203
|
+
<xsl:otherwise>
|
7204
|
+
<xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
7205
|
+
</xsl:otherwise>
|
7206
|
+
</xsl:choose>
|
7207
|
+
</xsl:variable>
|
6982
7208
|
|
6983
7209
|
<xsl:choose>
|
6984
|
-
<xsl:when test="$data_value != ''">
|
6985
|
-
<xsl:
|
7210
|
+
<xsl:when test="normalize-space($data_value) != ''">
|
7211
|
+
<xsl:choose>
|
7212
|
+
<xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
|
7213
|
+
<xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
|
7214
|
+
</xsl:choose>
|
6986
7215
|
</xsl:when>
|
6987
7216
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
6988
|
-
<xsl:
|
7217
|
+
<xsl:choose>
|
7218
|
+
<xsl:when test="$formatted = 'true'">
|
7219
|
+
<xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
7220
|
+
</xsl:when>
|
7221
|
+
<xsl:otherwise>
|
7222
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
7223
|
+
</xsl:otherwise>
|
7224
|
+
</xsl:choose>
|
6989
7225
|
</xsl:when>
|
6990
7226
|
<xsl:otherwise>
|
6991
7227
|
<xsl:variable name="key_">
|
@@ -6996,7 +7232,7 @@
|
|
6996
7232
|
<xsl:value-of select="$key_"/>
|
6997
7233
|
</xsl:otherwise>
|
6998
7234
|
</xsl:choose>
|
6999
|
-
|
7235
|
+
|
7000
7236
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
7001
7237
|
<xsl:param name="isAdded"/>
|
7002
7238
|
<xsl:param name="isDeleted"/>
|