metanorma-iso 2.9.2 → 2.9.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,11 +11,20 @@
11
11
 
12
12
  <xsl:variable name="column_gap">8.5mm</xsl:variable>
13
13
 
14
- <xsl:variable name="docidentifierISO_undated"><xsl:if test="not($stage-abbreviation = 'FDAMD' or $stage-abbreviation = 'FDAM' or $stage-abbreviation = 'DAMD' or $stage-abbreviation = 'DAM')"><xsl:value-of select="normalize-space(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-undated'])"/></xsl:if></xsl:variable>
14
+ <xsl:variable name="docidentifier_iso" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'] | /iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'ISO']"/>
15
+
16
+ <xsl:variable name="docidentifier_undated_" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-undated'])"/>
17
+ <xsl:variable name="docidentifier_undated"><xsl:value-of select="$docidentifier_undated_"/><xsl:if test="$docidentifier_undated_ = ''"><xsl:value-of select="$docidentifier_iso"/></xsl:if></xsl:variable>
18
+ <xsl:variable name="docidentifierISO_undated_">
19
+ <xsl:if test="not($stage-abbreviation = 'FDAMD' or $stage-abbreviation = 'FDAM' or $stage-abbreviation = 'DAMD' or $stage-abbreviation = 'DAM')">
20
+ <xsl:value-of select="$docidentifier_undated_"/>
21
+ </xsl:if>
22
+ </xsl:variable>
23
+ <xsl:variable name="docidentifierISO_undated" select="normalize-space($docidentifierISO_undated_)"/>
15
24
  <xsl:variable name="docidentifierISO_">
16
25
  <xsl:value-of select="$docidentifierISO_undated"/>
17
26
  <xsl:if test="$docidentifierISO_undated = ''">
18
- <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'] | /iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'ISO']"/>
27
+ <xsl:value-of select="$docidentifier_iso"/>
19
28
  </xsl:if>
20
29
  </xsl:variable>
21
30
  <xsl:variable name="docidentifierISO" select="normalize-space($docidentifierISO_)"/>
@@ -77,12 +86,14 @@
77
86
  <xsl:value-of select="$i18n_all_rights_reserved"/>
78
87
  </xsl:variable>
79
88
 
80
- <xsl:variable name="docidentifier_iso_with_lang" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-with-lang']"/>
89
+ <xsl:variable name="docidentifier_iso_with_lang_" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-with-lang'])"/>
90
+ <xsl:variable name="docidentifier_iso_with_lang"><xsl:value-of select="$docidentifier_iso_with_lang_"/><xsl:if test="$docidentifier_iso_with_lang_ = ''"><xsl:value-of select="$docidentifier_iso"/></xsl:if></xsl:variable>
81
91
 
82
92
  <xsl:variable name="lang-1st-letter_tmp" select="substring-before(substring-after($docidentifier_iso_with_lang, '('), ')')"/>
83
93
  <xsl:variable name="lang-1st-letter" select="concat('(', $lang-1st-letter_tmp , ')')"/>
84
94
 
85
- <xsl:variable name="iso_reference" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-reference']"/>
95
+ <xsl:variable name="iso_reference_" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-reference'])"/>
96
+ <xsl:variable name="iso_reference"><xsl:value-of select="$iso_reference_"/><xsl:if test="$iso_reference_ = ''"><xsl:value-of select="$docidentifier_iso"/></xsl:if></xsl:variable>
86
97
  <xsl:variable name="anotherNumbers">
87
98
  <xsl:variable name="year_iso_reference" select="concat(':',substring-after($iso_reference,':'))"/>
88
99
  <xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type != '' and @type != 'ISO' and not(starts-with(@type, 'iso-')) and @type != 'URN']">
@@ -276,6 +287,7 @@
276
287
  <xsl:variable name="i18n_date_printing"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">date_printing</xsl:with-param></xsl:call-template></xsl:variable>
