metanorma-csa 1.8.1 → 1.8.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +12 -11
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/lib/asciidoctor/csa/biblio.rng +1 -0
- data/lib/asciidoctor/csa/csa.rng +3 -0
- data/lib/asciidoctor/csa/isodoc.rng +209 -4
- data/lib/isodoc/csa/csa.standard.xsl +559 -78
- data/lib/metanorma/csa/version.rb +1 -1
- data/metanorma-csa.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a2e03feb739aabfc961bd51cc96d8a53e8674f3eb38bbac70454589af496b1d
|
4
|
+
data.tar.gz: 2c45447a23dabcdc9d576f639b9cdd33917ff50735a9ece2fe1e05fb3fb21d7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd7fd0308056d12550c14d34d26d0c8edf28ba858a01c68bb3309cf3f0c4ea3783f209b99c4febf06b2273671bc6cbbf62588829fc5e1d15f611f7567cbfd933
|
7
|
+
data.tar.gz: f7d7afb0d291654e4d175199741f74477c2ed6ab0a9dc3f56907699562a48e1b0bb2e7b44f231430d098ff109c4f7844fdb51ec6afc3b6201e33bcbf07480b52
|
data/.github/workflows/rake.yml
CHANGED
@@ -16,19 +16,9 @@ jobs:
|
|
16
16
|
strategy:
|
17
17
|
fail-fast: false
|
18
18
|
matrix:
|
19
|
-
ruby: [ '
|
19
|
+
ruby: [ '3.0', '2.7', '2.6', '2.5' ]
|
20
20
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
21
21
|
experimental: [ false ]
|
22
|
-
include:
|
23
|
-
- ruby: '3.0'
|
24
|
-
os: 'ubuntu-latest'
|
25
|
-
experimental: true
|
26
|
-
- ruby: '3.0'
|
27
|
-
os: 'windows-latest'
|
28
|
-
experimental: true
|
29
|
-
- ruby: '3.0'
|
30
|
-
os: 'macos-latest'
|
31
|
-
experimental: true
|
32
22
|
steps:
|
33
23
|
- uses: actions/checkout@v2
|
34
24
|
with:
|
@@ -40,3 +30,14 @@ jobs:
|
|
40
30
|
bundler-cache: true
|
41
31
|
|
42
32
|
- run: bundle exec rake
|
33
|
+
|
34
|
+
tests-passed:
|
35
|
+
needs: rake
|
36
|
+
runs-on: ubuntu-latest
|
37
|
+
steps:
|
38
|
+
- uses: peter-evans/repository-dispatch@v1
|
39
|
+
with:
|
40
|
+
token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
|
41
|
+
repository: ${{ github.repository }}
|
42
|
+
event-type: tests-passed
|
43
|
+
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
|
data/.hound.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,14 +1,10 @@
|
|
1
|
-
#
|
2
|
-
# https://github.com/
|
3
|
-
# All project-specific additions and overrides should be specified in this file.
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
4
3
|
inherit_from:
|
5
4
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
6
5
|
|
7
6
|
# local repo-specific modifications
|
7
|
+
# ...
|
8
8
|
|
9
9
|
AllCops:
|
10
|
-
|
11
|
-
StyleGuideCopsOnly: false
|
12
|
-
TargetRubyVersion: 2.4
|
13
|
-
Rails:
|
14
|
-
Enabled: true
|
10
|
+
TargetRubyVersion: 2.5
|
data/lib/asciidoctor/csa/csa.rng
CHANGED
@@ -45,6 +45,11 @@
|
|
45
45
|
<optional>
|
46
46
|
<attribute name="alt"/>
|
47
47
|
</optional>
|
48
|
+
<optional>
|
49
|
+
<attribute name="updatetype">
|
50
|
+
<data type="boolean"/>
|
51
|
+
</attribute>
|
52
|
+
</optional>
|
48
53
|
<text/>
|
49
54
|
</element>
|
50
55
|
</define>
|
@@ -543,6 +548,9 @@
|
|
543
548
|
</define>
|
544
549
|
<define name="BibDataExtensionType">
|
545
550
|
<ref name="doctype"/>
|
551
|
+
<optional>
|
552
|
+
<ref name="docsubtype"/>
|
553
|
+
</optional>
|
546
554
|
<optional>
|
547
555
|
<ref name="editorialgroup"/>
|
548
556
|
</optional>
|
@@ -876,8 +884,28 @@
|
|
876
884
|
</zeroOrMore>
|
877
885
|
</element>
|
878
886
|
</define>
|
887
|
+
<define name="pagebreak">
|
888
|
+
<element name="pagebreak">
|
889
|
+
<optional>
|
890
|
+
<attribute name="orientation">
|
891
|
+
<choice>
|
892
|
+
<value>landscape</value>
|
893
|
+
<value>portrait</value>
|
894
|
+
</choice>
|
895
|
+
</attribute>
|
896
|
+
</optional>
|
897
|
+
</element>
|
898
|
+
</define>
|
879
899
|
</include>
|
880
900
|
<!-- end overrides -->
|
901
|
+
<define name="docsubtype">
|
902
|
+
<element name="docsubtype">
|
903
|
+
<ref name="DocumentSubtype"/>
|
904
|
+
</element>
|
905
|
+
</define>
|
906
|
+
<define name="DocumentSubtype">
|
907
|
+
<text/>
|
908
|
+
</define>
|
881
909
|
<define name="colgroup">
|
882
910
|
<element name="colgroup">
|
883
911
|
<oneOrMore>
|
@@ -927,7 +955,24 @@
|
|
927
955
|
<define name="concept">
|
928
956
|
<element name="concept">
|
929
957
|
<optional>
|
930
|
-
<
|
958
|
+
<element name="refterm">
|
959
|
+
<zeroOrMore>
|
960
|
+
<choice>
|
961
|
+
<ref name="PureTextElement"/>
|
962
|
+
<ref name="stem"/>
|
963
|
+
</choice>
|
964
|
+
</zeroOrMore>
|
965
|
+
</element>
|
966
|
+
</optional>
|
967
|
+
<optional>
|
968
|
+
<element name="renderterm">
|
969
|
+
<zeroOrMore>
|
970
|
+
<choice>
|
971
|
+
<ref name="PureTextElement"/>
|
972
|
+
<ref name="stem"/>
|
973
|
+
</choice>
|
974
|
+
</zeroOrMore>
|
975
|
+
</element>
|
931
976
|
</optional>
|
932
977
|
<choice>
|
933
978
|
<ref name="eref"/>
|
@@ -943,8 +988,170 @@
|
|
943
988
|
<ref name="permission"/>
|
944
989
|
<ref name="imagemap"/>
|
945
990
|
<ref name="svgmap"/>
|
991
|
+
<ref name="inputform"/>
|
992
|
+
</choice>
|
993
|
+
</define>
|
994
|
+
<define name="inputform">
|
995
|
+
<element name="form">
|
996
|
+
<attribute name="id">
|
997
|
+
<data type="ID"/>
|
998
|
+
</attribute>
|
999
|
+
<attribute name="name"/>
|
1000
|
+
<attribute name="action"/>
|
1001
|
+
<zeroOrMore>
|
1002
|
+
<choice>
|
1003
|
+
<ref name="TextElement"/>
|
1004
|
+
<ref name="FormInput"/>
|
1005
|
+
</choice>
|
1006
|
+
</zeroOrMore>
|
1007
|
+
</element>
|
1008
|
+
</define>
|
1009
|
+
<define name="FormInput">
|
1010
|
+
<choice>
|
1011
|
+
<ref name="input"/>
|
1012
|
+
<ref name="formlabel"/>
|
1013
|
+
<ref name="select"/>
|
1014
|
+
<ref name="textarea"/>
|
946
1015
|
</choice>
|
947
1016
|
</define>
|
1017
|
+
<define name="InputType">
|
1018
|
+
<choice>
|
1019
|
+
<value>button</value>
|
1020
|
+
<value>checkbox</value>
|
1021
|
+
<value>date</value>
|
1022
|
+
<value>file</value>
|
1023
|
+
<value>password</value>
|
1024
|
+
<value>radio</value>
|
1025
|
+
<value>submit</value>
|
1026
|
+
<value>text</value>
|
1027
|
+
</choice>
|
1028
|
+
</define>
|
1029
|
+
<define name="input">
|
1030
|
+
<element name="input">
|
1031
|
+
<attribute name="type">
|
1032
|
+
<ref name="InputType"/>
|
1033
|
+
</attribute>
|
1034
|
+
<optional>
|
1035
|
+
<attribute name="checked">
|
1036
|
+
<data type="boolean"/>
|
1037
|
+
</attribute>
|
1038
|
+
</optional>
|
1039
|
+
<optional>
|
1040
|
+
<attribute name="disabled">
|
1041
|
+
<data type="boolean"/>
|
1042
|
+
</attribute>
|
1043
|
+
</optional>
|
1044
|
+
<optional>
|
1045
|
+
<attribute name="readonly">
|
1046
|
+
<data type="boolean"/>
|
1047
|
+
</attribute>
|
1048
|
+
</optional>
|
1049
|
+
<optional>
|
1050
|
+
<attribute name="maxlength">
|
1051
|
+
<data type="int"/>
|
1052
|
+
</attribute>
|
1053
|
+
</optional>
|
1054
|
+
<optional>
|
1055
|
+
<attribute name="minlength">
|
1056
|
+
<data type="int"/>
|
1057
|
+
</attribute>
|
1058
|
+
</optional>
|
1059
|
+
<optional>
|
1060
|
+
<attribute name="name"/>
|
1061
|
+
</optional>
|
1062
|
+
<optional>
|
1063
|
+
<attribute name="value"/>
|
1064
|
+
</optional>
|
1065
|
+
<optional>
|
1066
|
+
<attribute name="id">
|
1067
|
+
<data type="ID"/>
|
1068
|
+
</attribute>
|
1069
|
+
</optional>
|
1070
|
+
</element>
|
1071
|
+
</define>
|
1072
|
+
<define name="formlabel">
|
1073
|
+
<element name="label">
|
1074
|
+
<attribute name="for">
|
1075
|
+
<data type="IDREF"/>
|
1076
|
+
</attribute>
|
1077
|
+
<zeroOrMore>
|
1078
|
+
<ref name="PureTextElement"/>
|
1079
|
+
</zeroOrMore>
|
1080
|
+
</element>
|
1081
|
+
</define>
|
1082
|
+
<define name="select">
|
1083
|
+
<element name="select">
|
1084
|
+
<optional>
|
1085
|
+
<attribute name="name"/>
|
1086
|
+
</optional>
|
1087
|
+
<optional>
|
1088
|
+
<attribute name="value"/>
|
1089
|
+
</optional>
|
1090
|
+
<optional>
|
1091
|
+
<attribute name="id">
|
1092
|
+
<data type="ID"/>
|
1093
|
+
</attribute>
|
1094
|
+
</optional>
|
1095
|
+
<optional>
|
1096
|
+
<attribute name="disabled">
|
1097
|
+
<data type="boolean"/>
|
1098
|
+
</attribute>
|
1099
|
+
</optional>
|
1100
|
+
<optional>
|
1101
|
+
<attribute name="multiple">
|
1102
|
+
<data type="boolean"/>
|
1103
|
+
</attribute>
|
1104
|
+
</optional>
|
1105
|
+
<optional>
|
1106
|
+
<attribute name="size">
|
1107
|
+
<data type="int"/>
|
1108
|
+
</attribute>
|
1109
|
+
</optional>
|
1110
|
+
<oneOrMore>
|
1111
|
+
<ref name="option"/>
|
1112
|
+
</oneOrMore>
|
1113
|
+
</element>
|
1114
|
+
</define>
|
1115
|
+
<define name="option">
|
1116
|
+
<element name="option">
|
1117
|
+
<optional>
|
1118
|
+
<attribute name="disabled">
|
1119
|
+
<data type="boolean"/>
|
1120
|
+
</attribute>
|
1121
|
+
</optional>
|
1122
|
+
<optional>
|
1123
|
+
<attribute name="value"/>
|
1124
|
+
</optional>
|
1125
|
+
<zeroOrMore>
|
1126
|
+
<ref name="PureTextElement"/>
|
1127
|
+
</zeroOrMore>
|
1128
|
+
</element>
|
1129
|
+
</define>
|
1130
|
+
<define name="textarea">
|
1131
|
+
<element name="textarea">
|
1132
|
+
<optional>
|
1133
|
+
<attribute name="name"/>
|
1134
|
+
</optional>
|
1135
|
+
<optional>
|
1136
|
+
<attribute name="value"/>
|
1137
|
+
</optional>
|
1138
|
+
<optional>
|
1139
|
+
<attribute name="id">
|
1140
|
+
<data type="ID"/>
|
1141
|
+
</attribute>
|
1142
|
+
</optional>
|
1143
|
+
<optional>
|
1144
|
+
<attribute name="rows">
|
1145
|
+
<data type="int"/>
|
1146
|
+
</attribute>
|
1147
|
+
</optional>
|
1148
|
+
<optional>
|
1149
|
+
<attribute name="cols">
|
1150
|
+
<data type="int"/>
|
1151
|
+
</attribute>
|
1152
|
+
</optional>
|
1153
|
+
</element>
|
1154
|
+
</define>
|
948
1155
|
<define name="bibliography">
|
949
1156
|
<element name="bibliography">
|
950
1157
|
<oneOrMore>
|
@@ -1017,9 +1224,7 @@
|
|
1017
1224
|
</define>
|
1018
1225
|
<define name="IsoWorkgroup">
|
1019
1226
|
<optional>
|
1020
|
-
<attribute name="number"
|
1021
|
-
<data type="int"/>
|
1022
|
-
</attribute>
|
1227
|
+
<attribute name="number"/>
|
1023
1228
|
</optional>
|
1024
1229
|
<optional>
|
1025
1230
|
<attribute name="type"/>
|
@@ -7,8 +7,13 @@
|
|
7
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
8
8
|
<xsl:param name="basepath"/>
|
9
9
|
|
10
|
-
<xsl:variable name="pageWidth" select="
|
11
|
-
<xsl:variable name="pageHeight" select="
|
10
|
+
<xsl:variable name="pageWidth" select="215.9"/>
|
11
|
+
<xsl:variable name="pageHeight" select="279.4"/>
|
12
|
+
<xsl:variable name="marginLeftRight1" select="25"/>
|
13
|
+
<xsl:variable name="marginLeftRight2" select="25"/>
|
14
|
+
<xsl:variable name="marginTop" select="25"/>
|
15
|
+
<xsl:variable name="marginBottom" select="21"/>
|
16
|
+
|
12
17
|
|
13
18
|
|
14
19
|
|
@@ -38,18 +43,18 @@
|
|
38
43
|
<fo:root font-family="Azo Sans, STIX Two Math" font-size="10pt" xml:lang="{$lang}">
|
39
44
|
<fo:layout-master-set>
|
40
45
|
<!-- Cover page -->
|
41
|
-
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
46
|
+
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
42
47
|
<fo:region-body margin-top="21mm" margin-bottom="21mm" margin-left="25mm" margin-right="25mm"/>
|
43
48
|
<fo:region-before region-name="cover-page-header" extent="21mm" precedence="true"/>
|
44
49
|
<fo:region-after region-name="footer" extent="21mm"/>
|
45
50
|
</fo:simple-page-master>
|
46
51
|
|
47
|
-
<fo:simple-page-master master-name="document" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
48
|
-
<fo:region-body margin-top="
|
49
|
-
<fo:region-before region-name="header" extent="
|
50
|
-
<fo:region-after region-name="footer" extent="
|
51
|
-
<fo:region-start region-name="left-region" extent="
|
52
|
-
<fo:region-end region-name="right-region" extent="
|
52
|
+
<fo:simple-page-master master-name="document" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
53
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
54
|
+
<fo:region-before region-name="header" extent="{$marginTop}mm" precedence="true"/>
|
55
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
|
56
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
|
57
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
53
58
|
</fo:simple-page-master>
|
54
59
|
|
55
60
|
</fo:layout-master-set>
|
@@ -558,10 +563,11 @@
|
|
558
563
|
<xsl:if test="position() = last()">: </xsl:if>
|
559
564
|
</xsl:for-each>
|
560
565
|
<!-- csa:docidentifier -->
|
561
|
-
<xsl:if test="csa:docidentifier">
|
566
|
+
<!-- <xsl:if test="csa:docidentifier">
|
562
567
|
<xsl:value-of select="csa:docidentifier/@type"/><xsl:text> </xsl:text>
|
563
568
|
<xsl:value-of select="csa:docidentifier"/>
|
564
|
-
</xsl:if>
|
569
|
+
</xsl:if> -->
|
570
|
+
<xsl:value-of select="csa:docidentifier"/>
|
565
571
|
<xsl:apply-templates select="csa:note"/>
|
566
572
|
<xsl:if test="csa:docidentifier">, </xsl:if>
|
567
573
|
<fo:inline font-style="italic">
|
@@ -763,7 +769,7 @@
|
|
763
769
|
<xsl:when test="csa:docidentifier/@type = 'ISO' and csa:formattedref"/>
|
764
770
|
<xsl:when test="csa:docidentifier/@type = 'OGC' and csa:formattedref"/>
|
765
771
|
<xsl:otherwise><fo:inline>
|
766
|
-
<xsl:if test="csa:docidentifier/@type = 'OGC'">OGC </xsl:if>
|
772
|
+
<!-- <xsl:if test="csa:docidentifier/@type = 'OGC'">OGC </xsl:if> -->
|
767
773
|
<xsl:value-of select="csa:docidentifier"/><xsl:apply-templates select="csa:note"/>, </fo:inline></xsl:otherwise>
|
768
774
|
</xsl:choose>
|
769
775
|
</xsl:if>
|
@@ -1007,6 +1013,9 @@
|
|
1007
1013
|
<title-continued lang="en">(continued)</title-continued>
|
1008
1014
|
<title-continued lang="fr">(continué)</title-continued>
|
1009
1015
|
|
1016
|
+
</xsl:variable><xsl:variable name="bibdata">
|
1017
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
|
1018
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
|
1010
1019
|
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
|
1011
1020
|
<xsl:param name="name"/>
|
1012
1021
|
<xsl:param name="lang"/>
|
@@ -1037,6 +1046,8 @@
|
|
1037
1046
|
|
1038
1047
|
|
1039
1048
|
|
1049
|
+
|
1050
|
+
|
1040
1051
|
<xsl:attribute name="color">rgb(33, 94, 159)</xsl:attribute>
|
1041
1052
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1042
1053
|
|
@@ -1089,7 +1100,7 @@
|
|
1089
1100
|
|
1090
1101
|
|
1091
1102
|
|
1092
|
-
|
1103
|
+
|
1093
1104
|
</xsl:attribute-set><xsl:attribute-set name="example-style">
|
1094
1105
|
|
1095
1106
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
@@ -1104,6 +1115,7 @@
|
|
1104
1115
|
|
1105
1116
|
|
1106
1117
|
|
1118
|
+
|
1107
1119
|
</xsl:attribute-set><xsl:attribute-set name="example-body-style">
|
1108
1120
|
|
1109
1121
|
<xsl:attribute name="margin-left">12.5mm</xsl:attribute>
|
@@ -1128,9 +1140,7 @@
|
|
1128
1140
|
|
1129
1141
|
|
1130
1142
|
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1143
|
+
|
1134
1144
|
|
1135
1145
|
|
1136
1146
|
|
@@ -1159,8 +1169,10 @@
|
|
1159
1169
|
|
1160
1170
|
|
1161
1171
|
|
1172
|
+
|
1162
1173
|
</xsl:attribute-set><xsl:attribute-set name="table-name-style">
|
1163
1174
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1175
|
+
|
1164
1176
|
|
1165
1177
|
|
1166
1178
|
|
@@ -1173,6 +1185,9 @@
|
|
1173
1185
|
|
1174
1186
|
|
1175
1187
|
|
1188
|
+
|
1189
|
+
</xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
|
1190
|
+
|
1176
1191
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
1177
1192
|
|
1178
1193
|
|
@@ -1183,20 +1198,25 @@
|
|
1183
1198
|
|
1184
1199
|
</xsl:attribute-set><xsl:attribute-set name="xref-style">
|
1185
1200
|
|
1201
|
+
|
1186
1202
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1187
1203
|
|
1188
1204
|
|
1189
1205
|
|
1206
|
+
|
1190
1207
|
</xsl:attribute-set><xsl:attribute-set name="eref-style">
|
1191
1208
|
|
1209
|
+
|
1192
1210
|
<xsl:attribute name="color">rgb(33, 94, 159)</xsl:attribute>
|
1193
1211
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1194
1212
|
|
1195
1213
|
|
1196
1214
|
|
1197
1215
|
|
1216
|
+
|
1198
1217
|
</xsl:attribute-set><xsl:attribute-set name="note-style">
|
1199
1218
|
|
1219
|
+
|
1200
1220
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
1201
1221
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
1202
1222
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
@@ -1215,8 +1235,10 @@
|
|
1215
1235
|
|
1216
1236
|
|
1217
1237
|
|
1238
|
+
|
1218
1239
|
</xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
|
1219
1240
|
|
1241
|
+
|
1220
1242
|
<xsl:attribute name="padding-right">4mm</xsl:attribute>
|
1221
1243
|
|
1222
1244
|
|
@@ -1249,6 +1271,7 @@
|
|
1249
1271
|
|
1250
1272
|
</xsl:attribute-set><xsl:attribute-set name="termnote-style">
|
1251
1273
|
|
1274
|
+
|
1252
1275
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
1253
1276
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1254
1277
|
|
@@ -1256,9 +1279,12 @@
|
|
1256
1279
|
|
1257
1280
|
|
1258
1281
|
|
1282
|
+
|
1259
1283
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1284
|
+
|
1260
1285
|
|
1261
1286
|
|
1287
|
+
|
1262
1288
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
1263
1289
|
|
1264
1290
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
@@ -1280,6 +1306,7 @@
|
|
1280
1306
|
|
1281
1307
|
</xsl:attribute-set><xsl:attribute-set name="termsource-style">
|
1282
1308
|
|
1309
|
+
|
1283
1310
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1284
1311
|
<xsl:attribute name="keep-with-previous">always</xsl:attribute>
|
1285
1312
|
|
@@ -1287,6 +1314,7 @@
|
|
1287
1314
|
|
1288
1315
|
|
1289
1316
|
|
1317
|
+
|
1290
1318
|
</xsl:attribute-set><xsl:attribute-set name="origin-style">
|
1291
1319
|
|
1292
1320
|
<xsl:attribute name="color">rgb(33, 94, 159)</xsl:attribute>
|
@@ -1294,11 +1322,13 @@
|
|
1294
1322
|
|
1295
1323
|
|
1296
1324
|
|
1325
|
+
|
1297
1326
|
</xsl:attribute-set><xsl:attribute-set name="term-style">
|
1298
1327
|
|
1299
1328
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
1300
1329
|
|
1301
1330
|
|
1331
|
+
|
1302
1332
|
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
1303
1333
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
1304
1334
|
<xsl:attribute name="text-align">center</xsl:attribute>
|
@@ -1318,6 +1348,7 @@
|
|
1318
1348
|
|
1319
1349
|
|
1320
1350
|
|
1351
|
+
|
1321
1352
|
|
1322
1353
|
|
1323
1354
|
|
@@ -1331,10 +1362,12 @@
|
|
1331
1362
|
|
1332
1363
|
|
1333
1364
|
|
1365
|
+
|
1334
1366
|
</xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
|
1335
1367
|
|
1336
1368
|
</xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
|
1337
1369
|
|
1370
|
+
|
1338
1371
|
<xsl:attribute name="width">100%</xsl:attribute>
|
1339
1372
|
<xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
|
1340
1373
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
@@ -1361,13 +1394,16 @@
|
|
1361
1394
|
</xsl:attribute-set><xsl:attribute-set name="admitted-style">
|
1362
1395
|
|
1363
1396
|
|
1397
|
+
|
1364
1398
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
1365
1399
|
|
1400
|
+
|
1366
1401
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
1367
1402
|
|
1368
1403
|
<xsl:attribute name="space-after">6pt</xsl:attribute>
|
1369
1404
|
|
1370
1405
|
|
1406
|
+
|
1371
1407
|
</xsl:attribute-set><xsl:variable name="color-added-text">
|
1372
1408
|
<xsl:text>rgb(0, 255, 0)</xsl:text>
|
1373
1409
|
</xsl:variable><xsl:attribute-set name="add-style">
|
@@ -1386,6 +1422,8 @@
|
|
1386
1422
|
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
1387
1423
|
|
1388
1424
|
|
1425
|
+
</xsl:attribute-set><xsl:attribute-set name="list-style">
|
1426
|
+
|
1389
1427
|
</xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
|
1390
1428
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1391
1429
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1396,14 +1434,15 @@
|
|
1396
1434
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
1397
1435
|
|
1398
1436
|
<!-- Normative references -->
|
1399
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
1437
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
|
1400
1438
|
<!-- Terms and definitions -->
|
1401
1439
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
|
1402
1440
|
<!-- Another main sections -->
|
1403
1441
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
|
1404
1442
|
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
1405
1443
|
<!-- Bibliography -->
|
1406
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
1444
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
|
1445
|
+
|
1407
1446
|
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
1408
1447
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
1409
1448
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
@@ -1439,11 +1478,11 @@
|
|
1439
1478
|
<xsl:variable name="table">
|
1440
1479
|
|
1441
1480
|
<xsl:variable name="simple-table">
|
1442
|
-
<xsl:call-template name="getSimpleTable"/>
|
1481
|
+
<xsl:call-template name="getSimpleTable"/>
|
1443
1482
|
</xsl:variable>
|
1444
1483
|
|
1445
1484
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
1446
|
-
<fo:block> </fo:block>
|
1485
|
+
<fo:block> </fo:block>
|
1447
1486
|
</xsl:if> -->
|
1448
1487
|
|
1449
1488
|
<!-- $namespace = 'iso' or -->
|
@@ -1504,6 +1543,7 @@
|
|
1504
1543
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1505
1544
|
|
1506
1545
|
|
1546
|
+
|
1507
1547
|
|
1508
1548
|
|
1509
1549
|
|
@@ -1516,6 +1556,8 @@
|
|
1516
1556
|
|
1517
1557
|
|
1518
1558
|
|
1559
|
+
|
1560
|
+
|
1519
1561
|
<xsl:variable name="table_width">
|
1520
1562
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
1521
1563
|
100%
|
@@ -1533,12 +1575,14 @@
|
|
1533
1575
|
|
1534
1576
|
|
1535
1577
|
|
1578
|
+
|
1536
1579
|
|
1537
1580
|
|
1538
1581
|
|
1539
1582
|
|
1540
1583
|
|
1541
1584
|
|
1585
|
+
|
1542
1586
|
</xsl:variable>
|
1543
1587
|
|
1544
1588
|
|
@@ -1675,11 +1719,25 @@
|
|
1675
1719
|
</xsl:choose>
|
1676
1720
|
|
1677
1721
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
|
1722
|
+
<xsl:param name="continued"/>
|
1678
1723
|
<xsl:if test="normalize-space() != ''">
|
1679
1724
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
1680
1725
|
|
1681
1726
|
|
1682
|
-
|
1727
|
+
|
1728
|
+
|
1729
|
+
|
1730
|
+
<xsl:choose>
|
1731
|
+
<xsl:when test="$continued = 'true'">
|
1732
|
+
<!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
|
1733
|
+
|
1734
|
+
</xsl:when>
|
1735
|
+
<xsl:otherwise>
|
1736
|
+
<xsl:apply-templates/>
|
1737
|
+
</xsl:otherwise>
|
1738
|
+
</xsl:choose>
|
1739
|
+
|
1740
|
+
|
1683
1741
|
</fo:block>
|
1684
1742
|
</xsl:if>
|
1685
1743
|
</xsl:template><xsl:template name="calculate-columns-numbers">
|
@@ -1816,21 +1874,22 @@
|
|
1816
1874
|
<!-- font-weight="bold" -->
|
1817
1875
|
<fo:table-header>
|
1818
1876
|
|
1877
|
+
|
1819
1878
|
<xsl:apply-templates/>
|
1820
1879
|
</fo:table-header>
|
1821
1880
|
</xsl:template><xsl:template name="table-header-title">
|
1822
|
-
<xsl:param name="cols-count"/>
|
1881
|
+
<xsl:param name="cols-count"/>
|
1823
1882
|
<!-- row for title -->
|
1824
1883
|
<fo:table-row>
|
1825
1884
|
<fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
|
1826
|
-
|
1885
|
+
|
1886
|
+
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
|
1887
|
+
<xsl:with-param name="continued">true</xsl:with-param>
|
1888
|
+
</xsl:apply-templates>
|
1827
1889
|
<xsl:for-each select="ancestor::*[local-name()='table'][1]">
|
1828
1890
|
<xsl:call-template name="fn_name_display"/>
|
1829
|
-
</xsl:for-each>
|
1830
|
-
|
1831
|
-
<xsl:text> </xsl:text>
|
1832
|
-
<fo:retrieve-table-marker retrieve-class-name="table_continued"/>
|
1833
|
-
</fo:block>
|
1891
|
+
</xsl:for-each>
|
1892
|
+
|
1834
1893
|
</fo:table-cell>
|
1835
1894
|
</fo:table-row>
|
1836
1895
|
</xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
|
@@ -2051,6 +2110,7 @@
|
|
2051
2110
|
|
2052
2111
|
|
2053
2112
|
|
2113
|
+
|
2054
2114
|
</xsl:if>
|
2055
2115
|
<xsl:if test="$parent-name = 'tfoot'">
|
2056
2116
|
|
@@ -2060,6 +2120,10 @@
|
|
2060
2120
|
|
2061
2121
|
|
2062
2122
|
|
2123
|
+
|
2124
|
+
|
2125
|
+
|
2126
|
+
|
2063
2127
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
2064
2128
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
2065
2129
|
</xsl:if> -->
|
@@ -2088,6 +2152,8 @@
|
|
2088
2152
|
|
2089
2153
|
|
2090
2154
|
|
2155
|
+
|
2156
|
+
|
2091
2157
|
<xsl:if test="$lang = 'ar'">
|
2092
2158
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2093
2159
|
</xsl:if>
|
@@ -2142,6 +2208,11 @@
|
|
2142
2208
|
|
2143
2209
|
|
2144
2210
|
|
2211
|
+
|
2212
|
+
|
2213
|
+
|
2214
|
+
|
2215
|
+
|
2145
2216
|
<xsl:if test=".//*[local-name() = 'table']">
|
2146
2217
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2147
2218
|
</xsl:if>
|
@@ -2171,6 +2242,7 @@
|
|
2171
2242
|
|
2172
2243
|
|
2173
2244
|
|
2245
|
+
|
2174
2246
|
<fo:inline padding-right="2mm">
|
2175
2247
|
|
2176
2248
|
|
@@ -2212,6 +2284,7 @@
|
|
2212
2284
|
|
2213
2285
|
|
2214
2286
|
|
2287
|
+
|
2215
2288
|
<xsl:value-of select="@reference"/>
|
2216
2289
|
|
2217
2290
|
|
@@ -2355,6 +2428,10 @@
|
|
2355
2428
|
|
2356
2429
|
|
2357
2430
|
|
2431
|
+
|
2432
|
+
|
2433
|
+
|
2434
|
+
|
2358
2435
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
2359
2436
|
|
2360
2437
|
|
@@ -2446,6 +2523,7 @@
|
|
2446
2523
|
|
2447
2524
|
|
2448
2525
|
|
2526
|
+
|
2449
2527
|
<xsl:variable name="title-key">
|
2450
2528
|
|
2451
2529
|
|
@@ -2656,6 +2734,7 @@
|
|
2656
2734
|
|
2657
2735
|
<fo:table-row>
|
2658
2736
|
|
2737
|
+
|
2659
2738
|
<fo:table-cell>
|
2660
2739
|
|
2661
2740
|
<fo:block margin-top="6pt">
|
@@ -2671,6 +2750,7 @@
|
|
2671
2750
|
|
2672
2751
|
|
2673
2752
|
|
2753
|
+
|
2674
2754
|
<xsl:apply-templates/>
|
2675
2755
|
<!-- <xsl:if test="$namespace = 'gb'">
|
2676
2756
|
<xsl:if test="ancestor::*[local-name()='formula']">
|
@@ -2727,6 +2807,8 @@
|
|
2727
2807
|
|
2728
2808
|
<xsl:apply-templates/>
|
2729
2809
|
</fo:inline>
|
2810
|
+
</xsl:template><xsl:template match="*[local-name()='padding']">
|
2811
|
+
<fo:inline padding-right="{@value}"> </fo:inline>
|
2730
2812
|
</xsl:template><xsl:template match="*[local-name()='sup']">
|
2731
2813
|
<fo:inline font-size="80%" vertical-align="super">
|
2732
2814
|
<xsl:apply-templates/>
|
@@ -2752,6 +2834,7 @@
|
|
2752
2834
|
|
2753
2835
|
|
2754
2836
|
|
2837
|
+
|
2755
2838
|
|
2756
2839
|
</xsl:variable>
|
2757
2840
|
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
|
@@ -3133,11 +3216,15 @@
|
|
3133
3216
|
</xsl:apply-templates>
|
3134
3217
|
</xsl:template><xsl:template name="getLang">
|
3135
3218
|
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
3219
|
+
<xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
3136
3220
|
<xsl:variable name="language">
|
3137
3221
|
<xsl:choose>
|
3138
3222
|
<xsl:when test="$language_current != ''">
|
3139
3223
|
<xsl:value-of select="$language_current"/>
|
3140
3224
|
</xsl:when>
|
3225
|
+
<xsl:when test="$language_current_2 != ''">
|
3226
|
+
<xsl:value-of select="$language_current_2"/>
|
3227
|
+
</xsl:when>
|
3141
3228
|
<xsl:otherwise>
|
3142
3229
|
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
3143
3230
|
</xsl:otherwise>
|
@@ -3211,9 +3298,27 @@
|
|
3211
3298
|
<xsl:copy>
|
3212
3299
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
3213
3300
|
</xsl:copy>
|
3214
|
-
<
|
3301
|
+
<xsl:choose>
|
3302
|
+
<!-- if in msub, then don't add space -->
|
3303
|
+
<xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
|
3304
|
+
<!-- if next char in digit, don't add space -->
|
3305
|
+
<xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
|
3306
|
+
<xsl:otherwise>
|
3307
|
+
<mathml:mspace width="0.5ex"/>
|
3308
|
+
</xsl:otherwise>
|
3309
|
+
</xsl:choose>
|
3215
3310
|
</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">
|
3216
3311
|
<xsl:variable name="target">
|
3312
|
+
<xsl:choose>
|
3313
|
+
<xsl:when test="@updatetype = 'true'">
|
3314
|
+
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
3315
|
+
</xsl:when>
|
3316
|
+
<xsl:otherwise>
|
3317
|
+
<xsl:value-of select="normalize-space(@target)"/>
|
3318
|
+
</xsl:otherwise>
|
3319
|
+
</xsl:choose>
|
3320
|
+
</xsl:variable>
|
3321
|
+
<xsl:variable name="target_text">
|
3217
3322
|
<xsl:choose>
|
3218
3323
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
3219
3324
|
<xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
|
@@ -3225,20 +3330,22 @@
|
|
3225
3330
|
</xsl:variable>
|
3226
3331
|
<fo:inline xsl:use-attribute-sets="link-style">
|
3227
3332
|
|
3333
|
+
|
3334
|
+
|
3228
3335
|
<xsl:choose>
|
3229
|
-
<xsl:when test="$
|
3336
|
+
<xsl:when test="$target_text = ''">
|
3230
3337
|
<xsl:apply-templates/>
|
3231
3338
|
</xsl:when>
|
3232
3339
|
<xsl:otherwise>
|
3233
|
-
<fo:basic-link external-destination="{
|
3340
|
+
<fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
|
3234
3341
|
<xsl:choose>
|
3235
3342
|
<xsl:when test="normalize-space(.) = ''">
|
3236
|
-
<!-- <xsl:value-of select="$target"/> -->
|
3237
3343
|
<xsl:call-template name="add-zero-spaces-link-java">
|
3238
|
-
<xsl:with-param name="text" select="$
|
3344
|
+
<xsl:with-param name="text" select="$target_text"/>
|
3239
3345
|
</xsl:call-template>
|
3240
3346
|
</xsl:when>
|
3241
3347
|
<xsl:otherwise>
|
3348
|
+
<!-- output text from <link>text</link> -->
|
3242
3349
|
<xsl:apply-templates/>
|
3243
3350
|
</xsl:otherwise>
|
3244
3351
|
</xsl:choose>
|
@@ -3354,6 +3461,7 @@
|
|
3354
3461
|
|
3355
3462
|
|
3356
3463
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
3464
|
+
|
3357
3465
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3358
3466
|
</fo:inline>
|
3359
3467
|
<xsl:apply-templates/>
|
@@ -3379,7 +3487,9 @@
|
|
3379
3487
|
</xsl:choose>
|
3380
3488
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']">
|
3381
3489
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
3490
|
+
|
3382
3491
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
3492
|
+
|
3383
3493
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3384
3494
|
</fo:inline>
|
3385
3495
|
<xsl:apply-templates/>
|
@@ -3451,13 +3561,17 @@
|
|
3451
3561
|
</xsl:call-template>
|
3452
3562
|
|
3453
3563
|
<fo:block>
|
3564
|
+
|
3454
3565
|
<xsl:apply-templates/>
|
3455
3566
|
</fo:block>
|
3456
3567
|
<xsl:call-template name="fn_display_figure"/>
|
3457
3568
|
<xsl:for-each select="*[local-name() = 'note']">
|
3458
3569
|
<xsl:call-template name="note"/>
|
3459
3570
|
</xsl:for-each>
|
3460
|
-
|
3571
|
+
|
3572
|
+
|
3573
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3574
|
+
|
3461
3575
|
</fo:block-container>
|
3462
3576
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
3463
3577
|
<fo:block id="{@id}">
|
@@ -3570,21 +3684,249 @@
|
|
3570
3684
|
<xsl:param name="height"/>
|
3571
3685
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
3572
3686
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
3687
|
+
</xsl:template><xsl:variable name="figure_name_height">14</xsl:variable><xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><xsl:variable name="image_dpi" select="96"/><xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/><xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
|
3688
|
+
<xsl:param name="name"/>
|
3689
|
+
|
3690
|
+
<xsl:variable name="svg_content">
|
3691
|
+
<xsl:apply-templates select="." mode="svg_update"/>
|
3692
|
+
</xsl:variable>
|
3693
|
+
|
3694
|
+
<xsl:variable name="alt-text">
|
3695
|
+
<xsl:choose>
|
3696
|
+
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
3697
|
+
<xsl:value-of select="../*[local-name() = 'name']"/>
|
3698
|
+
</xsl:when>
|
3699
|
+
<xsl:when test="normalize-space($name) != ''">
|
3700
|
+
<xsl:value-of select="$name"/>
|
3701
|
+
</xsl:when>
|
3702
|
+
<xsl:otherwise>Figure</xsl:otherwise>
|
3703
|
+
</xsl:choose>
|
3704
|
+
</xsl:variable>
|
3705
|
+
|
3706
|
+
<xsl:choose>
|
3707
|
+
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
3708
|
+
<fo:block>
|
3709
|
+
<xsl:variable name="width" select="@width"/>
|
3710
|
+
<xsl:variable name="height" select="@height"/>
|
3711
|
+
|
3712
|
+
<xsl:variable name="scale_x">
|
3713
|
+
<xsl:choose>
|
3714
|
+
<xsl:when test="$width > $width_effective_px">
|
3715
|
+
<xsl:value-of select="$width_effective_px div $width"/>
|
3716
|
+
</xsl:when>
|
3717
|
+
<xsl:otherwise>1</xsl:otherwise>
|
3718
|
+
</xsl:choose>
|
3719
|
+
</xsl:variable>
|
3720
|
+
|
3721
|
+
<xsl:variable name="scale_y">
|
3722
|
+
<xsl:choose>
|
3723
|
+
<xsl:when test="$height * $scale_x > $height_effective_px">
|
3724
|
+
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
3725
|
+
</xsl:when>
|
3726
|
+
<xsl:otherwise>1</xsl:otherwise>
|
3727
|
+
</xsl:choose>
|
3728
|
+
</xsl:variable>
|
3729
|
+
|
3730
|
+
<xsl:variable name="scale">
|
3731
|
+
<xsl:choose>
|
3732
|
+
<xsl:when test="$scale_y != 1">
|
3733
|
+
<xsl:value-of select="$scale_x * $scale_y"/>
|
3734
|
+
</xsl:when>
|
3735
|
+
<xsl:otherwise>
|
3736
|
+
<xsl:value-of select="$scale_x"/>
|
3737
|
+
</xsl:otherwise>
|
3738
|
+
</xsl:choose>
|
3739
|
+
</xsl:variable>
|
3740
|
+
|
3741
|
+
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
3742
|
+
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
3743
|
+
|
3744
|
+
<fo:table table-layout="fixed" width="100%">
|
3745
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
3746
|
+
<fo:table-column column-width="{$width_scale}px"/>
|
3747
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
3748
|
+
<fo:table-body>
|
3749
|
+
<fo:table-row>
|
3750
|
+
<fo:table-cell column-number="2">
|
3751
|
+
<fo:block>
|
3752
|
+
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
3753
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
3754
|
+
<fo:block line-height="0" font-size="0">
|
3755
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
3756
|
+
<xsl:call-template name="bookmark"/>
|
3757
|
+
</xsl:for-each>
|
3758
|
+
</fo:block>
|
3759
|
+
</xsl:if>
|
3760
|
+
<fo:block text-depth="0" line-height="0" font-size="0">
|
3761
|
+
|
3762
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
3763
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
3764
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
3765
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3766
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3767
|
+
|
3768
|
+
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
3769
|
+
</fo:instream-foreign-object>
|
3770
|
+
</fo:block>
|
3771
|
+
|
3772
|
+
<xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
|
3773
|
+
<xsl:with-param name="scale" select="$scale"/>
|
3774
|
+
</xsl:apply-templates>
|
3775
|
+
</fo:block-container>
|
3776
|
+
</fo:block>
|
3777
|
+
</fo:table-cell>
|
3778
|
+
</fo:table-row>
|
3779
|
+
</fo:table-body>
|
3780
|
+
</fo:table>
|
3781
|
+
</fo:block>
|
3782
|
+
|
3783
|
+
</xsl:when>
|
3784
|
+
<xsl:otherwise>
|
3785
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
3786
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
3787
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
3788
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
3789
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3790
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
3791
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
3792
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
3793
|
+
<xsl:if test="@height > (@width * 1.4)"> <!-- for images with big height -->
|
3794
|
+
<xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
|
3795
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
3796
|
+
</xsl:if>
|
3797
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3798
|
+
<xsl:copy-of select="$svg_content"/>
|
3799
|
+
</fo:instream-foreign-object>
|
3800
|
+
</fo:block>
|
3801
|
+
</xsl:otherwise>
|
3802
|
+
</xsl:choose>
|
3803
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_update">
|
3804
|
+
<xsl:copy>
|
3805
|
+
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
3806
|
+
</xsl:copy>
|
3807
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
3808
|
+
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
3809
|
+
<xsl:value-of select="."/>
|
3810
|
+
</xsl:attribute>
|
3811
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
3812
|
+
<xsl:variable name="svg_content" select="document(@src)"/>
|
3813
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
3814
|
+
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
3815
|
+
<xsl:call-template name="image_svg">
|
3816
|
+
<xsl:with-param name="name" select="$name"/>
|
3817
|
+
</xsl:call-template>
|
3818
|
+
</xsl:for-each>
|
3819
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
|
3820
|
+
<xsl:copy>
|
3821
|
+
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
3822
|
+
</xsl:copy>
|
3823
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
3824
|
+
<xsl:apply-templates mode="svg_remove_a"/>
|
3825
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
3826
|
+
<xsl:param name="scale"/>
|
3827
|
+
<xsl:variable name="dest">
|
3828
|
+
<xsl:choose>
|
3829
|
+
<xsl:when test="starts-with(@href, '#')">
|
3830
|
+
<xsl:value-of select="substring-after(@href, '#')"/>
|
3831
|
+
</xsl:when>
|
3832
|
+
<xsl:otherwise>
|
3833
|
+
<xsl:value-of select="@href"/>
|
3834
|
+
</xsl:otherwise>
|
3835
|
+
</xsl:choose>
|
3836
|
+
</xsl:variable>
|
3837
|
+
<xsl:for-each select="./*[local-name() = 'rect']">
|
3838
|
+
<xsl:call-template name="insertSVGMapLink">
|
3839
|
+
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
3840
|
+
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
3841
|
+
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
3842
|
+
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
3843
|
+
<xsl:with-param name="dest" select="$dest"/>
|
3844
|
+
</xsl:call-template>
|
3845
|
+
</xsl:for-each>
|
3846
|
+
|
3847
|
+
<xsl:for-each select="./*[local-name() = 'polygon']">
|
3848
|
+
<xsl:variable name="points">
|
3849
|
+
<xsl:call-template name="split">
|
3850
|
+
<xsl:with-param name="pText" select="@points"/>
|
3851
|
+
</xsl:call-template>
|
3852
|
+
</xsl:variable>
|
3853
|
+
<xsl:variable name="x_coords">
|
3854
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
3855
|
+
<xsl:sort select="." data-type="number"/>
|
3856
|
+
<x><xsl:value-of select="."/></x>
|
3857
|
+
</xsl:for-each>
|
3858
|
+
</xsl:variable>
|
3859
|
+
<xsl:variable name="y_coords">
|
3860
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
3861
|
+
<xsl:sort select="." data-type="number"/>
|
3862
|
+
<y><xsl:value-of select="."/></y>
|
3863
|
+
</xsl:for-each>
|
3864
|
+
</xsl:variable>
|
3865
|
+
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
3866
|
+
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
3867
|
+
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
3868
|
+
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
3869
|
+
<xsl:call-template name="insertSVGMapLink">
|
3870
|
+
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
3871
|
+
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
3872
|
+
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
3873
|
+
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
3874
|
+
<xsl:with-param name="dest" select="$dest"/>
|
3875
|
+
</xsl:call-template>
|
3876
|
+
</xsl:for-each>
|
3877
|
+
|
3878
|
+
<xsl:for-each select="./*[local-name() = 'circle']">
|
3879
|
+
<xsl:call-template name="insertSVGMapLink">
|
3880
|
+
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
3881
|
+
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
3882
|
+
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
3883
|
+
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
3884
|
+
<xsl:with-param name="dest" select="$dest"/>
|
3885
|
+
</xsl:call-template>
|
3886
|
+
</xsl:for-each>
|
3887
|
+
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
3888
|
+
<xsl:call-template name="insertSVGMapLink">
|
3889
|
+
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
3890
|
+
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
3891
|
+
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
3892
|
+
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
3893
|
+
<xsl:with-param name="dest" select="$dest"/>
|
3894
|
+
</xsl:call-template>
|
3895
|
+
</xsl:for-each>
|
3896
|
+
</xsl:template><xsl:template name="insertSVGMapLink">
|
3897
|
+
<xsl:param name="left"/>
|
3898
|
+
<xsl:param name="top"/>
|
3899
|
+
<xsl:param name="width"/>
|
3900
|
+
<xsl:param name="height"/>
|
3901
|
+
<xsl:param name="dest"/>
|
3902
|
+
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
3903
|
+
<fo:block font-size="1pt">
|
3904
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
3905
|
+
<fo:inline-container inline-progression-dimension="100%">
|
3906
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
3907
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
3908
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
3909
|
+
</xsl:if> -->
|
3910
|
+
<fo:block> </fo:block></fo:block-container>
|
3911
|
+
</fo:inline-container>
|
3912
|
+
</fo:basic-link>
|
3913
|
+
</fo:block>
|
3914
|
+
</fo:block-container>
|
3573
3915
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
3574
3916
|
<xsl:apply-templates mode="contents"/>
|
3575
3917
|
<xsl:text> </xsl:text>
|
3576
3918
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
|
3577
3919
|
<xsl:apply-templates mode="bookmarks"/>
|
3578
3920
|
<xsl:text> </xsl:text>
|
3579
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
|
3921
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
|
3580
3922
|
<xsl:value-of select="."/>
|
3581
|
-
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
3923
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
3582
3924
|
<xsl:value-of select="."/>
|
3583
3925
|
</xsl:template><xsl:template match="node()" mode="contents">
|
3584
3926
|
<xsl:apply-templates mode="contents"/>
|
3585
3927
|
</xsl:template><xsl:template match="node()" mode="bookmarks">
|
3586
3928
|
<xsl:apply-templates mode="bookmarks"/>
|
3587
|
-
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
3929
|
+
</xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
|
3588
3930
|
<xsl:apply-templates select="."/>
|
3589
3931
|
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3590
3932
|
<xsl:apply-templates mode="bookmarks"/>
|
@@ -3598,28 +3940,39 @@
|
|
3598
3940
|
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
3599
3941
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3600
3942
|
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
3943
|
+
<xsl:if test="@bundle = 'true'">
|
3944
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
|
3945
|
+
</xsl:if>
|
3601
3946
|
<fo:bookmark-title>
|
3602
|
-
<xsl:variable name="bookmark-title_">
|
3603
|
-
<xsl:call-template name="getLangVersion">
|
3604
|
-
<xsl:with-param name="lang" select="@lang"/>
|
3605
|
-
<xsl:with-param name="doctype" select="@doctype"/>
|
3606
|
-
<xsl:with-param name="title" select="@title-part"/>
|
3607
|
-
</xsl:call-template>
|
3608
|
-
</xsl:variable>
|
3609
3947
|
<xsl:choose>
|
3610
|
-
<xsl:when test="normalize-space(
|
3611
|
-
<xsl:
|
3612
|
-
|
3613
|
-
|
3948
|
+
<xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
|
3949
|
+
<xsl:variable name="bookmark-title_">
|
3950
|
+
<xsl:call-template name="getLangVersion">
|
3951
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3952
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
3953
|
+
<xsl:with-param name="title" select="@title-part"/>
|
3954
|
+
</xsl:call-template>
|
3955
|
+
</xsl:variable>
|
3614
3956
|
<xsl:choose>
|
3615
|
-
<xsl:when test="
|
3616
|
-
|
3617
|
-
|
3618
|
-
<xsl:otherwise
|
3957
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
3958
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
3959
|
+
</xsl:when>
|
3960
|
+
<xsl:otherwise>
|
3961
|
+
<xsl:choose>
|
3962
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
3963
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
3964
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
3965
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
3966
|
+
</xsl:choose>
|
3967
|
+
</xsl:otherwise>
|
3619
3968
|
</xsl:choose>
|
3969
|
+
</xsl:when>
|
3970
|
+
<xsl:otherwise>
|
3971
|
+
<xsl:value-of select="@title-part"/>
|
3620
3972
|
</xsl:otherwise>
|
3621
3973
|
</xsl:choose>
|
3622
3974
|
</fo:bookmark-title>
|
3975
|
+
|
3623
3976
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3624
3977
|
|
3625
3978
|
<xsl:call-template name="insertFigureBookmarks">
|
@@ -3718,20 +4071,28 @@
|
|
3718
4071
|
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
3719
4072
|
</xsl:choose>
|
3720
4073
|
</xsl:template><xsl:template match="item" mode="bookmark">
|
3721
|
-
<
|
3722
|
-
|
3723
|
-
|
3724
|
-
|
3725
|
-
<xsl:
|
3726
|
-
|
3727
|
-
|
3728
|
-
|
3729
|
-
|
3730
|
-
|
4074
|
+
<xsl:choose>
|
4075
|
+
<xsl:when test="@id != ''">
|
4076
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
4077
|
+
<fo:bookmark-title>
|
4078
|
+
<xsl:if test="@section != ''">
|
4079
|
+
<xsl:value-of select="@section"/>
|
4080
|
+
<xsl:text> </xsl:text>
|
4081
|
+
</xsl:if>
|
4082
|
+
<xsl:value-of select="normalize-space(title)"/>
|
4083
|
+
</fo:bookmark-title>
|
4084
|
+
<xsl:apply-templates mode="bookmark"/>
|
4085
|
+
</fo:bookmark>
|
4086
|
+
</xsl:when>
|
4087
|
+
<xsl:otherwise>
|
4088
|
+
<xsl:apply-templates mode="bookmark"/>
|
4089
|
+
</xsl:otherwise>
|
4090
|
+
</xsl:choose>
|
3731
4091
|
</xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
|
3732
4092
|
<xsl:if test="normalize-space() != ''">
|
3733
4093
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
3734
4094
|
|
4095
|
+
|
3735
4096
|
<xsl:apply-templates/>
|
3736
4097
|
</fo:block>
|
3737
4098
|
</xsl:if>
|
@@ -3783,6 +4144,8 @@
|
|
3783
4144
|
</fo:list-item-body>
|
3784
4145
|
</fo:list-item>
|
3785
4146
|
</fo:list-block>
|
4147
|
+
</xsl:template><xsl:template name="extractSection">
|
4148
|
+
<xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
3786
4149
|
</xsl:template><xsl:template name="extractTitle">
|
3787
4150
|
<xsl:choose>
|
3788
4151
|
<xsl:when test="*[local-name() = 'tab']">
|
@@ -3809,6 +4172,8 @@
|
|
3809
4172
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
3810
4173
|
|
3811
4174
|
<fo:block-container margin-left="0mm">
|
4175
|
+
<xsl:copy-of select="@id"/>
|
4176
|
+
|
3812
4177
|
<xsl:if test="parent::*[local-name() = 'note']">
|
3813
4178
|
<xsl:attribute name="margin-left">
|
3814
4179
|
<xsl:choose>
|
@@ -3819,7 +4184,9 @@
|
|
3819
4184
|
|
3820
4185
|
</xsl:if>
|
3821
4186
|
<fo:block-container margin-left="0mm">
|
3822
|
-
|
4187
|
+
|
4188
|
+
|
4189
|
+
|
3823
4190
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
3824
4191
|
<xsl:variable name="_font-size">
|
3825
4192
|
10
|
@@ -3830,6 +4197,7 @@
|
|
3830
4197
|
|
3831
4198
|
|
3832
4199
|
|
4200
|
+
|
3833
4201
|
|
3834
4202
|
|
3835
4203
|
|
@@ -3847,10 +4215,14 @@
|
|
3847
4215
|
</xsl:choose>
|
3848
4216
|
</xsl:attribute>
|
3849
4217
|
</xsl:if>
|
3850
|
-
|
3851
|
-
|
4218
|
+
|
4219
|
+
<xsl:apply-templates/>
|
4220
|
+
</fo:block>
|
4221
|
+
|
4222
|
+
|
3852
4223
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
3853
4224
|
|
4225
|
+
|
3854
4226
|
</fo:block-container>
|
3855
4227
|
</fo:block-container>
|
3856
4228
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -4085,6 +4457,7 @@
|
|
4085
4457
|
</xsl:template><xsl:template match="*[local-name() = 'example']">
|
4086
4458
|
<fo:block id="{@id}" xsl:use-attribute-sets="example-style">
|
4087
4459
|
|
4460
|
+
|
4088
4461
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
4089
4462
|
|
4090
4463
|
<xsl:variable name="element">
|
@@ -4152,7 +4525,7 @@
|
|
4152
4525
|
</fo:inline>
|
4153
4526
|
</xsl:otherwise>
|
4154
4527
|
</xsl:choose>
|
4155
|
-
</xsl:template><xsl:template match="*[local-name() = 'termsource']">
|
4528
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
|
4156
4529
|
<fo:block xsl:use-attribute-sets="termsource-style">
|
4157
4530
|
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
|
4158
4531
|
<xsl:variable name="termsource_text">
|
@@ -4161,13 +4534,15 @@
|
|
4161
4534
|
|
4162
4535
|
<xsl:choose>
|
4163
4536
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
4164
|
-
<xsl:apply-templates/>
|
4537
|
+
<!-- <xsl:apply-templates /> -->
|
4538
|
+
<xsl:copy-of select="$termsource_text"/>
|
4165
4539
|
</xsl:when>
|
4166
4540
|
<xsl:otherwise>
|
4167
4541
|
|
4168
4542
|
<xsl:text>[</xsl:text>
|
4169
4543
|
|
4170
|
-
<xsl:apply-templates/>
|
4544
|
+
<!-- <xsl:apply-templates /> -->
|
4545
|
+
<xsl:copy-of select="$termsource_text"/>
|
4171
4546
|
|
4172
4547
|
<xsl:text>]</xsl:text>
|
4173
4548
|
|
@@ -4178,20 +4553,29 @@
|
|
4178
4553
|
<xsl:if test="normalize-space() != ''">
|
4179
4554
|
<xsl:value-of select="."/>
|
4180
4555
|
</xsl:if>
|
4181
|
-
</xsl:template><xsl:
|
4556
|
+
</xsl:template><xsl:variable name="localized.source">
|
4557
|
+
<xsl:call-template name="getLocalizedString">
|
4558
|
+
<xsl:with-param name="key">source</xsl:with-param>
|
4559
|
+
</xsl:call-template>
|
4560
|
+
</xsl:variable><xsl:template match="*[local-name() = 'origin']">
|
4182
4561
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4562
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
4563
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
4564
|
+
</xsl:if>
|
4183
4565
|
|
4184
4566
|
<fo:inline>
|
4185
4567
|
|
4186
4568
|
|
4187
4569
|
|
4188
4570
|
|
4571
|
+
|
4572
|
+
|
4189
4573
|
<xsl:call-template name="getTitle">
|
4190
4574
|
<xsl:with-param name="name" select="'title-source'"/>
|
4191
4575
|
</xsl:call-template>
|
4576
|
+
<xsl:text>: </xsl:text>
|
4192
4577
|
|
4193
4578
|
|
4194
|
-
<xsl:text>: </xsl:text>
|
4195
4579
|
</fo:inline>
|
4196
4580
|
|
4197
4581
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
@@ -4264,6 +4648,7 @@
|
|
4264
4648
|
</xsl:if>
|
4265
4649
|
|
4266
4650
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4651
|
+
|
4267
4652
|
<xsl:if test="normalize-space(@citeas) = ''">
|
4268
4653
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
4269
4654
|
</xsl:if>
|
@@ -4309,6 +4694,7 @@
|
|
4309
4694
|
|
4310
4695
|
|
4311
4696
|
|
4697
|
+
|
4312
4698
|
</xsl:variable>
|
4313
4699
|
|
4314
4700
|
<xsl:variable name="padding-right">
|
@@ -4394,7 +4780,6 @@
|
|
4394
4780
|
|
4395
4781
|
|
4396
4782
|
|
4397
|
-
|
4398
4783
|
<xsl:apply-templates/>
|
4399
4784
|
</fo:block>
|
4400
4785
|
|
@@ -4411,6 +4796,7 @@
|
|
4411
4796
|
<xsl:call-template name="setId"/>
|
4412
4797
|
|
4413
4798
|
|
4799
|
+
|
4414
4800
|
<xsl:apply-templates/>
|
4415
4801
|
</fo:block>
|
4416
4802
|
</xsl:template><xsl:template match="*[local-name() = 'definitions']">
|
@@ -4437,7 +4823,7 @@
|
|
4437
4823
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
4438
4824
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
4439
4825
|
<xsl:choose>
|
4440
|
-
<xsl:when test="parent::*[local-name() = 'note']">
|
4826
|
+
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
4441
4827
|
<fo:block-container>
|
4442
4828
|
<xsl:attribute name="margin-left">
|
4443
4829
|
<xsl:choose>
|
@@ -4447,6 +4833,7 @@
|
|
4447
4833
|
</xsl:attribute>
|
4448
4834
|
|
4449
4835
|
|
4836
|
+
|
4450
4837
|
<fo:block-container margin-left="0mm">
|
4451
4838
|
<fo:block>
|
4452
4839
|
<xsl:apply-templates select="." mode="ul_ol"/>
|
@@ -4648,21 +5035,25 @@
|
|
4648
5035
|
|
4649
5036
|
|
4650
5037
|
|
5038
|
+
|
5039
|
+
|
5040
|
+
|
5041
|
+
|
4651
5042
|
</xsl:template><xsl:template name="processBibitemDocId">
|
4652
5043
|
<xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
|
4653
5044
|
<xsl:choose>
|
4654
5045
|
<xsl:when test="normalize-space($_doc_ident) != ''">
|
4655
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
|
5046
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
|
4656
5047
|
<xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
|
4657
5048
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
4658
|
-
</xsl:if>
|
5049
|
+
</xsl:if> -->
|
4659
5050
|
<xsl:value-of select="$_doc_ident"/>
|
4660
5051
|
</xsl:when>
|
4661
5052
|
<xsl:otherwise>
|
4662
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
5053
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
4663
5054
|
<xsl:if test="$type != ''">
|
4664
5055
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
4665
|
-
</xsl:if>
|
5056
|
+
</xsl:if> -->
|
4666
5057
|
<xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
|
4667
5058
|
</xsl:otherwise>
|
4668
5059
|
</xsl:choose>
|
@@ -4704,6 +5095,70 @@
|
|
4704
5095
|
<xsl:value-of select="substring(.,1,1)"/>
|
4705
5096
|
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
|
4706
5097
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
5098
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']">
|
5099
|
+
<fo:block>
|
5100
|
+
<xsl:apply-templates/>
|
5101
|
+
</fo:block>
|
5102
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
|
5103
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
5104
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
|
5105
|
+
<fo:inline>
|
5106
|
+
<xsl:call-template name="text_input"/>
|
5107
|
+
</fo:inline>
|
5108
|
+
</xsl:template><xsl:template name="text_input">
|
5109
|
+
<xsl:variable name="count">
|
5110
|
+
<xsl:choose>
|
5111
|
+
<xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
|
5112
|
+
<xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
|
5113
|
+
<xsl:otherwise>10</xsl:otherwise>
|
5114
|
+
</xsl:choose>
|
5115
|
+
</xsl:variable>
|
5116
|
+
<xsl:call-template name="repeat">
|
5117
|
+
<xsl:with-param name="char" select="'_'"/>
|
5118
|
+
<xsl:with-param name="count" select="$count"/>
|
5119
|
+
</xsl:call-template>
|
5120
|
+
<xsl:text> </xsl:text>
|
5121
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
|
5122
|
+
<xsl:variable name="caption">
|
5123
|
+
<xsl:choose>
|
5124
|
+
<xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
|
5125
|
+
<xsl:otherwise>BUTTON</xsl:otherwise>
|
5126
|
+
</xsl:choose>
|
5127
|
+
</xsl:variable>
|
5128
|
+
<fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
|
5129
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
|
5130
|
+
<fo:inline padding-right="1mm">
|
5131
|
+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
|
5132
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
5133
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
5134
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5135
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5136
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
|
5137
|
+
<polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
|
5138
|
+
</svg>
|
5139
|
+
</fo:instream-foreign-object>
|
5140
|
+
</fo:inline>
|
5141
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
|
5142
|
+
<fo:inline padding-right="1mm">
|
5143
|
+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
|
5144
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
5145
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
5146
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5147
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5148
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
|
5149
|
+
<circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
|
5150
|
+
<circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
|
5151
|
+
</svg>
|
5152
|
+
</fo:instream-foreign-object>
|
5153
|
+
</fo:inline>
|
5154
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
|
5155
|
+
<fo:inline>
|
5156
|
+
<xsl:call-template name="text_input"/>
|
5157
|
+
</fo:inline>
|
5158
|
+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
|
5159
|
+
<fo:block-container border="1pt solid black" width="50%">
|
5160
|
+
<fo:block> </fo:block>
|
5161
|
+
</fo:block-container>
|
4707
5162
|
</xsl:template><xsl:template name="convertDate">
|
4708
5163
|
<xsl:param name="date"/>
|
4709
5164
|
<xsl:param name="format" select="'short'"/>
|
@@ -4911,6 +5366,9 @@
|
|
4911
5366
|
<xsl:when test="parent::*[local-name() = 'preface']">
|
4912
5367
|
<xsl:value-of select="$level_total - 1"/>
|
4913
5368
|
</xsl:when>
|
5369
|
+
<xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
|
5370
|
+
<xsl:value-of select="$level_total - 1"/>
|
5371
|
+
</xsl:when>
|
4914
5372
|
<xsl:when test="ancestor::*[local-name() = 'preface']">
|
4915
5373
|
<xsl:value-of select="$level_total - 2"/>
|
4916
5374
|
</xsl:when>
|
@@ -4973,6 +5431,7 @@
|
|
4973
5431
|
|
4974
5432
|
|
4975
5433
|
|
5434
|
+
|
4976
5435
|
<xsl:value-of select="document('')//*/namespace::csa"/>
|
4977
5436
|
|
4978
5437
|
|
@@ -5035,17 +5494,29 @@
|
|
5035
5494
|
</xsl:call-template>
|
5036
5495
|
</xsl:if>
|
5037
5496
|
</xsl:template><xsl:template name="getLocalizedString">
|
5038
|
-
<xsl:param name="key"/>
|
5497
|
+
<xsl:param name="key"/>
|
5039
5498
|
|
5040
5499
|
<xsl:variable name="curr_lang">
|
5041
5500
|
<xsl:call-template name="getLang"/>
|
5042
5501
|
</xsl:variable>
|
5043
5502
|
|
5503
|
+
<xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
5504
|
+
|
5044
5505
|
<xsl:choose>
|
5506
|
+
<xsl:when test="$data_value != ''">
|
5507
|
+
<xsl:value-of select="$data_value"/>
|
5508
|
+
</xsl:when>
|
5045
5509
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
5046
5510
|
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5047
5511
|
</xsl:when>
|
5048
|
-
<xsl:otherwise
|
5512
|
+
<xsl:otherwise>
|
5513
|
+
<xsl:variable name="key_">
|
5514
|
+
<xsl:call-template name="capitalize">
|
5515
|
+
<xsl:with-param name="str" select="translate($key, '_', ' ')"/>
|
5516
|
+
</xsl:call-template>
|
5517
|
+
</xsl:variable>
|
5518
|
+
<xsl:value-of select="$key_"/>
|
5519
|
+
</xsl:otherwise>
|
5049
5520
|
</xsl:choose>
|
5050
5521
|
|
5051
5522
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
@@ -5088,4 +5559,14 @@
|
|
5088
5559
|
<xsl:value-of select="$align"/>
|
5089
5560
|
</xsl:when>
|
5090
5561
|
</xsl:choose>
|
5562
|
+
</xsl:template><xsl:template name="setTextAlignment">
|
5563
|
+
<xsl:param name="default">left</xsl:param>
|
5564
|
+
<xsl:attribute name="text-align">
|
5565
|
+
<xsl:choose>
|
5566
|
+
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
5567
|
+
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
5568
|
+
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
5569
|
+
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
5570
|
+
</xsl:choose>
|
5571
|
+
</xsl:attribute>
|
5091
5572
|
</xsl:template></xsl:stylesheet>
|