277
288
  <xsl:variable name="i18n_corrected_version"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">corrected_version</xsl:with-param></xsl:call-template></xsl:variable>
278
289
  <xsl:variable name="i18n_fast_track_procedure"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">fast-track-procedure</xsl:with-param></xsl:call-template></xsl:variable>
290
+ <xsl:variable name="i18n_iso_cen_parallel"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">iso-cen-parallel</xsl:with-param></xsl:call-template></xsl:variable>
279
291
  <xsl:variable name="i18n_all_rights_reserved"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">all_rights_reserved</xsl:with-param></xsl:call-template></xsl:variable>
280
292
  <xsl:variable name="i18n_locality_page"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">locality.page</xsl:with-param></xsl:call-template></xsl:variable>
281
293
  <xsl:variable name="i18n_locality_part"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">locality.part</xsl:with-param></xsl:call-template></xsl:variable>
@@ -966,7 +978,7 @@
966
978
  </xsl:variable>
967
979
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($doctype_international_standard))"/>
968
980
  <xsl:text> </xsl:text>
969
- <xsl:value-of select="translate(substring-before(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-undated'], '/'),':','-')"/>
981
+ <xsl:value-of select="translate(substring-before($docidentifier_undated, '/'),':','-')"/>
970
982
  <xsl:text>/</xsl:text>
971
983
  <xsl:value-of select="$doctype_localized"/>
972
984
  <xsl:text> </xsl:text>
@@ -1037,7 +1049,7 @@
1037
1049
 
1038
1050
  <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface/sections -->
1039
1051
 
1040
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//image or .//svg]">
1052
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
1041
1053
 
1042
1054
  <fo:page-sequence format="i" force-page-count="no-force">
1043
1055
 
@@ -1186,7 +1198,7 @@
1186
1198
 
1187
1199
  <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to sections, if top element in 'sections' -->
1188
1200
 
1189
- <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//image or .//svg]">
1201
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
1190
1202
 
1191
1203
  <!-- BODY -->
1192
1204
  <fo:page-sequence force-page-count="no-force">
@@ -1852,9 +1864,19 @@
1852
1864
 
1853
1865
  <xsl:choose>
1854
1866
  <xsl:when test="$stage-abbreviation = 'DIS'"> <!-- or $stage-abbreviation = 'DAMD' or $stage-abbreviation = 'DAM' -->
1855
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($stagename))"/>
1856
- <xsl:value-of select="$linebreak"/>
1857
- <xsl:value-of select="$doctype_localized"/>
1867
+ <xsl:choose>
1868
+ <xsl:when test="contains($stagename, ' ')">
1869
+ <!-- Draft International Standard to DRAFT -->
1870
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring-before($stagename, ' ')))"/>
1871
+ <xsl:value-of select="$linebreak"/>
1872
+ <xsl:value-of select="substring-after($stagename, ' ')"/>
1873
+ </xsl:when>
1874
+ <xsl:otherwise>
1875
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($stagename))"/>
1876
+ <xsl:value-of select="$linebreak"/>
1877
+ <xsl:value-of select="$doctype_localized"/>
1878
+ </xsl:otherwise>
1879
+ </xsl:choose>
1858
1880
  </xsl:when>
1859
1881
  <!-- <xsl:when test="$stage-abbreviation = 'FDAmd' or $stage-abbreviation = 'FDAM'"><xsl:value-of select="$doctype_uppercased"/></xsl:when> -->
1860
1882
  <xsl:when test="$stagename-header-coverpage != ''">
@@ -1924,7 +1946,7 @@
1924
1946
  <xsl:call-template name="insertTitlesLangMain"/>
1925
1947
  </fo:block>
1926
1948
 
1927
- <xsl:if test="not($stage-abbreviation = 'FDAMD' or $stage-abbreviation = 'FDAM' or $stage-abbreviation = 'PRF')">
1949
+ <xsl:if test="not($stage-abbreviation = 'FDAMD' or $stage-abbreviation = 'FDAM')"> <!-- or $stage-abbreviation = 'PRF' -->
1928
1950
  <xsl:for-each select="xalan:nodeset($lang_other)/lang">
1929
1951
  <xsl:variable name="lang_other" select="."/>
1930
1952
  <fo:block font-size="12pt" role="SKIP"><xsl:value-of select="$linebreak"/></fo:block>
@@ -1938,7 +1960,8 @@
1938
1960
  </xsl:if>
1939
1961
 
1940
1962
  <xsl:if test="$stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD' or $stage-abbreviation = 'FDIS' or $stagename_abbreviation = 'FDIS' or $stage-abbreviation = 'DIS' or $stage-abbreviation = 'DAMD' or $stage-abbreviation = 'DAM' or $stagename_abbreviation = 'DIS'">
1941
- <fo:block margin-top="20mm">
1963
+ <fo:block margin-top="20mm" font-size="11pt">
1964
+ <xsl:call-template name="insertInterFont"/>
1942
1965
  <xsl:copy-of select="$ics"/>
1943
1966
  </fo:block>
1944
1967
  </xsl:if>
@@ -2035,7 +2058,7 @@
2035
2058
 
2036
2059
  <xsl:if test="normalize-space($additionalNotes) != ''"> <!-- or $stage-abbreviation = 'PRF' -->
2037
2060
  <xsl:attribute name="display-align">center</xsl:attribute>
2038
- <fo:block>
2061
+ <fo:block margin-bottom="6.5mm">
2039
2062
  <xsl:copy-of select="$additionalNotes"/>
2040
2063
  </fo:block>
2041
2064
  </xsl:if>
@@ -2152,11 +2175,15 @@
2152
2175
  <fo:block-container height="22.5mm" display-align="center" role="SKIP">
2153
2176
 
2154
2177
  <xsl:variable name="iso-fast-track" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:ext/iso:fast-track)"/>
2155
-
2156
2178
  <xsl:if test="normalize-space($iso-fast-track) = 'true'">
2157
2179
  <xsl:attribute name="height">28mm</xsl:attribute>
2158
2180
  </xsl:if>
2159
2181
 
2182
+ <xsl:variable name="iso-cen-parallel" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:ext/iso:iso-cen-parallel)"/>
2183
+ <xsl:if test="normalize-space($iso-cen-parallel) = 'true'">
2184
+ <xsl:attribute name="height">35mm</xsl:attribute>
2185
+ </xsl:if>
2186
+
2160
2187
  <fo:block>
2161
2188
  <xsl:call-template name="insertCoverPageAdditionalNotes"/>
2162
2189
  </fo:block>
@@ -3088,6 +3115,31 @@
3088
3115
  </fo:block>
3089
3116
  </fo:block-container>
3090
3117
  </xsl:if>
3118
+
3119
+ <xsl:variable name="iso-cen-parallel" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:ext/iso:iso-cen-parallel)"/>
3120
+
3121
+ <xsl:if test="normalize-space($iso-cen-parallel) = 'true'">
3122
+ <fo:block-container space-before="4mm" role="SKIP">
3123
+ <fo:block background-color="rgb(77,77,77)" color="white" fox:border-radius="5pt" text-align="center" display-align="center" font-size="19pt" font-weight="bold" role="SKIP">
3124
+ <xsl:if test="$layoutVersion = '2024'">
3125
+ <xsl:attribute name="background-color">rgb(88,88,88)</xsl:attribute>
3126
+ <xsl:attribute name="fox:border-radius">0pt</xsl:attribute>
3127
+ <xsl:attribute name="font-size">16pt</xsl:attribute>
3128
+ </xsl:if>
3129
+ <fo:block-container height="13.2mm" role="SKIP">
3130
+ <xsl:if test="$layoutVersion = '2024'">
3131
+ <xsl:attribute name="height">11.2mm</xsl:attribute>
3132
+ <xsl:attribute name="padding-top">2mm</xsl:attribute>
3133
+ </xsl:if>
3134
+ <fo:block>
3135
+ <!-- <xsl:text>ISO/CEN PARALLEL PROCESSING</xsl:text> -->
3136
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($i18n_iso_cen_parallel))"/>
3137
+ </fo:block>
3138
+ </fo:block-container>
3139
+ </fo:block>
3140
+ </fo:block-container>
3141
+ </xsl:if>
3142
+
3091
3143
  </xsl:if>
3092
3144
  </xsl:template>
3093
3145
 
@@ -5541,8 +5593,21 @@
5541
5593
 
5542
5594
  <!-- <xsl:strip-space elements="iso:xref"/> -->
5543
5595
 
5544
- <xsl:variable name="namespace_full" select="namespace-uri(/*)"/> <!-- example: https://www.metanorma.org/ns/iso -->
5545
- <xsl:variable name="root_element" select="local-name(/*)"/> <!-- example: iso-standard -->
5596
+ <xsl:variable name="namespace_full_">
5597
+ <xsl:choose>
5598
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
5599
+ <xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/iso -->
5600
+ </xsl:choose>
5601
+ </xsl:variable>
5602
+ <xsl:variable name="namespace_full" select="normalize-space($namespace_full_)"/>
5603
+
5604
+ <xsl:variable name="root_element_">
5605
+ <xsl:choose>
5606
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
5607
+ <xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: iso-standard -->
5608
+ </xsl:choose>
5609
+ </xsl:variable>
5610
+ <xsl:variable name="root_element" select="normalize-space($root_element_)"/>
5546
5611
 
5547
5612
  <xsl:variable name="document_scheme" select="normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'document-scheme']/*[local-name() = 'value'])"/>
5548
5613
 
@@ -9161,7 +9226,9 @@
9161
9226
  <fo:block role="SKIP">
9162
9227
 
9163
9228
  <xsl:if test="$isGenerateTableIF = 'true'">
9164
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
9229
+
9230
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
9231
+
9165
9232
  </xsl:if>
9166
9233
 
9167
9234
  <xsl:apply-templates/>
@@ -10211,7 +10278,17 @@
10211
10278
  <xsl:call-template name="refine_dt-cell-style"/>
10212
10279
 
10213
10280
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
10214
- <xsl:copy-of select="@id"/>
10281
+
10282
+ <xsl:choose>
10283
+ <xsl:when test="$isGenerateTableIF = 'true'">
10284
+
10285
+ <xsl:copy-of select="@id"/>
10286
+
10287
+ </xsl:when>
10288
+ <xsl:otherwise>
10289
+ <xsl:copy-of select="@id"/>
10290
+ </xsl:otherwise>
10291
+ </xsl:choose>
10215
10292
 
10216
10293
  <xsl:if test="normalize-space($key_iso) = 'true'">
10217
10294
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -10243,7 +10320,9 @@
10243
10320
  <fo:block role="SKIP">
10244
10321
 
10245
10322
  <xsl:if test="$isGenerateTableIF = 'true'">
10246
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
10323
+
10324
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
10325
+
10247
10326
  </xsl:if>
10248
10327
 
10249
10328
  <xsl:choose>
@@ -10733,6 +10812,12 @@
10733
10812
  </xsl:if>
10734
10813
  </xsl:template>
10735
10814
 
10815
+ <xsl:template match="*[local-name()='strike']">
10816
+ <fo:inline text-decoration="line-through">
10817
+ <xsl:apply-templates/>
10818
+ </fo:inline>
10819
+ </xsl:template>
10820
+
10736
10821
  <xsl:template match="*[local-name() = 'pagebreak']">
10737
10822
  <fo:block break-after="page"/>
10738
10823
  <fo:block> </fo:block>
@@ -11566,6 +11651,14 @@
11566
11651
  </xsl:for-each>
11567
11652
  </xsl:variable>
11568
11653
 
11654
+ <!-- <xsl:if test="$debug = 'true'">
11655
+ <redirect:write file="{generate-id()}_words_with_width_sorted.xml">
11656
+ <td_text><xsl:copy-of select="$td_text"/></td_text>
11657
+ <words_with_width><xsl:copy-of select="$words_with_width"/></words_with_width>
11658
+ <xsl:copy-of select="$words_with_width_sorted"/>
11659
+ </redirect:write>
11660
+ </xsl:if> -->
11661
+
11569
11662
  <xsl:variable name="words">
11570
11663
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
11571
11664
  <word>
@@ -11691,6 +11784,7 @@
11691
11784
  <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
11692
11785
  <xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
11693
11786
  <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
11787
+ <xsl:if test="ancestor::*[local-name() = 'font_en_vertical']"><tag>font_en_vertical</tag></xsl:if>
11694
11788
  </tags>
11695
11789
  </xsl:template>
11696
11790
  <!-- =============================== -->
@@ -12238,7 +12332,16 @@
12238
12332
  </xsl:when>
12239
12333
  <xsl:otherwise>
12240
12334
  <!-- output text from <link>text</link> -->
12241
- <xsl:apply-templates/>
12335
+ <xsl:choose>
12336
+ <xsl:when test="starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.')">
12337
+ <xsl:call-template name="add-zero-spaces-link-java">
12338
+ <xsl:with-param name="text" select="."/>
12339
+ </xsl:call-template>
12340
+ </xsl:when>
12341
+ <xsl:otherwise>
12342
+ <xsl:apply-templates/>
12343
+ </xsl:otherwise>
12344
+ </xsl:choose>
12242
12345
  </xsl:otherwise>
12243
12346
  </xsl:choose>
12244
12347
  </fo:basic-link>
@@ -12908,16 +13011,29 @@
12908
13011
  <xsl:template name="getImageSrc">
12909
13012
  <xsl:choose>
12910
13013
  <xsl:when test="not(starts-with(@src, 'data:'))">
13014
+ <xsl:call-template name="getImageSrcExternal"/>
13015
+ </xsl:when>
13016
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
13017
+ </xsl:choose>
13018
+ </xsl:template>
13019
+
13020
+ <xsl:template name="getImageSrcExternal">
13021
+ <xsl:choose>
13022
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
13023
+ <xsl:value-of select="@src"/>
13024
+ </xsl:when>
13025
+ <xsl:otherwise>
13026
+ <xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
13027
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
12911
13028
  <xsl:choose>
12912
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12913
- <xsl:value-of select="@src"/>
13029
+ <xsl:when test="$file_exists = 'true'">
13030
+ <xsl:value-of select="$src_with_basepath"/>
12914
13031
  </xsl:when>
12915
13032
  <xsl:otherwise>
12916
- <xsl:value-of select="concat($basepath, @src)"/>
13033
+ <xsl:value-of select="@src"/>
12917
13034
  </xsl:otherwise>
12918
13035
  </xsl:choose>
12919
- </xsl:when>
12920
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
13036
+ </xsl:otherwise>
12921
13037
  </xsl:choose>
12922
13038
  </xsl:template>
12923
13039
 
@@ -12965,14 +13081,8 @@
12965
13081
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
12966
13082
  </xsl:when>
12967
13083
  <xsl:when test="not(starts-with(@src, 'data:'))">
12968
- <xsl:choose>
12969
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12970
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
12971
- </xsl:when>
12972
- <xsl:otherwise>
12973
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
12974
- </xsl:otherwise>
12975
- </xsl:choose>
13084
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
13085
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
12976
13086
  </xsl:when>
12977
13087
  <xsl:otherwise>
12978
13088
  <xsl:value-of select="@src"/>
@@ -12993,16 +13103,8 @@
12993
13103
  </svg>
12994
13104
  </xsl:when>
12995
13105
  <xsl:when test="not(starts-with(@src, 'data:'))">
12996
- <xsl:variable name="src">
12997
- <xsl:choose>
12998
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12999
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
13000
- </xsl:when>
13001
- <xsl:otherwise>
13002
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
13003
- </xsl:otherwise>
13004
- </xsl:choose>
13005
- </xsl:variable>
13106
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
13107
+ <xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
13006
13108
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
13007
13109
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
13008
13110
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
@@ -17195,7 +17297,9 @@
17195
17297
  <xsl:template name="add_id">
17196
17298
  <xsl:if test="not(@id)">
17197
17299
  <!-- add @id - first element with @id plus '_element_name' -->
17198
- <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
17300
+ <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
17301
+ <xsl:variable name="prefix_id"><xsl:value-of select="$prefix_id_"/><xsl:if test="normalize-space($prefix_id_) = ''"><xsl:value-of select="generate-id()"/></xsl:if></xsl:variable>
17302
+ <xsl:attribute name="id"><xsl:value-of select="$prefix_id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
17199
17303
  </xsl:if>
17200
17304
  </xsl:template>
17201
17305
 
@@ -18254,7 +18358,14 @@
18254
18358
  <xsl:variable name="title">
18255
18359
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
18256
18360
 
18257
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
18361
+ <xsl:choose>
18362
+ <xsl:when test="*[local-name() = 'title'][@language = $lang and @type = 'main']">
18363
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
18364
+ </xsl:when>
18365
+ <xsl:otherwise>
18366
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'title-main']"/>
18367
+ </xsl:otherwise>
18368
+ </xsl:choose>
18258
18369
 
18259
18370
  </xsl:for-each>
18260
18371
  </xsl:variable>
@@ -18627,6 +18738,7 @@
18627
18738
  <xsl:param name="formatted">false</xsl:param>
18628
18739
  <xsl:param name="lang"/>
18629
18740
  <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
18741
+ <xsl:param name="bibdata_updated"/>
18630
18742
 
18631
18743
  <xsl:variable name="curr_lang">
18632
18744
  <xsl:choose>
@@ -18640,6 +18752,9 @@
18640
18752
 
18641
18753
  <xsl:variable name="data_value">
18642
18754
  <xsl:choose>
18755
+ <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
18756
+ <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
18757
+ </xsl:when>
18643
18758
  <xsl:when test="$formatted = 'true'">
18644
18759
  <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
18645
18760
  </xsl:when>
@@ -18811,14 +18926,8 @@
18811
18926
  <xsl:value-of select="$src"/>
18812
18927
  </xsl:when>
18813
18928
  <xsl:otherwise>
18814
- <xsl:choose>
18815
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
18816
- <xsl:value-of select="concat('url(file:///', @src, ')')"/>
18817
- </xsl:when>
18818
- <xsl:otherwise>
18819
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
18820
- </xsl:otherwise>
18821
- </xsl:choose>
18929
+ <xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
18930
+ <xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
18822
18931
  </xsl:otherwise>
18823
18932
  </xsl:choose>
18824
18933
  </xsl:template>
@@ -18840,15 +18949,23 @@
18840
18949
  <!-- END: insert cover page image -->
18841
18950
 
18842
18951
  <!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
18952
+ <xsl:variable name="regex_ja_spec_half_width_">
18953
+ \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
18954
+ \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
18955
+ \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
18956
+ \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
18957
+ \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
18958
+ \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
18959
+ \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
18960
+ \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
18961
+ </xsl:variable>
18962
+ <xsl:variable name="regex_ja_spec_half_width" select="translate(normalize-space($regex_ja_spec_half_width_), ' ', '')"/>
18843
18963
  <xsl:variable name="regex_ja_spec_">[
18844
18964
  <!-- Rotate 90° clockwise -->
18845
- \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
18965
+ <xsl:value-of select="$regex_ja_spec_half_width"/>
18846
18966
  \uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
18847
- \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
18848
18967
  \uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
18849
- \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
18850
18968
  \uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
18851
- \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
18852
18969
  \uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
18853
18970
  \u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
18854
18971
  \u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
@@ -18856,21 +18973,16 @@
18856
18973
  \u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
18857
18974
  \u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
18858
18975
  \u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
18859
- \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
18860
18976
  \u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
18861
- \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
18862
18977
  \u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
18863
18978
  \u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
18864
18979
  \u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
18865
- \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
18866
18980
  \uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
18867
- \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
18868
18981
  \uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
18869
18982
  \u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
18870
18983
  \u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
18871
18984
  \u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
18872
18985
  \u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
18873
-
18874
18986
  \u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
18875
18987
  \u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
18876
18988
  \u301C <!-- U+301C WAVE DASH (〜) -->
@@ -18902,6 +19014,7 @@
18902
19014
  <xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
18903
19015
  <xsl:template name="insertVerticalChar">
18904
19016
  <xsl:param name="str"/>
19017
+ <xsl:param name="char_prev"/>
18905
19018
  <xsl:param name="writing-mode">lr-tb</xsl:param>
18906
19019
  <xsl:param name="reference-orientation">90</xsl:param>
18907
19020
  <xsl:param name="add_zero_width_space">false</xsl:param>
@@ -18911,53 +19024,99 @@
18911
19024
  </xsl:when>
18912
19025
  <xsl:otherwise>
18913
19026
  <xsl:if test="string-length($str) &gt; 0">
18914
- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
19027
+
19028
+ <!-- <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/> -->
18915
19029
  <xsl:variable name="char" select="substring($str,1,1)"/>
18916
- <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
18917
- <xsl:if test="normalize-space($writing-mode) != ''">
18918
- <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
18919
- <xsl:attribute name="reference-orientation">90</xsl:attribute>
18920
- </xsl:if>
18921
- <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
18922
- <xsl:attribute name="reference-orientation">0</xsl:attribute>
18923
- </xsl:if>
18924
- <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
18925
- <!-- Rotate 180°:
18926
- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
18927
- U+3002 IDEOGRAPHIC FULL STOP (。)
18928
- U+FE52 SMALL FULL STOP (﹒)
18929
- U+FF0E FULLWIDTH FULL STOP ()
18930
- -->
18931
- <xsl:attribute name="reference-orientation">-90</xsl:attribute>
18932
- </xsl:if>
18933
- <fo:block-container width="1em">
18934
- <fo:block line-height="1em">
18935
- <xsl:choose>
18936
- <xsl:when test="$horizontal_mode = 'true'">
18937
- <xsl:value-of select="$str"/>
18938
- </xsl:when>
18939
- <xsl:otherwise>
19030
+ <xsl:variable name="char_next" select="substring($str,2,1)"/>
19031
+
19032
+ <xsl:variable name="char_half_width" select="normalize-space(java:matches(java:java.lang.String.new($char), concat('([', $regex_ja_spec_half_width, ']{1,})')))"/>
19033
+
19034
+ <xsl:choose>
19035
+ <xsl:when test="$char_half_width = 'true'">
19036
+ <fo:inline>
19037
+ <xsl:attribute name="baseline-shift">7%</xsl:attribute>
19038
+ <xsl:value-of select="$char"/>
19039
+ </fo:inline>
19040
+ </xsl:when>
19041
+ <xsl:otherwise>
19042
+ <!-- namespace-uri(ancestor::*[local-name() = 'title']) != '' to skip title from $contents -->
19043
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_prev = '' and ../preceding-sibling::node())">
19044
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
19045
+ </xsl:if>
19046
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm" role="SKIP" text-align-last="center">
19047
+ <xsl:if test="normalize-space($writing-mode) != ''">
19048
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
19049
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
19050
+ </xsl:if>
19051
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
19052
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
19053
+ </xsl:if>
19054
+ <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
19055
+ <!-- Rotate 180°:
19056
+ U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
19057
+ U+3002 IDEOGRAPHIC FULL STOP (。)
19058
+ U+FE52 SMALL FULL STOP (﹒)
19059
+ U+FF0E FULLWIDTH FULL STOP (.)
19060
+ -->
19061
+ <xsl:attribute name="reference-orientation">-90</xsl:attribute>
19062
+ </xsl:if>
19063
+ <fo:block-container width="1em" role="SKIP"><!-- border="0.5pt solid blue" -->
19064
+ <fo:block line-height="1em" role="SKIP">
19065
+ <!-- <xsl:choose>
19066
+ <xsl:when test="$horizontal_mode = 'true'">
19067
+ <xsl:value-of select="$str"/>
19068
+ </xsl:when>
19069
+ <xsl:otherwise>
19070
+ <xsl:value-of select="$char"/>
19071
+ </xsl:otherwise>
19072
+ </xsl:choose> -->
18940
19073
  <xsl:value-of select="$char"/>
18941
- </xsl:otherwise>
18942
- </xsl:choose>
18943
- </fo:block>
18944
- </fo:block-container>
18945
- </fo:inline-container>
18946
- <xsl:if test="$add_zero_width_space = 'true' and ($char = ',' or $char = '.' or $char = ' ' or $char = '·' or $char = ')' or $char = ']' or $char = '}')"><xsl:value-of select="$zero_width_space"/></xsl:if>
18947
-
18948
- <xsl:if test="$horizontal_mode = 'false'">
18949
- <xsl:call-template name="insertVerticalChar">
18950
- <xsl:with-param name="str" select="substring($str, 2)"/>
18951
- <xsl:with-param name="writing-mode" select="$writing-mode"/>
18952
- <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
18953
- <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
18954
- </xsl:call-template>
18955
- </xsl:if>
19074
+ </fo:block>
19075
+ </fo:block-container>
19076
+ </fo:inline-container>
19077
+ <xsl:if test="namespace-uri(ancestor::*[local-name() = 'title']) != '' and ($char_next != '' or ../following-sibling::node())">
19078
+ <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
19079
+ </xsl:if>
19080
+ </xsl:otherwise>
19081
+ </xsl:choose>
19082
+
19083
+ <xsl:if test="$add_zero_width_space = 'true' and ($char = ',' or $char = '.' or $char = ' ' or $char = '·' or $char = ')' or $char = ']' or $char = '}' or $char = '/')"><xsl:value-of select="$zero_width_space"/></xsl:if>
19084
+ <!-- <xsl:if test="$horizontal_mode = 'false'"> -->
19085
+ <xsl:call-template name="insertVerticalChar">
19086
+ <xsl:with-param name="str" select="substring($str, 2)"/>
19087
+ <xsl:with-param name="char_prev" select="$char"/>
19088
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
19089
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
19090
+ <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
19091
+ </xsl:call-template>
19092
+ <!-- </xsl:if> -->
18956
19093
  </xsl:if>
18957
19094
  </xsl:otherwise>
18958
19095
  </xsl:choose>
18959
19096
  </xsl:template>
18960
19097
 
19098
+ <xsl:template name="insertHorizontalChars">
19099
+ <xsl:param name="str"/>
19100
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
19101
+ <xsl:param name="reference-orientation">90</xsl:param>
19102
+ <xsl:param name="add_zero_width_space">false</xsl:param>
19103
+ <xsl:choose>
19104
+ <xsl:otherwise>
19105
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm" role="SKIP">
19106
+ <xsl:if test="normalize-space($writing-mode) != ''">
19107
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
19108
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
19109
+ </xsl:if>
19110
+ <fo:block-container width="1em" role="SKIP"> <!-- border="0.5pt solid green" -->
19111
+ <fo:block line-height="1em" role="SKIP">
19112
+ <xsl:value-of select="$str"/>
19113
+ </fo:block>
19114
+ </fo:block-container>
19115
+ </fo:inline-container>
19116
+ </xsl:otherwise>
19117
+ </xsl:choose>
19118
+ </xsl:template>
19119
+
18961
19120
  <xsl:template name="number-to-words">
18962
19121
  <xsl:param name="number"/>
18963
19122
  <xsl:param name="first"/>