metanorma-jis 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/jis/base_convert.rb +5 -4
- data/lib/isodoc/jis/figure.rb +1 -1
- data/lib/isodoc/jis/html/isodoc.css +1 -1
- data/lib/isodoc/jis/html/isodoc.scss +1 -1
- data/lib/isodoc/jis/init.rb +10 -2
- data/lib/isodoc/jis/jis.international-standard.xsl +1069 -322
- data/lib/isodoc/jis/presentation_section.rb +2 -1
- data/lib/isodoc/jis/presentation_xml_convert.rb +6 -4
- data/lib/isodoc/jis/table.rb +1 -1
- data/lib/isodoc/jis/word_convert.rb +6 -6
- data/lib/isodoc/jis/xref.rb +72 -34
- data/lib/metanorma/jis/isodoc.rng +1 -1
- data/lib/metanorma/jis/version.rb +1 -1
- data/lib/relaton/render-jis/general.rb +1 -1
- data/metanorma-jis.gemspec +1 -1
- metadata +4 -4
@@ -94,12 +94,12 @@
|
|
94
94
|
</fo:simple-page-master>
|
95
95
|
|
96
96
|
<fo:simple-page-master master-name="first_page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
97
|
-
<xsl:if test="$vertical_layout = 'true'">
|
97
|
+
<xsl:if test="$vertical_layout = 'true' and $isGenerateTableIF = 'false'">
|
98
98
|
<xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
|
99
99
|
<xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
|
100
100
|
</xsl:if>
|
101
101
|
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm">
|
102
|
-
<xsl:if test="$vertical_layout = 'true'">
|
102
|
+
<xsl:if test="$vertical_layout = 'true' and $isGenerateTableIF = 'false'">
|
103
103
|
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
|
104
104
|
</xsl:if>
|
105
105
|
</fo:region-body>
|
@@ -109,12 +109,12 @@
|
|
109
109
|
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
110
110
|
</fo:simple-page-master>
|
111
111
|
<fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
112
|
-
<xsl:if test="$vertical_layout = 'true'">
|
112
|
+
<xsl:if test="$vertical_layout = 'true' and $isGenerateTableIF = 'false'">
|
113
113
|
<xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
|
114
114
|
<xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
|
115
115
|
</xsl:if>
|
116
116
|
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm">
|
117
|
-
<xsl:if test="$vertical_layout = 'true'">
|
117
|
+
<xsl:if test="$vertical_layout = 'true' and $isGenerateTableIF = 'false'">
|
118
118
|
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
|
119
119
|
</xsl:if>
|
120
120
|
</fo:region-body>
|
@@ -124,12 +124,12 @@
|
|
124
124
|
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
125
125
|
</fo:simple-page-master>
|
126
126
|
<fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
127
|
-
<xsl:if test="$vertical_layout = 'true'">
|
127
|
+
<xsl:if test="$vertical_layout = 'true' and $isGenerateTableIF = 'false'">
|
128
128
|
<xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
|
129
129
|
<xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
|
130
130
|
</xsl:if>
|
131
131
|
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm">
|
132
|
-
<xsl:if test="$vertical_layout = 'true'">
|
132
|
+
<xsl:if test="$vertical_layout = 'true' and $isGenerateTableIF = 'false'">
|
133
133
|
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
|
134
134
|
</xsl:if>
|
135
135
|
</fo:region-body>
|
@@ -145,7 +145,7 @@
|
|
145
145
|
<xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
|
146
146
|
</xsl:if>
|
147
147
|
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm">
|
148
|
-
<xsl:if test="$vertical_layout = 'true'">
|
148
|
+
<xsl:if test="$vertical_layout = 'true' and $isGenerateTableIF = 'false'">
|
149
149
|
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
|
150
150
|
</xsl:if>
|
151
151
|
</fo:region-body>
|
@@ -225,7 +225,11 @@
|
|
225
225
|
fo:region-body/margin-right = top margin
|
226
226
|
-->
|
227
227
|
<!-- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2 + 40}mm" writing-mode="tb-rl" background-color="rgb(240,240,240)"/> -->
|
228
|
-
<fo:region-body margin-top="{$marginLeftRight1}mm" margin-bottom="{$marginLeftRight2}mm" margin-left="{$marginBottom}mm" margin-right="{$marginTop}mm"
|
228
|
+
<fo:region-body margin-top="{$marginLeftRight1}mm" margin-bottom="{$marginLeftRight2}mm" margin-left="{$marginBottom}mm" margin-right="{$marginTop}mm"> <!-- background-color="rgb(240,240,240)" -->
|
229
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
230
|
+
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
|
231
|
+
</xsl:if>
|
232
|
+
</fo:region-body>
|
229
233
|
<fo:region-before region-name="header" extent="{$marginTop}mm"/> <!-- background-color="yellow" -->
|
230
234
|
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/> <!-- background-color="green" -->
|
231
235
|
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/> <!-- background-color="blue" -->
|
@@ -240,7 +244,11 @@
|
|
240
244
|
fo:region-body/margin-right = top margin
|
241
245
|
-->
|
242
246
|
<!-- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2 + 40}mm" writing-mode="tb-rl" background-color="rgb(240,240,240)"/> -->
|
243
|
-
<fo:region-body margin-top="{$marginLeftRight1}mm" margin-bottom="{$marginLeftRight2}mm" margin-left="{$marginBottom}mm" margin-right="{$marginTop}mm"
|
247
|
+
<fo:region-body margin-top="{$marginLeftRight1}mm" margin-bottom="{$marginLeftRight2}mm" margin-left="{$marginBottom}mm" margin-right="{$marginTop}mm"> <!-- background-color="rgb(240,240,240)" -->
|
248
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
249
|
+
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
|
250
|
+
</xsl:if>
|
251
|
+
</fo:region-body>
|
244
252
|
<fo:region-before region-name="header" extent="{$marginTop}mm"/> <!-- background-color="yellow" -->
|
245
253
|
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/> <!-- background-color="green" -->
|
246
254
|
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/> <!-- background-color="blue" -->
|
@@ -254,8 +262,16 @@
|
|
254
262
|
fo:region-body/margin-right = top margin
|
255
263
|
-->
|
256
264
|
<!-- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2 + 40}mm" writing-mode="tb-rl" background-color="rgb(240,240,240)"/> -->
|
257
|
-
<fo:region-body margin-top="194mm" margin-bottom="{$marginLeftRight2}mm" margin-left="{$marginBottom}mm" margin-right="{$marginTop}mm"
|
258
|
-
|
265
|
+
<fo:region-body margin-top="194mm" margin-bottom="{$marginLeftRight2}mm" margin-left="{$marginBottom}mm" margin-right="{$marginTop}mm"> <!-- background-color="rgb(240,240,240)" -->
|
266
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
267
|
+
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
|
268
|
+
</xsl:if>
|
269
|
+
</fo:region-body>
|
270
|
+
<fo:region-before region-name="header-last" extent="{$marginTop}mm"> <!-- background-color="yellow" -->
|
271
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
272
|
+
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
|
273
|
+
</xsl:if>
|
274
|
+
</fo:region-before>
|
259
275
|
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/> <!-- background-color="green" -->
|
260
276
|
<!-- for boilerplate:
|
261
277
|
reserve paper space in left-region, but text will render in the header
|
@@ -272,12 +288,12 @@
|
|
272
288
|
</fo:page-sequence-master>
|
273
289
|
|
274
290
|
<fo:simple-page-master master-name="commentary_first_page_even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
275
|
-
<xsl:if test="$vertical_layout = 'true'">
|
291
|
+
<xsl:if test="$vertical_layout = 'true' and $isGenerateTableIF = 'false'">
|
276
292
|
<xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
|
277
293
|
<xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
|
278
294
|
</xsl:if>
|
279
295
|
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm">
|
280
|
-
<xsl:if test="$vertical_layout = 'true'">
|
296
|
+
<xsl:if test="$vertical_layout = 'true' and $isGenerateTableIF = 'false'">
|
281
297
|
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
|
282
298
|
</xsl:if>
|
283
299
|
</fo:region-body>
|
@@ -288,12 +304,12 @@
|
|
288
304
|
</fo:simple-page-master>
|
289
305
|
|
290
306
|
<fo:simple-page-master master-name="commentary_first_page_odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
291
|
-
<xsl:if test="$vertical_layout = 'true'">
|
307
|
+
<xsl:if test="$vertical_layout = 'true' and $isGenerateTableIF = 'false'">
|
292
308
|
<xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
|
293
309
|
<xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
|
294
310
|
</xsl:if>
|
295
311
|
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm">
|
296
|
-
<xsl:if test="$vertical_layout = 'true'">
|
312
|
+
<xsl:if test="$vertical_layout = 'true' and $isGenerateTableIF = 'false'">
|
297
313
|
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
|
298
314
|
</xsl:if>
|
299
315
|
</fo:region-body>
|
@@ -357,15 +373,41 @@
|
|
357
373
|
<xsl:with-param name="contents" select="$contents"/>
|
358
374
|
</xsl:call-template>
|
359
375
|
|
376
|
+
<xsl:if test="$debug = 'true'">
|
377
|
+
<redirect:write file="contents_.xml">
|
378
|
+
<xsl:copy-of select="$contents"/>
|
379
|
+
</redirect:write>
|
380
|
+
</xsl:if>
|
381
|
+
|
382
|
+
<xsl:variable name="updated_xml_step0">
|
383
|
+
<xsl:if test="$vertical_layout = 'true'">
|
384
|
+
<xsl:apply-templates mode="update_xml_step0"/>
|
385
|
+
</xsl:if>
|
386
|
+
</xsl:variable>
|
387
|
+
<xsl:if test="$debug = 'true'">
|
388
|
+
<redirect:write file="update_xml_step0.xml">
|
389
|
+
<xsl:copy-of select="$updated_xml_step0"/>
|
390
|
+
</redirect:write>
|
391
|
+
</xsl:if>
|
392
|
+
|
360
393
|
<xsl:variable name="updated_xml_step1">
|
361
|
-
<xsl:
|
394
|
+
<xsl:choose>
|
395
|
+
<xsl:when test="$vertical_layout = 'true'">
|
396
|
+
<xsl:apply-templates select="xalan:nodeset($updated_xml_step0)" mode="update_xml_step1"/>
|
397
|
+
</xsl:when>
|
398
|
+
<xsl:otherwise>
|
399
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
400
|
+
</xsl:otherwise>
|
401
|
+
</xsl:choose>
|
362
402
|
</xsl:variable>
|
363
403
|
<!-- DEBUG: updated_xml_step1=<xsl:copy-of select="$updated_xml_step1"/> -->
|
364
|
-
|
365
|
-
|
366
|
-
<
|
367
|
-
|
368
|
-
|
404
|
+
<xsl:if test="$debug = 'true'">
|
405
|
+
<xsl:message>start redirect</xsl:message>
|
406
|
+
<redirect:write file="update_xml_step1.xml">
|
407
|
+
<xsl:copy-of select="$updated_xml_step1"/>
|
408
|
+
</redirect:write>
|
409
|
+
<xsl:message>end redirect</xsl:message>
|
410
|
+
</xsl:if>
|
369
411
|
|
370
412
|
<xsl:variable name="updated_xml_step2_">
|
371
413
|
<xsl:apply-templates select="xalan:nodeset($updated_xml_step1)" mode="update_xml_step2"/>
|
@@ -467,7 +509,7 @@
|
|
467
509
|
|
468
510
|
<xsl:if test="$vertical_layout = 'true'">
|
469
511
|
<xsl:attribute name="master-reference">document_toc_2024</xsl:attribute>
|
470
|
-
<xsl:attribute name="format"
|
512
|
+
<xsl:attribute name="format">一</xsl:attribute>
|
471
513
|
</xsl:if>
|
472
514
|
|
473
515
|
<xsl:if test="position() = 1">
|
@@ -540,7 +582,7 @@
|
|
540
582
|
|
541
583
|
<xsl:if test="$vertical_layout = 'true'">
|
542
584
|
<xsl:attribute name="master-reference">document_2024</xsl:attribute>
|
543
|
-
<xsl:attribute name="format"
|
585
|
+
<xsl:attribute name="format">一</xsl:attribute>
|
544
586
|
</xsl:if>
|
545
587
|
|
546
588
|
<xsl:if test="position() = 1">
|
@@ -660,6 +702,12 @@
|
|
660
702
|
|
661
703
|
</xsl:variable>
|
662
704
|
|
705
|
+
<!-- <xsl:if test="$debug = 'true'">
|
706
|
+
<redirect:write file="structured_xml_.xml">
|
707
|
+
<xsl:copy-of select="$structured_xml_"/>
|
708
|
+
</redirect:write>
|
709
|
+
</xsl:if> -->
|
710
|
+
|
663
711
|
<!-- page break before each section -->
|
664
712
|
<xsl:variable name="structured_xml">
|
665
713
|
<xsl:for-each select="xalan:nodeset($structured_xml_)/item[*]">
|
@@ -694,7 +742,7 @@
|
|
694
742
|
<xsl:attribute name="master-reference">document_2024_with_last</xsl:attribute>
|
695
743
|
</xsl:if>
|
696
744
|
|
697
|
-
<xsl:attribute name="format"
|
745
|
+
<xsl:attribute name="format">一</xsl:attribute>
|
698
746
|
<!-- <xsl:attribute name="fox:number-conversion-features">ア</xsl:attribute> -->
|
699
747
|
</xsl:when>
|
700
748
|
<xsl:otherwise>
|
@@ -1503,11 +1551,11 @@
|
|
1503
1551
|
<!-- ============================= -->
|
1504
1552
|
|
1505
1553
|
<!-- element with title -->
|
1506
|
-
<xsl:template match="*[jis:title]" mode="contents">
|
1554
|
+
<xsl:template match="*[jis:title or jis:fmt-title]" mode="contents">
|
1507
1555
|
|
1508
1556
|
<xsl:variable name="level">
|
1509
1557
|
<xsl:call-template name="getLevel">
|
1510
|
-
<xsl:with-param name="depth" select="jis:title/@depth"/>
|
1558
|
+
<xsl:with-param name="depth" select="jis:fmt-title/@depth | jis:title/@depth"/>
|
1511
1559
|
</xsl:call-template>
|
1512
1560
|
</xsl:variable>
|
1513
1561
|
|
@@ -1904,7 +1952,7 @@
|
|
1904
1952
|
|
1905
1953
|
<xsl:template match="jis:termnote" priority="2">
|
1906
1954
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
1907
|
-
<fo:list-block provisional-distance-between-starts="{
|
1955
|
+
<fo:list-block provisional-distance-between-starts="{18 + $text_indent}mm">
|
1908
1956
|
<fo:list-item>
|
1909
1957
|
<fo:list-item-label start-indent="{$text_indent}mm" end-indent="label-end()">
|
1910
1958
|
<fo:block xsl:use-attribute-sets="note-name-style">
|
@@ -1948,6 +1996,12 @@
|
|
1948
1996
|
<fo:inline font-weight="normal">)</fo:inline>
|
1949
1997
|
<xsl:value-of select="substring-after($list_item_label,')')"/>
|
1950
1998
|
</xsl:when>
|
1999
|
+
<xsl:when test="$vertical_layout = 'true' and ../@type = 'alphabet'">
|
2000
|
+
<xsl:call-template name="insertVerticalChar">
|
2001
|
+
<xsl:with-param name="str" select="substring-before($list_item_label,')')"/>
|
2002
|
+
</xsl:call-template>
|
2003
|
+
<fo:inline font-weight="normal">)</fo:inline>
|
2004
|
+
</xsl:when>
|
1951
2005
|
<xsl:when test="contains($list_item_label, ')')">
|
1952
2006
|
<xsl:value-of select="substring-before($list_item_label,')')"/>
|
1953
2007
|
<fo:inline font-weight="normal">)</fo:inline>
|
@@ -2034,6 +2088,190 @@
|
|
2034
2088
|
</fo:block-container>
|
2035
2089
|
</xsl:template>
|
2036
2090
|
|
2091
|
+
<!-- =========================================================================== -->
|
2092
|
+
<!-- STEP 0: Replace characters with vertical form -->
|
2093
|
+
<!-- =========================================================================== -->
|
2094
|
+
<xsl:template match="@*|node()" mode="update_xml_step0">
|
2095
|
+
<xsl:copy>
|
2096
|
+
<xsl:apply-templates select="@*|node()" mode="update_xml_step0"/>
|
2097
|
+
</xsl:copy>
|
2098
|
+
</xsl:template>
|
2099
|
+
|
2100
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']" mode="update_xml_step0">
|
2101
|
+
<xsl:copy-of select="."/>
|
2102
|
+
</xsl:template>
|
2103
|
+
|
2104
|
+
<xsl:template match="text()" mode="SKIP_update_xml_step0">
|
2105
|
+
<!-- from https://github.com/metanorma/docs/blob/main/109.adoc -->
|
2106
|
+
<!--
|
2107
|
+
U+0028 LEFT PARENTHESIS (()
|
2108
|
+
U+FF08 FULLWIDTH LEFT PARENTHESIS (()
|
2109
|
+
to
|
2110
|
+
U+FE35 PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS (︵)
|
2111
|
+
|
2112
|
+
U+0029 RIGHT PARENTHESIS ())
|
2113
|
+
U+FF09 FULLWIDTH RIGHT PARENTHESIS ())
|
2114
|
+
to
|
2115
|
+
U+FE36 PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS (︶)
|
2116
|
+
-->
|
2117
|
+
<xsl:variable name="text1" select="translate(.,'(())','︵︵︶︶')"/>
|
2118
|
+
<!--
|
2119
|
+
U+007B LEFT CURLY BRACKET ({)
|
2120
|
+
U+FF5B FULLWIDTH LEFT CURLY BRACKET ({)
|
2121
|
+
to
|
2122
|
+
U+FE37 PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET (︷)
|
2123
|
+
|
2124
|
+
U+007D RIGHT CURLY BRACKET (})
|
2125
|
+
U+FF5D FULLWIDTH RIGHT CURLY BRACKET (})
|
2126
|
+
to
|
2127
|
+
U+FE38 PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET (︸)
|
2128
|
+
-->
|
2129
|
+
<xsl:variable name="text2" select="translate($text1,'{{}}','︷︷︸︸')"/>
|
2130
|
+
|
2131
|
+
<!--
|
2132
|
+
U+3014 LEFT TORTOISE SHELL BRACKET (〔)
|
2133
|
+
to
|
2134
|
+
U+FE39 PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET (︹)
|
2135
|
+
|
2136
|
+
U+3015 RIGHT TORTOISE SHELL BRACKET (〕)
|
2137
|
+
to
|
2138
|
+
U+FE3A PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET (︺)
|
2139
|
+
-->
|
2140
|
+
<xsl:variable name="text3" select="translate($text2,'〔〕','︹︺')"/>
|
2141
|
+
|
2142
|
+
<!--
|
2143
|
+
U+3010 LEFT BLACK LENTICULAR BRACKET (【)
|
2144
|
+
to
|
2145
|
+
U+FE3B PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET (︻)
|
2146
|
+
|
2147
|
+
U+3011 RIGHT BLACK LENTICULAR BRACKET (】)
|
2148
|
+
to
|
2149
|
+
U+FE3C PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET (︼)
|
2150
|
+
-->
|
2151
|
+
<xsl:variable name="text4" select="translate($text3,'【】','︻︼')"/>
|
2152
|
+
|
2153
|
+
<!--
|
2154
|
+
U+300A LEFT DOUBLE ANGLE BRACKET (《)
|
2155
|
+
to
|
2156
|
+
U+FE3D PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET (︽)
|
2157
|
+
|
2158
|
+
U+300B RIGHT DOUBLE ANGLE BRACKET (》)
|
2159
|
+
to
|
2160
|
+
U+FE3E PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET (︾)
|
2161
|
+
-->
|
2162
|
+
<xsl:variable name="text5" select="translate($text4,'《》','︽︾')"/>
|
2163
|
+
|
2164
|
+
<!--
|
2165
|
+
U+FF62 HALFWIDTH LEFT CORNER BRACKET (「)
|
2166
|
+
U+300C LEFT CORNER BRACKET (「)
|
2167
|
+
to
|
2168
|
+
U+FE41 PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET (﹁)
|
2169
|
+
|
2170
|
+
U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」)
|
2171
|
+
U+300D RIGHT CORNER BRACKET (」)
|
2172
|
+
to
|
2173
|
+
U+FE42 PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET (﹂)
|
2174
|
+
-->
|
2175
|
+
<xsl:variable name="text6" select="translate($text5,'「「」」','﹁﹁﹂﹂')"/>
|
2176
|
+
|
2177
|
+
<!--
|
2178
|
+
U+300E LEFT WHITE CORNER BRACKET (『)
|
2179
|
+
to
|
2180
|
+
U+FE43 PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET (﹃)
|
2181
|
+
|
2182
|
+
U+300F RIGHT WHITE CORNER BRACKET (』)
|
2183
|
+
to
|
2184
|
+
U+FE44 PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET (﹄)
|
2185
|
+
-->
|
2186
|
+
<xsl:variable name="text7" select="translate($text6,'『』','﹃﹄')"/>
|
2187
|
+
|
2188
|
+
<!--
|
2189
|
+
U+005B LEFT SQUARE BRACKET ([)
|
2190
|
+
U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([)
|
2191
|
+
to
|
2192
|
+
U+FE47 PRESENTATION FORM FOR VERTICAL LEFT SQUARE BRACKET (﹇)
|
2193
|
+
|
2194
|
+
U+005D RIGHT SQUARE BRACKET (])
|
2195
|
+
U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (])
|
2196
|
+
to
|
2197
|
+
U+FE48 PRESENTATION FORM FOR VERTICAL RIGHT SQUARE BRACKET (﹈)
|
2198
|
+
-->
|
2199
|
+
<xsl:variable name="text8" select="translate($text7,'[[]]','﹇﹇﹈﹈')"/>
|
2200
|
+
|
2201
|
+
<!--
|
2202
|
+
U+3008 LEFT ANGLE BRACKET (〈)
|
2203
|
+
to
|
2204
|
+
U+FE3F PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET (︿)
|
2205
|
+
|
2206
|
+
U+3009 RIGHT ANGLE BRACKET (〉)
|
2207
|
+
to
|
2208
|
+
U+FE40 PRESENTATION FORM FOR VERTICAL RIGHT ANGLE BRACKET (﹀)
|
2209
|
+
-->
|
2210
|
+
<xsl:variable name="text9" select="translate($text8,'〈〉','︿﹀')"/>
|
2211
|
+
|
2212
|
+
<!--
|
2213
|
+
U+3016 LEFT WHITE LENTICULAR BRACKET (〖)
|
2214
|
+
to
|
2215
|
+
U+FE17 PRESENTATION FORM FOR VERTICAL LEFT WHITE LENTICULAR BRACKET (︗)
|
2216
|
+
|
2217
|
+
U+3017 RIGHT WHITE LENTICULAR BRACKET (〗)
|
2218
|
+
to
|
2219
|
+
U+FE18 PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRACKET (︘)
|
2220
|
+
-->
|
2221
|
+
<xsl:variable name="text10" select="translate($text9,'〖〗','︗︘')"/>
|
2222
|
+
|
2223
|
+
<xsl:value-of select="$text10"/>
|
2224
|
+
</xsl:template>
|
2225
|
+
|
2226
|
+
<xsl:template match="text()" mode="update_xml_step0">
|
2227
|
+
<!-- from https://github.com/metanorma/docs/blob/main/109.adoc -->
|
2228
|
+
<!--
|
2229
|
+
U+3001 IDEOGRAPHIC COMMA (、)
|
2230
|
+
to
|
2231
|
+
U+FE11 PRESENTATION FORM FOR VERTICAL IDEOGRAPHIC COMMA (︑)
|
2232
|
+
|
2233
|
+
U+FE50 SMALL COMMA (﹐)
|
2234
|
+
to
|
2235
|
+
U+FE10 PRESENTATION FORM FOR VERTICAL COMMA (︐)
|
2236
|
+
|
2237
|
+
U+FE51 SMALL IDEOGRAPHIC COMMA (﹑)
|
2238
|
+
to
|
2239
|
+
U+FE11 PRESENTATION FORM FOR VERTICAL IDEOGRAPHIC COMMA (︑)
|
2240
|
+
|
2241
|
+
U+FF0C FULLWIDTH COMMA (,)
|
2242
|
+
to
|
2243
|
+
U+FE10 PRESENTATION FORM FOR VERTICAL COMMA (︐)
|
2244
|
+
-->
|
2245
|
+
<xsl:variable name="text1" select="translate(.,'、﹐﹑,','︑︐︑︐')"/>
|
2246
|
+
|
2247
|
+
<!--
|
2248
|
+
U+FF1A FULLWIDTH COLON (:)
|
2249
|
+
to
|
2250
|
+
U+FE13 PRESENTATION FORM FOR VERTICAL COLON (︓)
|
2251
|
+
|
2252
|
+
U+FF1B FULLWIDTH SEMICOLON (;)
|
2253
|
+
to
|
2254
|
+
U+FE14 PRESENTATION FORM FOR VERTICAL SEMICOLON (︔)
|
2255
|
+
-->
|
2256
|
+
<xsl:variable name="text2" select="translate($text1,':;','︓︔')"/>
|
2257
|
+
|
2258
|
+
<!--
|
2259
|
+
U+FF01 FULLWIDTH EXCLAMATION MARK (!)
|
2260
|
+
to
|
2261
|
+
U+FE15 PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK (︕)
|
2262
|
+
|
2263
|
+
U+FF1F FULLWIDTH QUESTION MARK (?)
|
2264
|
+
to
|
2265
|
+
U+FE16 PRESENTATION FORM FOR VERTICAL QUESTION MARK (︖)
|
2266
|
+
-->
|
2267
|
+
<xsl:variable name="text3" select="translate($text2,'!?','︕︖')"/>
|
2268
|
+
<xsl:value-of select="$text3"/>
|
2269
|
+
</xsl:template>
|
2270
|
+
|
2271
|
+
<!-- =========================================================================== -->
|
2272
|
+
<!-- END STEP 0: Replace characters with vertical form -->
|
2273
|
+
<!-- =========================================================================== -->
|
2274
|
+
|
2037
2275
|
<xsl:template match="*[local-name() = 'span'][@class = 'surname' or @class = 'givenname' or @class = 'JIS' or @class = 'EffectiveYear' or @class = 'CommentaryEffectiveYear']" mode="update_xml_step1" priority="2">
|
2038
2276
|
<xsl:copy>
|
2039
2277
|
<xsl:apply-templates select="@* | node()" mode="update_xml_step1"/>
|
@@ -2120,7 +2358,9 @@
|
|
2120
2358
|
<xsl:variable name="regex_en_">
|
2121
2359
|
<xsl:choose>
|
2122
2360
|
<!-- ( ) [ ] _ { } U+FF08 FULLWIDTH LEFT PARENTHESIS U+FF09 FULLWIDTH RIGHT PARENTHESIS-->
|
2123
|
-
<xsl:when test="$vertical_layout = 'true'">((<xsl:value-of select="$regex_ja_spec"/>)|([^\u0028\u0029\u005B\u005D\u005F\u007B\u007D<xsl:value-of select="$regex_en_base"/>]){1,})</xsl:when>
|
2361
|
+
<!-- <xsl:when test="$vertical_layout = 'true'">((<xsl:value-of select="$regex_ja_spec"/>)|([^\u0028\u0029\u005B\u005D\u005F\u007B\u007D<xsl:value-of select="$regex_en_base"/>]){1,})</xsl:when> -->
|
2362
|
+
<!-- regex for find characters to rotation -->
|
2363
|
+
<xsl:when test="$vertical_layout = 'true'">((<xsl:value-of select="$regex_ja_spec"/>)|([^\u005F<xsl:value-of select="$regex_en_base"/>]){1,})</xsl:when> <!-- \u0028\u0029\u005B\u005D \u007B\u007D -->
|
2124
2364
|
<xsl:otherwise>([^<xsl:value-of select="$regex_en_base"/>]{1,})</xsl:otherwise>
|
2125
2365
|
</xsl:choose>
|
2126
2366
|
</xsl:variable>
|
@@ -2132,9 +2372,52 @@
|
|
2132
2372
|
<xsl:variable name="element_name_font_en_bold">font_en_bold</xsl:variable>
|
2133
2373
|
<xsl:variable name="tag_font_en_bold_open">###<xsl:value-of select="$element_name_font_en_bold"/>###</xsl:variable>
|
2134
2374
|
<xsl:variable name="tag_font_en_bold_close">###/<xsl:value-of select="$element_name_font_en_bold"/>###</xsl:variable>
|
2375
|
+
<xsl:variable name="element_name_font_en_vertical">font_en_vertical</xsl:variable>
|
2376
|
+
<xsl:variable name="tag_font_en_vertical_open">###<xsl:value-of select="$element_name_font_en_vertical"/>###</xsl:variable>
|
2377
|
+
<xsl:variable name="tag_font_en_vertical_close">###/<xsl:value-of select="$element_name_font_en_vertical"/>###</xsl:variable>
|
2378
|
+
|
2379
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata']) and not(ancestor::jis:p[@class = 'zzSTDTitle2'])]" mode="update_xml_step1">
|
2380
|
+
<xsl:choose>
|
2381
|
+
<xsl:when test="$vertical_layout = 'true'">
|
2382
|
+
<xsl:call-template name="enclose_text_in_vertical_tag"/>
|
2383
|
+
</xsl:when>
|
2384
|
+
<xsl:otherwise>
|
2385
|
+
<xsl:value-of select="."/>
|
2386
|
+
</xsl:otherwise>
|
2387
|
+
</xsl:choose>
|
2388
|
+
</xsl:template>
|
2389
|
+
|
2390
|
+
<xsl:template match="jis:p//text()[not(ancestor::jis:strong) and not(ancestor::jis:p[@class = 'zzSTDTitle2'])] | jis:dt/text() | jis:biblio-tag/text()" mode="update_xml_step1">
|
2391
|
+
<xsl:choose>
|
2392
|
+
<xsl:when test="$vertical_layout = 'true'">
|
2393
|
+
<xsl:call-template name="enclose_text_in_vertical_tag"/>
|
2394
|
+
</xsl:when>
|
2395
|
+
<xsl:otherwise>
|
2396
|
+
<xsl:call-template name="enclose_text_in_font_en_tag"/>
|
2397
|
+
</xsl:otherwise>
|
2398
|
+
</xsl:choose>
|
2399
|
+
</xsl:template>
|
2400
|
+
|
2401
|
+
<xsl:template name="enclose_text_in_vertical_tag">
|
2402
|
+
<xsl:param name="text" select="."/>
|
2403
|
+
<xsl:param name="regex" select="$regex_en"/>
|
2404
|
+
<xsl:variable name="text_vertical_" select="java:replaceAll(java:java.lang.String.new($text), $regex, concat($tag_font_en_vertical_open,'$1',$tag_font_en_vertical_close))"/>
|
2405
|
+
<xsl:variable name="text_vertical">
|
2406
|
+
<xsl:element name="text" namespace="{$namespace_full}">
|
2407
|
+
<xsl:call-template name="replace_text_tags">
|
2408
|
+
<xsl:with-param name="tag_open" select="$tag_font_en_vertical_open"/>
|
2409
|
+
<xsl:with-param name="tag_close" select="$tag_font_en_vertical_close"/>
|
2410
|
+
<xsl:with-param name="text" select="$text_vertical_"/>
|
2411
|
+
</xsl:call-template>
|
2412
|
+
</xsl:element>
|
2413
|
+
</xsl:variable>
|
2414
|
+
<xsl:copy-of select="xalan:nodeset($text_vertical)/*[local-name() = 'text']/node()"/>
|
2415
|
+
</xsl:template>
|
2135
2416
|
|
2136
|
-
<xsl:template
|
2137
|
-
<xsl:
|
2417
|
+
<xsl:template name="enclose_text_in_font_en_tag">
|
2418
|
+
<xsl:param name="text" select="."/>
|
2419
|
+
<xsl:param name="regex" select="$regex_en"/>
|
2420
|
+
<xsl:variable name="text_en_" select="java:replaceAll(java:java.lang.String.new($text), $regex, concat($tag_font_en_open,'$1',$tag_font_en_close))"/>
|
2138
2421
|
<xsl:variable name="text_en">
|
2139
2422
|
<xsl:element name="text" namespace="{$namespace_full}">
|
2140
2423
|
<xsl:call-template name="replace_text_tags">
|
@@ -2147,11 +2430,10 @@
|
|
2147
2430
|
<xsl:copy-of select="xalan:nodeset($text_en)/*[local-name() = 'text']/node()"/>
|
2148
2431
|
</xsl:template>
|
2149
2432
|
|
2150
|
-
|
2151
|
-
|
2152
|
-
|
2153
|
-
|
2154
|
-
<xsl:variable name="text_en_" select="java:replaceAll(java:java.lang.String.new(.), $regex_en, concat($tag_font_en_bold_open,'$1',$tag_font_en_bold_close))"/>
|
2433
|
+
<xsl:template name="enclose_text_in_font_en_bold_tag">
|
2434
|
+
<xsl:param name="text" select="."/>
|
2435
|
+
<xsl:param name="regex" select="$regex_en"/>
|
2436
|
+
<xsl:variable name="text_en_" select="java:replaceAll(java:java.lang.String.new($text), $regex, concat($tag_font_en_bold_open,'$1',$tag_font_en_bold_close))"/>
|
2155
2437
|
<xsl:variable name="text_en">
|
2156
2438
|
<xsl:element name="text" namespace="{$namespace_full}">
|
2157
2439
|
<xsl:call-template name="replace_text_tags">
|
@@ -2164,20 +2446,35 @@
|
|
2164
2446
|
<xsl:copy-of select="xalan:nodeset($text_en)/*[local-name() = 'text']/node()"/>
|
2165
2447
|
</xsl:template>
|
2166
2448
|
|
2449
|
+
<!-- jis:term/jis:preferred2//text() | -->
|
2450
|
+
|
2451
|
+
<!-- <name>注記 1</name> to <name>注記<font_en> 1</font_en></name> -->
|
2452
|
+
<xsl:template match="jis:title/text() | jis:term/jis:name/text() | jis:note/jis:name/text() | jis:termnote/jis:name/text() | jis:table/jis:name/text() | jis:figure/jis:name/text() | jis:termexample/jis:name/text() | jis:xref//text() | jis:origin/text()" mode="update_xml_step1">
|
2453
|
+
<xsl:choose>
|
2454
|
+
<xsl:when test="$vertical_layout = 'true'">
|
2455
|
+
<xsl:call-template name="enclose_text_in_vertical_tag"/>
|
2456
|
+
</xsl:when>
|
2457
|
+
<xsl:otherwise>
|
2458
|
+
<xsl:call-template name="enclose_text_in_font_en_bold_tag"/>
|
2459
|
+
</xsl:otherwise>
|
2460
|
+
</xsl:choose>
|
2461
|
+
</xsl:template>
|
2462
|
+
|
2167
2463
|
<!-- for $contents -->
|
2168
2464
|
<xsl:template match="title/text()">
|
2169
2465
|
<xsl:variable name="regex_en_contents">([^\u00A0\u2002-\u200B\u3000-\u9FFF\uF900-\uFFFF\(\)]{1,})</xsl:variable>
|
2170
|
-
<xsl:
|
2171
|
-
|
2172
|
-
|
2173
|
-
|
2174
|
-
<xsl:with-param name="tag_open" select="$tag_font_en_bold_open"/>
|
2175
|
-
<xsl:with-param name="tag_close" select="$tag_font_en_bold_close"/>
|
2176
|
-
<xsl:with-param name="text" select="$text_en_"/>
|
2466
|
+
<xsl:choose>
|
2467
|
+
<xsl:when test="$vertical_layout = 'true'">
|
2468
|
+
<xsl:call-template name="enclose_text_in_vertical_tag">
|
2469
|
+
<xsl:with-param name="regex" select="$regex_en_contents"/>
|
2177
2470
|
</xsl:call-template>
|
2178
|
-
</xsl:
|
2179
|
-
|
2180
|
-
|
2471
|
+
</xsl:when>
|
2472
|
+
<xsl:otherwise>
|
2473
|
+
<xsl:call-template name="enclose_text_in_font_en_bold_tag">
|
2474
|
+
<xsl:with-param name="regex" select="$regex_en_contents"/>
|
2475
|
+
</xsl:call-template>
|
2476
|
+
</xsl:otherwise>
|
2477
|
+
</xsl:choose>
|
2181
2478
|
</xsl:template>
|
2182
2479
|
|
2183
2480
|
<!-- move example title to the first paragraph -->
|
@@ -2204,133 +2501,177 @@
|
|
2204
2501
|
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
2205
2502
|
</xsl:choose>
|
2206
2503
|
</xsl:variable>
|
2207
|
-
|
2208
|
-
<xsl:
|
2209
|
-
<xsl:
|
2210
|
-
<xsl:call-template name="
|
2211
|
-
<xsl:with-param name="
|
2212
|
-
<xsl:with-param name="tag_close" select="$tag_font_en_bold_close"/>
|
2213
|
-
<xsl:with-param name="text" select="$text_en_"/>
|
2504
|
+
|
2505
|
+
<xsl:choose>
|
2506
|
+
<xsl:when test="$vertical_layout = 'true'">
|
2507
|
+
<xsl:call-template name="enclose_text_in_vertical_tag">
|
2508
|
+
<xsl:with-param name="text" select="$example_name"/>
|
2214
2509
|
</xsl:call-template>
|
2215
|
-
</xsl:
|
2216
|
-
|
2217
|
-
|
2510
|
+
</xsl:when>
|
2511
|
+
<xsl:otherwise>
|
2512
|
+
<xsl:call-template name="enclose_text_in_font_en_bold_tag">
|
2513
|
+
<xsl:with-param name="text" select="$example_name"/>
|
2514
|
+
</xsl:call-template>
|
2515
|
+
</xsl:otherwise>
|
2516
|
+
</xsl:choose>
|
2218
2517
|
</xsl:template>
|
2219
2518
|
|
2220
2519
|
<xsl:template match="jis:eref//text()" mode="update_xml_step1">
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2224
|
-
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2230
|
-
|
2231
|
-
|
2232
|
-
|
2233
|
-
|
2234
|
-
|
2235
|
-
|
2236
|
-
|
2237
|
-
|
2238
|
-
<xsl:
|
2239
|
-
<xsl:
|
2240
|
-
|
2241
|
-
|
2242
|
-
|
2243
|
-
|
2244
|
-
|
2245
|
-
|
2246
|
-
|
2247
|
-
|
2520
|
+
<xsl:choose>
|
2521
|
+
<xsl:when test="$vertical_layout = 'true'">
|
2522
|
+
<xsl:call-template name="enclose_text_in_vertical_tag"/>
|
2523
|
+
</xsl:when>
|
2524
|
+
<xsl:otherwise>
|
2525
|
+
<!-- Example: JIS Z 8301:2011 to <font_en_bold>JIS Z 8301</font_en_bold><font_en>:2011</font_en> -->
|
2526
|
+
<xsl:variable name="parts">
|
2527
|
+
<xsl:choose>
|
2528
|
+
<xsl:when test="contains(., ':')">
|
2529
|
+
<xsl:element name="{$element_name_font_en_bold}" namespace="{$namespace_full}"><xsl:value-of select="substring-before(., ':')"/></xsl:element>
|
2530
|
+
<xsl:element name="{$element_name_font_en}" namespace="{$namespace_full}">:<xsl:value-of select="substring-after(., ':')"/></xsl:element>
|
2531
|
+
</xsl:when>
|
2532
|
+
<xsl:otherwise>
|
2533
|
+
<xsl:element name="{$element_name_font_en_bold}" namespace="{$namespace_full}"><xsl:value-of select="."/></xsl:element>
|
2534
|
+
</xsl:otherwise>
|
2535
|
+
</xsl:choose>
|
2536
|
+
</xsl:variable>
|
2537
|
+
<xsl:for-each select="xalan:nodeset($parts)/*">
|
2538
|
+
<xsl:variable name="tag_open">###<xsl:value-of select="local-name()"/>###</xsl:variable>
|
2539
|
+
<xsl:variable name="tag_close">###/<xsl:value-of select="local-name()"/>###</xsl:variable>
|
2540
|
+
<xsl:variable name="text_en_" select="java:replaceAll(java:java.lang.String.new(.), $regex_en, concat($tag_open,'$1',$tag_close))"/>
|
2541
|
+
<xsl:variable name="text_en">
|
2542
|
+
<xsl:element name="text" namespace="{$namespace_full}">
|
2543
|
+
<xsl:call-template name="replace_text_tags">
|
2544
|
+
<xsl:with-param name="tag_open" select="$tag_open"/>
|
2545
|
+
<xsl:with-param name="tag_close" select="$tag_close"/>
|
2546
|
+
<xsl:with-param name="text" select="$text_en_"/>
|
2547
|
+
</xsl:call-template>
|
2548
|
+
</xsl:element>
|
2549
|
+
</xsl:variable>
|
2550
|
+
<xsl:copy-of select="xalan:nodeset($text_en)/*[local-name() = 'text']/node()"/>
|
2551
|
+
</xsl:for-each>
|
2552
|
+
</xsl:otherwise>
|
2553
|
+
</xsl:choose>
|
2248
2554
|
</xsl:template>
|
2249
2555
|
|
2250
2556
|
<xsl:template match="jis:strong" priority="2" mode="update_xml_step1">
|
2251
2557
|
<xsl:apply-templates mode="update_xml_step1"/>
|
2252
2558
|
</xsl:template>
|
2253
2559
|
<xsl:template match="jis:strong/text()" priority="2" mode="update_xml_step1">
|
2254
|
-
|
2255
|
-
<xsl:
|
2256
|
-
<xsl:
|
2257
|
-
<xsl:call-template name="
|
2258
|
-
|
2259
|
-
|
2260
|
-
|
2261
|
-
|
2262
|
-
|
2263
|
-
|
2264
|
-
|
2560
|
+
|
2561
|
+
<xsl:choose>
|
2562
|
+
<xsl:when test="$vertical_layout = 'true'">
|
2563
|
+
<xsl:call-template name="enclose_text_in_vertical_tag"/>
|
2564
|
+
</xsl:when>
|
2565
|
+
<xsl:otherwise>
|
2566
|
+
<xsl:call-template name="enclose_text_in_font_en_bold_tag"/>
|
2567
|
+
</xsl:otherwise>
|
2568
|
+
</xsl:choose>
|
2569
|
+
</xsl:template>
|
2570
|
+
|
2571
|
+
<!-- add @provisional-distance-between-starts for 'ol' -->
|
2572
|
+
<xsl:template match="jis:ol" priority="2" mode="update_xml_step1">
|
2573
|
+
<xsl:copy>
|
2574
|
+
<xsl:copy-of select="@*"/>
|
2575
|
+
<xsl:if test="$vertical_layout = 'true'">
|
2576
|
+
<xsl:variable name="labels">
|
2577
|
+
<xsl:for-each select="*[local-name() = 'li']"><label_len><xsl:value-of select="string-length(@label)"/></label_len></xsl:for-each>
|
2578
|
+
</xsl:variable>
|
2579
|
+
<xsl:variable name="max_len_label_">
|
2580
|
+
<xsl:for-each select="xalan:nodeset($labels)//*">
|
2581
|
+
<xsl:sort select="." data-type="number" order="descending"/>
|
2582
|
+
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
2583
|
+
</xsl:for-each>
|
2584
|
+
</xsl:variable>
|
2585
|
+
<xsl:variable name="max_len_label" select="number($max_len_label_)"/>
|
2586
|
+
|
2587
|
+
<xsl:choose>
|
2588
|
+
<xsl:when test="@type = 'arabic'">
|
2589
|
+
<xsl:attribute name="provisional-distance-between-starts">
|
2590
|
+
<xsl:choose>
|
2591
|
+
<xsl:when test="$max_len_label = 1">8.5mm</xsl:when>
|
2592
|
+
<xsl:when test="$max_len_label = 2">12mm</xsl:when>
|
2593
|
+
<xsl:when test="$max_len_label = 3">20mm</xsl:when>
|
2594
|
+
<xsl:otherwise>
|
2595
|
+
<xsl:value-of select="3 + number($max_len_label) * 4"/>mm
|
2596
|
+
</xsl:otherwise>
|
2597
|
+
</xsl:choose>
|
2598
|
+
</xsl:attribute>
|
2599
|
+
</xsl:when>
|
2600
|
+
<xsl:otherwise>
|
2601
|
+
<xsl:variable name="ol_styles">
|
2602
|
+
<styles xsl:use-attribute-sets="list-style"/>
|
2603
|
+
</xsl:variable>
|
2604
|
+
<xsl:for-each select="xalan:nodeset($ol_styles)//styles">
|
2605
|
+
<xsl:copy-of select="@*"/>
|
2606
|
+
</xsl:for-each>
|
2607
|
+
</xsl:otherwise>
|
2608
|
+
</xsl:choose>
|
2609
|
+
</xsl:if>
|
2610
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
2611
|
+
</xsl:copy>
|
2265
2612
|
</xsl:template>
|
2266
2613
|
|
2614
|
+
<!-- bold English text in non-vertical layout -->
|
2267
2615
|
<xsl:template match="*[local-name() = 'font_en_bold'][normalize-space() != '']">
|
2268
2616
|
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"><xsl:value-of select="$zero_width_space"/></xsl:if>
|
2269
2617
|
<fo:inline>
|
2270
|
-
<xsl:
|
2271
|
-
|
2272
|
-
|
2273
|
-
<xsl:
|
2274
|
-
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
2275
|
-
</xsl:if>
|
2618
|
+
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
|
2619
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
2620
|
+
<xsl:if test="ancestor::*[local-name() = 'preferred']">
|
2621
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
2276
2622
|
</xsl:if>
|
2277
|
-
|
2278
|
-
<xsl:attribute name="font-size">18pt</xsl:attribute>
|
2279
|
-
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
2280
|
-
</xsl:if> -->
|
2281
|
-
<xsl:call-template name="insertEnglishText"/>
|
2623
|
+
<xsl:apply-templates/>
|
2282
2624
|
</fo:inline>
|
2283
2625
|
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"><xsl:value-of select="$zero_width_space"/></xsl:if>
|
2284
2626
|
</xsl:template>
|
2285
2627
|
|
2286
|
-
|
2287
|
-
|
2288
|
-
<xsl:
|
2289
|
-
|
2290
|
-
|
2291
|
-
|
2292
|
-
|
2293
|
-
|
2294
|
-
|
2295
|
-
|
2296
|
-
|
2297
|
-
|
2298
|
-
|
2299
|
-
<xsl:when test="ancestor::*[local-name(../..) = 'note'] and ancestor::*[local-name(..) = 'name']">
|
2300
|
-
<xsl:value-of select="concat(' ', normalize-space(.))"/>
|
2301
|
-
</xsl:when>
|
2302
|
-
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
2303
|
-
</xsl:choose>
|
2304
|
-
</xsl:variable>
|
2305
|
-
<xsl:call-template name="insertVerticalChar">
|
2306
|
-
<xsl:with-param name="str" select="$text"/>
|
2307
|
-
<xsl:with-param name="reference-orientation" select="$reference-orientation"/>
|
2308
|
-
</xsl:call-template>
|
2309
|
-
</xsl:when>
|
2310
|
-
<xsl:otherwise>
|
2311
|
-
<xsl:apply-templates select="."/>
|
2312
|
-
</xsl:otherwise>
|
2313
|
-
</xsl:choose>
|
2314
|
-
</xsl:for-each>
|
2315
|
-
</xsl:otherwise>
|
2316
|
-
</xsl:choose>
|
2628
|
+
<!-- English text in non-vertical layout -->
|
2629
|
+
<xsl:template match="*[local-name() = 'font_en'][normalize-space() != '']">
|
2630
|
+
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"><xsl:value-of select="$zero_width_space"/></xsl:if>
|
2631
|
+
<fo:inline>
|
2632
|
+
<xsl:if test="not(ancestor::jis:p[@class = 'zzSTDTitle2']) and not(ancestor::jis:span[@class = 'JIS'])">
|
2633
|
+
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
|
2634
|
+
</xsl:if>
|
2635
|
+
<xsl:if test="ancestor::*[local-name() = 'preferred']">
|
2636
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
2637
|
+
</xsl:if>
|
2638
|
+
<xsl:apply-templates/>
|
2639
|
+
</fo:inline>
|
2640
|
+
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"><xsl:value-of select="$zero_width_space"/></xsl:if>
|
2317
2641
|
</xsl:template>
|
2318
2642
|
|
2319
|
-
|
2643
|
+
<!-- English text in vertical layout -->
|
2644
|
+
<xsl:template match="*[local-name() = 'font_en_vertical'][normalize-space() != '']">
|
2320
2645
|
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"><xsl:value-of select="$zero_width_space"/></xsl:if>
|
2321
2646
|
<fo:inline>
|
2322
2647
|
<xsl:if test="not(ancestor::jis:p[@class = 'zzSTDTitle2']) and not(ancestor::jis:span[@class = 'JIS'])">
|
2323
|
-
<xsl:if test="not($vertical_layout = 'true')">
|
2324
|
-
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
|
2325
|
-
</xsl:if>
|
2326
2648
|
</xsl:if>
|
2327
2649
|
<xsl:if test="ancestor::*[local-name() = 'preferred']">
|
2328
2650
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
2329
2651
|
</xsl:if>
|
2330
|
-
|
2331
|
-
<xsl:
|
2332
|
-
|
2333
|
-
|
2652
|
+
<xsl:for-each select="node()">
|
2653
|
+
<xsl:choose>
|
2654
|
+
<xsl:when test="self::text()">
|
2655
|
+
<!-- convert to vertical layout -->
|
2656
|
+
<xsl:variable name="text">
|
2657
|
+
<xsl:choose>
|
2658
|
+
<xsl:when test="(ancestor::*[local-name(../..) = 'note'] or ancestor::*[local-name(../..) = 'example'] ) and ancestor::*[local-name(..) = 'name']">
|
2659
|
+
<xsl:value-of select="concat(' ', normalize-space(.))"/>
|
2660
|
+
</xsl:when>
|
2661
|
+
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
2662
|
+
</xsl:choose>
|
2663
|
+
</xsl:variable>
|
2664
|
+
<xsl:call-template name="insertVerticalChar">
|
2665
|
+
<xsl:with-param name="str" select="$text"/>
|
2666
|
+
<xsl:with-param name="reference-orientation">90</xsl:with-param>
|
2667
|
+
<xsl:with-param name="add_zero_width_space">true</xsl:with-param>
|
2668
|
+
</xsl:call-template>
|
2669
|
+
</xsl:when>
|
2670
|
+
<xsl:otherwise>
|
2671
|
+
<xsl:apply-templates select="."/>
|
2672
|
+
</xsl:otherwise>
|
2673
|
+
</xsl:choose>
|
2674
|
+
</xsl:for-each>
|
2334
2675
|
</fo:inline>
|
2335
2676
|
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"><xsl:value-of select="$zero_width_space"/></xsl:if>
|
2336
2677
|
</xsl:template>
|
@@ -2340,7 +2681,7 @@
|
|
2340
2681
|
<!-- ========================= -->
|
2341
2682
|
|
2342
2683
|
<!-- patch for correct list-item-label rendering: enclose each char in inline-container -->
|
2343
|
-
<xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/text()" priority="3">
|
2684
|
+
<xsl:template match="*[local-name() = 'note' or local-name() = 'example']/*[local-name() = 'name']/text()" priority="3">
|
2344
2685
|
<xsl:choose>
|
2345
2686
|
<xsl:when test="not($vertical_layout = 'true')">
|
2346
2687
|
<xsl:value-of select="."/>
|
@@ -2355,6 +2696,54 @@
|
|
2355
2696
|
</xsl:choose>
|
2356
2697
|
</xsl:template>
|
2357
2698
|
|
2699
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" priority="3">
|
2700
|
+
<xsl:param name="process">false</xsl:param>
|
2701
|
+
|
2702
|
+
<xsl:if test="normalize-space() != '' and (not($vertical_layout = 'true') or $process = 'true')">
|
2703
|
+
<fo:block xsl:use-attribute-sets="figure-name-style">
|
2704
|
+
|
2705
|
+
<xsl:call-template name="refine_figure-name-style"/>
|
2706
|
+
|
2707
|
+
<xsl:apply-templates/>
|
2708
|
+
</fo:block>
|
2709
|
+
</xsl:if>
|
2710
|
+
</xsl:template>
|
2711
|
+
|
2712
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@class = 'dl']" priority="3">
|
2713
|
+
<xsl:param name="process">false</xsl:param>
|
2714
|
+
<xsl:if test="normalize-space() != '' and (not($vertical_layout = 'true') or $process = 'true')">
|
2715
|
+
<fo:block>
|
2716
|
+
<xsl:apply-templates/>
|
2717
|
+
</fo:block>
|
2718
|
+
</xsl:if>
|
2719
|
+
</xsl:template>
|
2720
|
+
|
2721
|
+
<xsl:template match="*[local-name() = 'span'][@class = 'norotate']//text()" name="norotate" priority="3">
|
2722
|
+
<xsl:param name="str" select="."/>
|
2723
|
+
<xsl:choose>
|
2724
|
+
<xsl:when test="$vertical_layout = 'true'">
|
2725
|
+
<xsl:if test="string-length($str) > 0">
|
2726
|
+
<xsl:variable name="char" select="substring($str,1,1)"/>
|
2727
|
+
<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" reference-orientation="0">
|
2728
|
+
<fo:block-container width="1em">
|
2729
|
+
<fo:block line-height="1em">
|
2730
|
+
<xsl:value-of select="$char"/>
|
2731
|
+
</fo:block>
|
2732
|
+
</fo:block-container>
|
2733
|
+
</fo:inline-container>
|
2734
|
+
<xsl:call-template name="norotate">
|
2735
|
+
<xsl:with-param name="str" select="substring($str, 2)"/>
|
2736
|
+
</xsl:call-template>
|
2737
|
+
</xsl:if>
|
2738
|
+
</xsl:when>
|
2739
|
+
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
2740
|
+
</xsl:choose>
|
2741
|
+
</xsl:template>
|
2742
|
+
|
2743
|
+
<xsl:template match="*[local-name() = 'span'][@class = 'halffontsize']" priority="3">
|
2744
|
+
<fo:inline font-size="50%" baseline-shift="15%"><xsl:apply-templates/></fo:inline>
|
2745
|
+
</xsl:template>
|
2746
|
+
|
2358
2747
|
<xsl:template name="insertHeaderFooter">
|
2359
2748
|
<xsl:param name="docidentifier"/>
|
2360
2749
|
<xsl:param name="hidePageNumber">false</xsl:param>
|
@@ -2556,7 +2945,10 @@
|
|
2556
2945
|
</fo:block-container>
|
2557
2946
|
</fo:block-container>
|
2558
2947
|
|
2559
|
-
<fo:block-container font-size="9pt" color="white" height="5.5mm"
|
2948
|
+
<fo:block-container font-size="9pt" color="white" height="5.5mm" margin-left="56mm" line-height="1.1">
|
2949
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
2950
|
+
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
|
2951
|
+
</xsl:if>
|
2560
2952
|
|
2561
2953
|
<fo:block text-align-last="justify" margin-top="56mm" margin-bottom="3mm">
|
2562
2954
|
|
@@ -2686,7 +3078,7 @@
|
|
2686
3078
|
</svg>
|
2687
3079
|
</xsl:variable>
|
2688
3080
|
|
2689
|
-
<xsl:strip-space elements="jis:xref"/>
|
3081
|
+
<!-- <xsl:strip-space elements="jis:xref"/> -->
|
2690
3082
|
|
2691
3083
|
<xsl:variable name="namespace_full" select="namespace-uri(/*)"/> <!-- example: https://www.metanorma.org/ns/iso -->
|
2692
3084
|
<xsl:variable name="root_element" select="local-name(/*)"/> <!-- example: iso-standard -->
|
@@ -3288,6 +3680,10 @@
|
|
3288
3680
|
<xsl:if test="not($vertical_layout = 'true')">
|
3289
3681
|
<xsl:attribute name="font-family">IPAexGothic</xsl:attribute>
|
3290
3682
|
</xsl:if>
|
3683
|
+
<xsl:if test="$vertical_layout = 'true'">
|
3684
|
+
<xsl:attribute name="font-family">Noto Sans JP</xsl:attribute>
|
3685
|
+
<xsl:attribute name="font-weight">500</xsl:attribute>
|
3686
|
+
</xsl:if>
|
3291
3687
|
|
3292
3688
|
</xsl:template>
|
3293
3689
|
|
@@ -3696,6 +4092,10 @@
|
|
3696
4092
|
|
3697
4093
|
<xsl:template name="refine_termnote-name-style">
|
3698
4094
|
|
4095
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
4096
|
+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
|
4097
|
+
</xsl:if> -->
|
4098
|
+
|
3699
4099
|
<xsl:if test="not($vertical_layout = 'true')">
|
3700
4100
|
<xsl:attribute name="font-family">IPAexGothic</xsl:attribute>
|
3701
4101
|
</xsl:if>
|
@@ -3770,6 +4170,67 @@
|
|
3770
4170
|
<xsl:if test="ancestor::*[local-name() = 'example'] or ancestor::*[local-name() = 'note']">
|
3771
4171
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
3772
4172
|
</xsl:if>
|
4173
|
+
<xsl:if test="$vertical_layout = 'true' and not(*[local-name() = 'figure'])">
|
4174
|
+
<xsl:attribute name="reference-orientation">90</xsl:attribute>
|
4175
|
+
<xsl:attribute name="display-align">center</xsl:attribute>
|
4176
|
+
<!-- <xsl:attribute name="border">1pt solid blue</xsl:attribute> -->
|
4177
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
4178
|
+
|
4179
|
+
<!-- determine block-container width for rotated image -->
|
4180
|
+
<xsl:for-each select="*[local-name() = 'image'][1]"> <!-- set context to 'image' element -->
|
4181
|
+
|
4182
|
+
<xsl:variable name="width">
|
4183
|
+
<xsl:call-template name="setImageWidth"/>
|
4184
|
+
</xsl:variable>
|
4185
|
+
|
4186
|
+
<xsl:choose>
|
4187
|
+
<xsl:when test="normalize-space($width) != ''">
|
4188
|
+
<xsl:attribute name="width">
|
4189
|
+
<xsl:value-of select="$width"/>
|
4190
|
+
</xsl:attribute>
|
4191
|
+
</xsl:when>
|
4192
|
+
<xsl:when test="*[local-name() = 'svg']">
|
4193
|
+
<xsl:variable name="svg_content">
|
4194
|
+
<xsl:apply-templates select="*[local-name() = 'svg'][1]" mode="svg_update"/>
|
4195
|
+
</xsl:variable>
|
4196
|
+
<xsl:variable name="svg_width_" select="xalan:nodeset($svg_content)/*/@width"/>
|
4197
|
+
<xsl:variable name="svg_width" select="number(translate($svg_width_, 'px', ''))"/>
|
4198
|
+
|
4199
|
+
<xsl:variable name="scale_width">
|
4200
|
+
<xsl:choose>
|
4201
|
+
<xsl:when test="$svg_width > $height_effective_px">
|
4202
|
+
<xsl:value-of select="$height_effective_px div $svg_width"/>
|
4203
|
+
</xsl:when>
|
4204
|
+
<xsl:otherwise>1</xsl:otherwise>
|
4205
|
+
</xsl:choose>
|
4206
|
+
</xsl:variable>
|
4207
|
+
<xsl:attribute name="width"><xsl:value-of select="$svg_width * $scale_width"/>px</xsl:attribute>
|
4208
|
+
|
4209
|
+
</xsl:when>
|
4210
|
+
<xsl:otherwise> <!-- determine image width programmatically -->
|
4211
|
+
<xsl:variable name="img_src">
|
4212
|
+
<xsl:call-template name="getImageSrc"/>
|
4213
|
+
</xsl:variable>
|
4214
|
+
<xsl:variable name="image_width_programmatically" select="java:org.metanorma.fop.utils.ImageUtils.getImageWidth($img_src, $height_effective, $width_effective)"/>
|
4215
|
+
|
4216
|
+
<xsl:variable name="scale">
|
4217
|
+
<xsl:call-template name="getImageScale"/>
|
4218
|
+
</xsl:variable>
|
4219
|
+
|
4220
|
+
<xsl:if test="normalize-space($image_width_programmatically) != '0'">
|
4221
|
+
<xsl:attribute name="width">
|
4222
|
+
<xsl:value-of select="concat($image_width_programmatically, 'mm')"/> <!-- * ($scale div 100) -->
|
4223
|
+
</xsl:attribute>
|
4224
|
+
<xsl:if test="$scale != 100">
|
4225
|
+
<xsl:attribute name="display-align">before</xsl:attribute>
|
4226
|
+
</xsl:if>
|
4227
|
+
</xsl:if>
|
4228
|
+
</xsl:otherwise>
|
4229
|
+
</xsl:choose>
|
4230
|
+
</xsl:for-each>
|
4231
|
+
<!-- end: $vertical_layout = 'true -->
|
4232
|
+
</xsl:if>
|
4233
|
+
<!-- end: $namespace = 'jis' -->
|
3773
4234
|
|
3774
4235
|
</xsl:template>
|
3775
4236
|
|
@@ -3837,6 +4298,10 @@
|
|
3837
4298
|
|
3838
4299
|
<xsl:template name="refine_image-style">
|
3839
4300
|
|
4301
|
+
<xsl:if test="$vertical_layout = 'true'">
|
4302
|
+
<xsl:attribute name="text-align">inherit</xsl:attribute>
|
4303
|
+
</xsl:if>
|
4304
|
+
|
3840
4305
|
</xsl:template>
|
3841
4306
|
|
3842
4307
|
<xsl:attribute-set name="figure-pseudocode-p-style">
|
@@ -4384,9 +4849,21 @@
|
|
4384
4849
|
<xsl:template name="processTables_Contents">
|
4385
4850
|
<tables>
|
4386
4851
|
<xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
|
4387
|
-
<
|
4388
|
-
<xsl:
|
4389
|
-
|
4852
|
+
<xsl:choose>
|
4853
|
+
<xsl:when test="*[local-name() = 'fmt-name']">
|
4854
|
+
<xsl:variable name="fmt_name">
|
4855
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
|
4856
|
+
</xsl:variable>
|
4857
|
+
<table id="{@id}" alt-text="{normalize-space($fmt_name)}">
|
4858
|
+
<xsl:copy-of select="$fmt_name"/>
|
4859
|
+
</table>
|
4860
|
+
</xsl:when>
|
4861
|
+
<xsl:otherwise>
|
4862
|
+
<table id="{@id}" alt-text="{*[local-name() = 'name']}">
|
4863
|
+
<xsl:copy-of select="*[local-name() = 'name']"/>
|
4864
|
+
</table>
|
4865
|
+
</xsl:otherwise>
|
4866
|
+
</xsl:choose>
|
4390
4867
|
</xsl:for-each>
|
4391
4868
|
</tables>
|
4392
4869
|
</xsl:template>
|
@@ -4394,9 +4871,21 @@
|
|
4394
4871
|
<xsl:template name="processFigures_Contents">
|
4395
4872
|
<figures>
|
4396
4873
|
<xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(*[local-name() = 'name'], 'Figure ') and normalize-space(@id) != '']">
|
4397
|
-
<
|
4398
|
-
<xsl:
|
4399
|
-
|
4874
|
+
<xsl:choose>
|
4875
|
+
<xsl:when test="*[local-name() = 'fmt-name']">
|
4876
|
+
<xsl:variable name="fmt_name">
|
4877
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
|
4878
|
+
</xsl:variable>
|
4879
|
+
<figure id="{@id}" alt-text="{normalize-space($fmt_name)}">
|
4880
|
+
<xsl:copy-of select="$fmt_name"/>
|
4881
|
+
</figure>
|
4882
|
+
</xsl:when>
|
4883
|
+
<xsl:otherwise>
|
4884
|
+
<figure id="{@id}" alt-text="{*[local-name() = 'name']}">
|
4885
|
+
<xsl:copy-of select="*[local-name() = 'name']"/>
|
4886
|
+
</figure>
|
4887
|
+
</xsl:otherwise>
|
4888
|
+
</xsl:choose>
|
4400
4889
|
</xsl:for-each>
|
4401
4890
|
</figures>
|
4402
4891
|
</xsl:template>
|
@@ -9230,10 +9719,6 @@
|
|
9230
9719
|
|
9231
9720
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
9232
9721
|
|
9233
|
-
<xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
|
9234
|
-
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
9235
|
-
</xsl:if>
|
9236
|
-
|
9237
9722
|
<xsl:call-template name="refine_termnote-name-style"/>
|
9238
9723
|
|
9239
9724
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
@@ -9380,17 +9865,46 @@
|
|
9380
9865
|
<!-- Example: Dimensions in millimeters -->
|
9381
9866
|
<xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
|
9382
9867
|
|
9868
|
+
<xsl:variable name="show_figure_key_in_block_container">
|
9869
|
+
|
9870
|
+
<xsl:choose>
|
9871
|
+
<xsl:when test="$vertical_layout = 'true'">false</xsl:when>
|
9872
|
+
<xsl:otherwise>true</xsl:otherwise>
|
9873
|
+
</xsl:choose>
|
9874
|
+
|
9875
|
+
</xsl:variable>
|
9876
|
+
|
9383
9877
|
<fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
|
9384
9878
|
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
9385
9879
|
</fo:block>
|
9386
|
-
<xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
|
9387
|
-
<xsl:call-template name="note"/>
|
9388
|
-
</xsl:for-each>
|
9389
|
-
<xsl:call-template name="fn_display_figure"/>
|
9390
9880
|
|
9391
|
-
|
9881
|
+
<xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
|
9882
|
+
<xsl:call-template name="showFigureKey"/>
|
9883
|
+
</xsl:if>
|
9884
|
+
|
9885
|
+
<xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image -->
|
9886
|
+
|
9887
|
+
</fo:block-container>
|
9888
|
+
|
9889
|
+
<xsl:if test="$vertical_layout = 'true'">
|
9890
|
+
<fo:block keep-with-previous="always">
|
9891
|
+
<xsl:apply-templates select="*[local-name() = 'p'][@class = 'dl']">
|
9892
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
9893
|
+
</xsl:apply-templates>
|
9894
|
+
<xsl:call-template name="showFigureKey"/>
|
9895
|
+
</fo:block>
|
9896
|
+
<xsl:apply-templates select="*[local-name() = 'name']">
|
9897
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
9898
|
+
</xsl:apply-templates>
|
9899
|
+
</xsl:if>
|
9900
|
+
|
9901
|
+
</xsl:template>
|
9392
9902
|
|
9393
|
-
|
9903
|
+
<xsl:template name="showFigureKey">
|
9904
|
+
<xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
|
9905
|
+
<xsl:call-template name="note"/>
|
9906
|
+
</xsl:for-each>
|
9907
|
+
<xsl:call-template name="fn_display_figure"/>
|
9394
9908
|
</xsl:template>
|
9395
9909
|
|
9396
9910
|
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
@@ -9586,6 +10100,22 @@
|
|
9586
10100
|
</xsl:if>
|
9587
10101
|
</xsl:template>
|
9588
10102
|
|
10103
|
+
<xsl:template name="getImageSrc">
|
10104
|
+
<xsl:choose>
|
10105
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
10106
|
+
<xsl:choose>
|
10107
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
10108
|
+
<xsl:value-of select="@src"/>
|
10109
|
+
</xsl:when>
|
10110
|
+
<xsl:otherwise>
|
10111
|
+
<xsl:value-of select="concat($basepath, @src)"/>
|
10112
|
+
</xsl:otherwise>
|
10113
|
+
</xsl:choose>
|
10114
|
+
</xsl:when>
|
10115
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
10116
|
+
</xsl:choose>
|
10117
|
+
</xsl:template>
|
10118
|
+
|
9589
10119
|
<xsl:template name="getImageScale">
|
9590
10120
|
<xsl:param name="indent"/>
|
9591
10121
|
<xsl:variable name="indent_left">
|
@@ -9595,19 +10125,7 @@
|
|
9595
10125
|
</xsl:choose>
|
9596
10126
|
</xsl:variable>
|
9597
10127
|
<xsl:variable name="img_src">
|
9598
|
-
<xsl:
|
9599
|
-
<xsl:when test="not(starts-with(@src, 'data:'))">
|
9600
|
-
<xsl:choose>
|
9601
|
-
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
9602
|
-
<xsl:value-of select="@src"/>
|
9603
|
-
</xsl:when>
|
9604
|
-
<xsl:otherwise>
|
9605
|
-
<xsl:value-of select="concat($basepath, @src)"/>
|
9606
|
-
</xsl:otherwise>
|
9607
|
-
</xsl:choose>
|
9608
|
-
</xsl:when>
|
9609
|
-
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
9610
|
-
</xsl:choose>
|
10128
|
+
<xsl:call-template name="getImageSrc"/>
|
9611
10129
|
</xsl:variable>
|
9612
10130
|
|
9613
10131
|
<xsl:variable name="image_width_effective">
|
@@ -9615,10 +10133,22 @@
|
|
9615
10133
|
<xsl:value-of select="$width_effective - number($indent_left)"/>
|
9616
10134
|
|
9617
10135
|
</xsl:variable>
|
10136
|
+
<xsl:variable name="image_height_effective" select="$height_effective - number($indent_left)"/>
|
9618
10137
|
<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
|
9619
10138
|
<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
|
9620
10139
|
<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
|
9621
|
-
<xsl:variable name="scale"
|
10140
|
+
<xsl:variable name="scale">
|
10141
|
+
|
10142
|
+
<xsl:choose>
|
10143
|
+
<xsl:when test="$vertical_layout = 'true'">
|
10144
|
+
<xsl:value-of select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_height_effective, $width_effective)"/>
|
10145
|
+
</xsl:when>
|
10146
|
+
<xsl:otherwise>
|
10147
|
+
<xsl:value-of select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
10148
|
+
</xsl:otherwise>
|
10149
|
+
</xsl:choose>
|
10150
|
+
|
10151
|
+
</xsl:variable>
|
9622
10152
|
<xsl:value-of select="$scale"/>
|
9623
10153
|
</xsl:template>
|
9624
10154
|
|
@@ -10171,20 +10701,48 @@
|
|
10171
10701
|
<xsl:template match="*[local-name() = 'emf']"/>
|
10172
10702
|
|
10173
10703
|
<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">
|
10704
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
|
10705
|
+
<xsl:apply-templates mode="contents"/>
|
10706
|
+
<xsl:text> </xsl:text>
|
10707
|
+
</xsl:if>
|
10708
|
+
</xsl:template>
|
10709
|
+
|
10710
|
+
<xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="contents"/>
|
10711
|
+
|
10712
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fmt-name'] | *[local-name() = 'table']/*[local-name() = 'fmt-name'] | *[local-name() = 'permission']/*[local-name() = 'fmt-name'] | *[local-name() = 'recommendation']/*[local-name() = 'fmt-name'] | *[local-name() = 'requirement']/*[local-name() = 'fmt-name']" mode="contents">
|
10174
10713
|
<xsl:apply-templates mode="contents"/>
|
10175
10714
|
<xsl:text> </xsl:text>
|
10176
10715
|
</xsl:template>
|
10177
10716
|
|
10178
10717
|
<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'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
|
10718
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
|
10719
|
+
<xsl:apply-templates mode="bookmarks"/>
|
10720
|
+
<xsl:text> </xsl:text>
|
10721
|
+
</xsl:if>
|
10722
|
+
</xsl:template>
|
10723
|
+
|
10724
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fmt-name'] | *[local-name() = 'table']/*[local-name() = 'fmt-name'] | *[local-name() = 'permission']/*[local-name() = 'fmt-name'] | *[local-name() = 'recommendation']/*[local-name() = 'fmt-name'] | *[local-name() = 'requirement']/*[local-name() = 'fmt-name'] | *[local-name() = 'sourcecode']/*[local-name() = 'fmt-name']" mode="bookmarks">
|
10179
10725
|
<xsl:apply-templates mode="bookmarks"/>
|
10180
10726
|
<xsl:text> </xsl:text>
|
10181
10727
|
</xsl:template>
|
10182
10728
|
|
10183
10729
|
<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">
|
10730
|
+
<xsl:if test="not(../following-sibling::*[1][local-name() = 'fmt-name'])">
|
10731
|
+
<xsl:value-of select="."/>
|
10732
|
+
</xsl:if>
|
10733
|
+
</xsl:template>
|
10734
|
+
|
10735
|
+
<xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'fmt-name']/text()" mode="contents" priority="2">
|
10184
10736
|
<xsl:value-of select="."/>
|
10185
10737
|
</xsl:template>
|
10186
10738
|
|
10187
10739
|
<xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
|
10740
|
+
<xsl:if test="not(../following-sibling::*[1][local-name() = 'fmt-name'])">
|
10741
|
+
<xsl:value-of select="."/>
|
10742
|
+
</xsl:if>
|
10743
|
+
</xsl:template>
|
10744
|
+
|
10745
|
+
<xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'fmt-name']//text()" mode="bookmarks" priority="2">
|
10188
10746
|
<xsl:value-of select="."/>
|
10189
10747
|
</xsl:template>
|
10190
10748
|
|
@@ -10205,7 +10763,7 @@
|
|
10205
10763
|
</xsl:template>
|
10206
10764
|
|
10207
10765
|
<!-- special case: ignore section-title if @depth different than @depth of parent clause, or @depth of parent clause = 1 -->
|
10208
|
-
<xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title']/@depth or ../*[local-name() = 'title']/@depth = 1)]" priority="3" mode="contents"/>
|
10766
|
+
<xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title' or local-name() = 'fmt-title']/@depth or ../*[local-name() = 'title' or local-name() = 'fmt-title']/@depth = 1)]" priority="3" mode="contents"/>
|
10209
10767
|
|
10210
10768
|
<xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" name="contents_section-title" mode="contents">
|
10211
10769
|
<xsl:variable name="level">
|
@@ -10217,6 +10775,9 @@
|
|
10217
10775
|
<xsl:variable name="section">
|
10218
10776
|
<xsl:choose>
|
10219
10777
|
<xsl:when test="@type = 'section-title'"/>
|
10778
|
+
<xsl:when test="*[local-name() = 'span'][@class = 'fmt-caption-delim']">
|
10779
|
+
<xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
|
10780
|
+
</xsl:when>
|
10220
10781
|
<xsl:otherwise>
|
10221
10782
|
<xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
10222
10783
|
</xsl:otherwise>
|
@@ -10239,6 +10800,19 @@
|
|
10239
10800
|
|
10240
10801
|
<xsl:variable name="title">
|
10241
10802
|
<xsl:choose>
|
10803
|
+
<!-- https://github.com/metanorma/mn-native-pdf/issues/770 -->
|
10804
|
+
<xsl:when test="*[local-name() = 'span'][@class = 'fmt-caption-delim']">
|
10805
|
+
<xsl:choose>
|
10806
|
+
<xsl:when test="@type = 'section-title'">
|
10807
|
+
<xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
|
10808
|
+
<xsl:text>: </xsl:text>
|
10809
|
+
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
|
10810
|
+
</xsl:when>
|
10811
|
+
<xsl:otherwise>
|
10812
|
+
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
|
10813
|
+
</xsl:otherwise>
|
10814
|
+
</xsl:choose>
|
10815
|
+
</xsl:when>
|
10242
10816
|
<xsl:when test="*[local-name() = 'tab']">
|
10243
10817
|
<xsl:choose>
|
10244
10818
|
<xsl:when test="@type = 'section-title'">
|
@@ -10274,7 +10848,7 @@
|
|
10274
10848
|
<xsl:apply-templates mode="bookmarks"/>
|
10275
10849
|
</xsl:template>
|
10276
10850
|
|
10277
|
-
<xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
|
10851
|
+
<xsl:template match="*[local-name() = 'title' or local-name() = 'name' or local-name() = 'fmt-title' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
|
10278
10852
|
<xsl:apply-templates select="."/>
|
10279
10853
|
</xsl:template>
|
10280
10854
|
|
@@ -10287,6 +10861,10 @@
|
|
10287
10861
|
<xsl:apply-templates mode="contents"/>
|
10288
10862
|
</xsl:template>
|
10289
10863
|
|
10864
|
+
<xsl:template match="*[local-name() = 'semx']" mode="contents">
|
10865
|
+
<xsl:apply-templates mode="contents"/>
|
10866
|
+
</xsl:template>
|
10867
|
+
|
10290
10868
|
<xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
10291
10869
|
<xsl:apply-templates mode="bookmarks"/>
|
10292
10870
|
</xsl:template>
|
@@ -10296,9 +10874,14 @@
|
|
10296
10874
|
<xsl:apply-templates mode="bookmarks"/>
|
10297
10875
|
</xsl:template>
|
10298
10876
|
|
10877
|
+
<xsl:template match="*[local-name() = 'semx']" mode="bookmarks">
|
10878
|
+
<xsl:apply-templates mode="bookmarks"/>
|
10879
|
+
</xsl:template>
|
10880
|
+
|
10299
10881
|
<!-- Bookmarks -->
|
10300
10882
|
<xsl:template name="addBookmarks">
|
10301
10883
|
<xsl:param name="contents"/>
|
10884
|
+
<xsl:param name="contents_addon"/>
|
10302
10885
|
<xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
|
10303
10886
|
<xsl:if test="$contents_nodes//item">
|
10304
10887
|
<fo:bookmark-tree>
|
@@ -10396,6 +10979,9 @@
|
|
10396
10979
|
</xsl:otherwise>
|
10397
10980
|
</xsl:choose>
|
10398
10981
|
|
10982
|
+
<!-- for $namespace = 'nist-sp' $namespace = 'ogc' $namespace = 'ogc-white-paper' -->
|
10983
|
+
<xsl:copy-of select="$contents_addon"/>
|
10984
|
+
|
10399
10985
|
</fo:bookmark-tree>
|
10400
10986
|
</xsl:if>
|
10401
10987
|
</xsl:template>
|
@@ -10549,6 +11135,16 @@
|
|
10549
11135
|
<!-- ====== -->
|
10550
11136
|
<!-- ====== -->
|
10551
11137
|
<xsl:template match="*[local-name() = 'title']" mode="contents_item">
|
11138
|
+
<xsl:param name="mode">bookmarks</xsl:param>
|
11139
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-title'])">
|
11140
|
+
<xsl:apply-templates mode="contents_item">
|
11141
|
+
<xsl:with-param name="mode" select="$mode"/>
|
11142
|
+
</xsl:apply-templates>
|
11143
|
+
<!-- <xsl:text> </xsl:text> -->
|
11144
|
+
</xsl:if>
|
11145
|
+
</xsl:template>
|
11146
|
+
|
11147
|
+
<xsl:template match="*[local-name() = 'fmt-title']" mode="contents_item">
|
10552
11148
|
<xsl:param name="mode">bookmarks</xsl:param>
|
10553
11149
|
<xsl:apply-templates mode="contents_item">
|
10554
11150
|
<xsl:with-param name="mode" select="$mode"/>
|
@@ -10556,12 +11152,38 @@
|
|
10556
11152
|
<!-- <xsl:text> </xsl:text> -->
|
10557
11153
|
</xsl:template>
|
10558
11154
|
|
11155
|
+
<xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim']" mode="contents_item" priority="3">
|
11156
|
+
<xsl:apply-templates mode="contents_item"/>
|
11157
|
+
</xsl:template>
|
11158
|
+
|
11159
|
+
<xsl:template match="*[local-name() = 'semx']" mode="contents_item">
|
11160
|
+
<xsl:apply-templates mode="contents_item"/>
|
11161
|
+
</xsl:template>
|
11162
|
+
|
11163
|
+
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="contents_item"/>
|
11164
|
+
|
10559
11165
|
<xsl:template name="getSection">
|
10560
|
-
<xsl:
|
11166
|
+
<xsl:choose>
|
11167
|
+
<xsl:when test="*[local-name() = 'fmt-title']">
|
11168
|
+
<xsl:variable name="fmt_title_section">
|
11169
|
+
<xsl:copy-of select="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']][1]/preceding-sibling::node()[not(local-name() = 'review')]"/>
|
11170
|
+
</xsl:variable>
|
11171
|
+
<xsl:value-of select="normalize-space($fmt_title_section)"/>
|
11172
|
+
</xsl:when>
|
11173
|
+
<xsl:otherwise>
|
11174
|
+
<xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
11175
|
+
</xsl:otherwise>
|
11176
|
+
</xsl:choose>
|
10561
11177
|
</xsl:template>
|
10562
11178
|
|
10563
11179
|
<xsl:template name="getName">
|
10564
11180
|
<xsl:choose>
|
11181
|
+
<xsl:when test="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']]">
|
11182
|
+
<xsl:copy-of select="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']][1]/following-sibling::node()"/>
|
11183
|
+
</xsl:when>
|
11184
|
+
<xsl:when test="*[local-name() = 'fmt-title']">
|
11185
|
+
<xsl:copy-of select="*[local-name() = 'fmt-title']/node()"/>
|
11186
|
+
</xsl:when>
|
10565
11187
|
<xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
|
10566
11188
|
<xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
|
10567
11189
|
</xsl:when>
|
@@ -10668,6 +11290,15 @@
|
|
10668
11290
|
</xsl:template>
|
10669
11291
|
|
10670
11292
|
<xsl:template match="*[local-name() = 'name']" mode="contents_item">
|
11293
|
+
<xsl:param name="mode">bookmarks</xsl:param>
|
11294
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
|
11295
|
+
<xsl:apply-templates mode="contents_item">
|
11296
|
+
<xsl:with-param name="mode" select="$mode"/>
|
11297
|
+
</xsl:apply-templates>
|
11298
|
+
</xsl:if>
|
11299
|
+
</xsl:template>
|
11300
|
+
|
11301
|
+
<xsl:template match="*[local-name() = 'fmt-name']" mode="contents_item">
|
10671
11302
|
<xsl:param name="mode">bookmarks</xsl:param>
|
10672
11303
|
<xsl:apply-templates mode="contents_item">
|
10673
11304
|
<xsl:with-param name="mode" select="$mode"/>
|
@@ -11504,107 +12135,55 @@
|
|
11504
12135
|
-->
|
11505
12136
|
<xsl:template match="*[local-name() = 'example']">
|
11506
12137
|
|
11507
|
-
|
11508
|
-
|
11509
|
-
<xsl:call-template name="setBlockSpanAll"/>
|
11510
|
-
|
11511
|
-
<xsl:call-template name="refine_example-style"/>
|
11512
|
-
|
11513
|
-
<xsl:variable name="fo_element">
|
11514
|
-
<xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
|
11515
|
-
list
|
11516
|
-
</xsl:variable>
|
11517
|
-
|
11518
|
-
<fo:block-container margin-left="0mm" role="SKIP">
|
11519
|
-
|
11520
|
-
<xsl:choose>
|
12138
|
+
<fo:block id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
|
12139
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
11521
12140
|
|
11522
|
-
<xsl:
|
12141
|
+
<xsl:call-template name="refine_example-style"/>
|
11523
12142
|
|
11524
|
-
|
11525
|
-
<
|
11526
|
-
<xsl:
|
11527
|
-
<xsl:
|
11528
|
-
</xsl:
|
11529
|
-
|
12143
|
+
<xsl:variable name="ol_adjust">
|
12144
|
+
<xsl:choose>
|
12145
|
+
<xsl:when test="$vertical_layout = 'true' and ancestor::*[local-name() = 'ol']/@provisional-distance-between-starts">
|
12146
|
+
<xsl:value-of select="number(translate(ancestor::*[local-name() = 'ol']/@provisional-distance-between-starts, 'mm', ''))"/>
|
12147
|
+
</xsl:when>
|
12148
|
+
<xsl:otherwise>0</xsl:otherwise>
|
12149
|
+
</xsl:choose>
|
12150
|
+
</xsl:variable>
|
12151
|
+
<xsl:variable name="provisional_distance_between_starts_">
|
12152
|
+
<xsl:value-of select="10 + $text_indent - $ol_adjust"/>
|
12153
|
+
</xsl:variable>
|
12154
|
+
<xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
|
12155
|
+
<xsl:variable name="indent_">
|
12156
|
+
<xsl:value-of select="$text_indent"/>
|
12157
|
+
</xsl:variable>
|
12158
|
+
<xsl:variable name="indent" select="normalize-space($indent_)"/>
|
11530
12159
|
|
11531
|
-
|
11532
|
-
|
11533
|
-
|
12160
|
+
<fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
|
12161
|
+
<xsl:if test="$vertical_layout = 'true'">
|
12162
|
+
<xsl:attribute name="provisional-distance-between-starts"><xsl:value-of select="$provisional_distance_between_starts + 2"/>mm</xsl:attribute>
|
12163
|
+
</xsl:if>
|
12164
|
+
<fo:list-item>
|
12165
|
+
<fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
|
12166
|
+
<xsl:if test="$vertical_layout = 'true'">
|
12167
|
+
<xsl:attribute name="start-indent">0mm</xsl:attribute>
|
12168
|
+
</xsl:if>
|
12169
|
+
<fo:block>
|
12170
|
+
<xsl:apply-templates select="*[local-name()='name']">
|
12171
|
+
<xsl:with-param name="fo_element">block</xsl:with-param>
|
12172
|
+
</xsl:apply-templates>
|
12173
|
+
</fo:block>
|
12174
|
+
</fo:list-item-label>
|
12175
|
+
<fo:list-item-body start-indent="body-start()">
|
12176
|
+
<fo:block>
|
11534
12177
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
|
11535
|
-
<xsl:with-param name="fo_element" select="
|
12178
|
+
<xsl:with-param name="fo_element" select="'list'"/>
|
11536
12179
|
</xsl:apply-templates>
|
11537
|
-
</
|
11538
|
-
|
11539
|
-
|
11540
|
-
|
11541
|
-
</xsl:when>
|
11542
|
-
<xsl:otherwise><fo:block/><!-- prevent empty block-container --></xsl:otherwise>
|
11543
|
-
</xsl:choose>
|
11544
|
-
</fo:block-container>
|
11545
|
-
</fo:block-container>
|
11546
|
-
</xsl:when> <!-- end block -->
|
11547
|
-
|
11548
|
-
<xsl:when test="contains(normalize-space($fo_element), 'list')">
|
11549
|
-
|
11550
|
-
<xsl:variable name="provisional_distance_between_starts_">
|
11551
|
-
<xsl:value-of select="10 + $text_indent"/>
|
11552
|
-
</xsl:variable>
|
11553
|
-
<xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
|
11554
|
-
<xsl:variable name="indent_">
|
11555
|
-
<xsl:value-of select="$text_indent"/>
|
11556
|
-
</xsl:variable>
|
11557
|
-
<xsl:variable name="indent" select="normalize-space($indent_)"/>
|
11558
|
-
|
11559
|
-
<fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
|
11560
|
-
<fo:list-item>
|
11561
|
-
<fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
|
11562
|
-
<fo:block>
|
11563
|
-
<xsl:apply-templates select="*[local-name()='name']">
|
11564
|
-
<xsl:with-param name="fo_element">block</xsl:with-param>
|
11565
|
-
</xsl:apply-templates>
|
11566
|
-
</fo:block>
|
11567
|
-
</fo:list-item-label>
|
11568
|
-
<fo:list-item-body start-indent="body-start()">
|
11569
|
-
<fo:block>
|
11570
|
-
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
|
11571
|
-
<xsl:with-param name="fo_element" select="$fo_element"/>
|
11572
|
-
</xsl:apply-templates>
|
11573
|
-
</fo:block>
|
11574
|
-
</fo:list-item-body>
|
11575
|
-
</fo:list-item>
|
11576
|
-
</fo:list-block>
|
11577
|
-
</xsl:when> <!-- end list -->
|
11578
|
-
|
11579
|
-
<xsl:otherwise> <!-- inline -->
|
11580
|
-
|
11581
|
-
<!-- display 'EXAMPLE' and first element in the same line -->
|
11582
|
-
<fo:block>
|
11583
|
-
<xsl:apply-templates select="*[local-name()='name']">
|
11584
|
-
<xsl:with-param name="fo_element" select="$fo_element"/>
|
11585
|
-
</xsl:apply-templates>
|
11586
|
-
<fo:inline>
|
11587
|
-
<xsl:apply-templates select="*[not(local-name() = 'name')][1]">
|
11588
|
-
<xsl:with-param name="fo_element" select="$fo_element"/>
|
11589
|
-
</xsl:apply-templates>
|
11590
|
-
</fo:inline>
|
11591
|
-
</fo:block>
|
12180
|
+
</fo:block>
|
12181
|
+
</fo:list-item-body>
|
12182
|
+
</fo:list-item>
|
12183
|
+
</fo:list-block>
|
11592
12184
|
|
11593
|
-
|
11594
|
-
<!-- display further elements in blocks -->
|
11595
|
-
<fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
|
11596
|
-
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
11597
|
-
<xsl:apply-templates select="*[not(local-name() = 'name')][position() > 1]">
|
11598
|
-
<xsl:with-param name="fo_element" select="'block'"/>
|
11599
|
-
</xsl:apply-templates>
|
11600
|
-
</fo:block-container>
|
11601
|
-
</fo:block-container>
|
11602
|
-
</xsl:if>
|
11603
|
-
</xsl:otherwise> <!-- end inline -->
|
12185
|
+
</fo:block>
|
11604
12186
|
|
11605
|
-
</xsl:choose>
|
11606
|
-
</fo:block-container>
|
11607
|
-
</fo:block-container>
|
11608
12187
|
</xsl:template>
|
11609
12188
|
|
11610
12189
|
<xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
|
@@ -11619,9 +12198,7 @@
|
|
11619
12198
|
<xsl:when test="contains(normalize-space($fo_element), 'block')">
|
11620
12199
|
<fo:block xsl:use-attribute-sets="example-name-style">
|
11621
12200
|
|
11622
|
-
<xsl:
|
11623
|
-
<xsl:attribute name="font-family">IPAexGothic</xsl:attribute>
|
11624
|
-
</xsl:if>
|
12201
|
+
<xsl:call-template name="refine_example-name-style"/>
|
11625
12202
|
|
11626
12203
|
<xsl:apply-templates/>
|
11627
12204
|
</fo:block>
|
@@ -11992,6 +12569,13 @@
|
|
11992
12569
|
|
11993
12570
|
</xsl:template> <!-- tab -->
|
11994
12571
|
|
12572
|
+
<xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
|
12573
|
+
<xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
|
12574
|
+
|
12575
|
+
<xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab">
|
12576
|
+
|
12577
|
+
</xsl:template>
|
12578
|
+
|
11995
12579
|
<xsl:template name="insertNonBreakSpaces">
|
11996
12580
|
<xsl:param name="count"/>
|
11997
12581
|
<xsl:if test="$count > 0">
|
@@ -12604,26 +13188,7 @@
|
|
12604
13188
|
<xsl:template name="refine_list-style_provisional-distance-between-starts">
|
12605
13189
|
|
12606
13190
|
<xsl:if test="local-name() = 'ol' and $vertical_layout = 'true' and @type = 'arabic'">
|
12607
|
-
<xsl:
|
12608
|
-
<xsl:for-each select="*[local-name() = 'li']"><label_len><xsl:value-of select="string-length(@label)"/></label_len></xsl:for-each>
|
12609
|
-
</xsl:variable>
|
12610
|
-
<xsl:variable name="max_len_label_">
|
12611
|
-
<xsl:for-each select="xalan:nodeset($labels)//*">
|
12612
|
-
<xsl:sort select="." data-type="number" order="descending"/>
|
12613
|
-
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
|
12614
|
-
</xsl:for-each>
|
12615
|
-
</xsl:variable>
|
12616
|
-
<xsl:variable name="max_len_label" select="number($max_len_label_)"/>
|
12617
|
-
<xsl:attribute name="provisional-distance-between-starts">
|
12618
|
-
<xsl:choose>
|
12619
|
-
<xsl:when test="$max_len_label = 1">8.5mm</xsl:when>
|
12620
|
-
<xsl:when test="$max_len_label = 2">12mm</xsl:when>
|
12621
|
-
<xsl:when test="$max_len_label = 3">20mm</xsl:when>
|
12622
|
-
<xsl:otherwise>
|
12623
|
-
<xsl:value-of select="3 + number($max_len_label) * 4"/>mm
|
12624
|
-
</xsl:otherwise>
|
12625
|
-
</xsl:choose>
|
12626
|
-
</xsl:attribute>
|
13191
|
+
<xsl:copy-of select="@provisional-distance-between-starts"/> <!-- add in update_xml_step1 -->
|
12627
13192
|
</xsl:if>
|
12628
13193
|
|
12629
13194
|
</xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
|
@@ -13004,7 +13569,12 @@
|
|
13004
13569
|
<xsl:template match="*[local-name() = 'references']">
|
13005
13570
|
<xsl:if test="not(ancestor::*[local-name() = 'annex'])">
|
13006
13571
|
|
13007
|
-
<
|
13572
|
+
<xsl:choose>
|
13573
|
+
<xsl:when test="following-sibling::*[local-name() = 'references'] or preceding-sibling::*[local-name() = 'references']"/>
|
13574
|
+
<xsl:otherwise>
|
13575
|
+
<fo:block break-after="page"/>
|
13576
|
+
</xsl:otherwise>
|
13577
|
+
</xsl:choose>
|
13008
13578
|
|
13009
13579
|
</xsl:if>
|
13010
13580
|
|
@@ -13601,6 +14171,10 @@
|
|
13601
14171
|
<!-- - Remove semantic xml part -->
|
13602
14172
|
<!-- - Remove image/emf (EMF vector image for Word) -->
|
13603
14173
|
<!-- - add @id, redundant for table auto-layout algorithm -->
|
14174
|
+
<!-- - process 'passthrough' element -->
|
14175
|
+
<!-- - split math by element with @linebreak into maths -->
|
14176
|
+
<!-- - rename fmt-title to title, fmt-name to name and another changes to convert new presentation XML to -->
|
14177
|
+
<!-- - old XML without significant changes in XSLT -->
|
13604
14178
|
<!-- =========================================================================== -->
|
13605
14179
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
13606
14180
|
<xsl:copy>
|
@@ -13608,6 +14182,12 @@
|
|
13608
14182
|
</xsl:copy>
|
13609
14183
|
</xsl:template>
|
13610
14184
|
|
14185
|
+
<xsl:template match="@*|node()" mode="update_xml_pres">
|
14186
|
+
<xsl:copy>
|
14187
|
+
<xsl:apply-templates select="@*|node()" mode="update_xml_pres"/>
|
14188
|
+
</xsl:copy>
|
14189
|
+
</xsl:template>
|
14190
|
+
|
13611
14191
|
<!-- change section's order based on @displayorder value -->
|
13612
14192
|
<xsl:template match="*[local-name() = 'preface']" mode="update_xml_step1">
|
13613
14193
|
<xsl:copy>
|
@@ -13684,7 +14264,7 @@
|
|
13684
14264
|
</xsl:template>
|
13685
14265
|
|
13686
14266
|
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
13687
|
-
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
|
14267
|
+
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
|
13688
14268
|
<xsl:copy>
|
13689
14269
|
<xsl:copy-of select="@*"/>
|
13690
14270
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -13703,14 +14283,17 @@
|
|
13703
14283
|
|
13704
14284
|
<!-- remove semantic xml -->
|
13705
14285
|
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
|
14286
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_pres"/>
|
13706
14287
|
|
13707
14288
|
<!-- remove image/emf -->
|
13708
14289
|
<xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
|
14290
|
+
<xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_pres"/>
|
13709
14291
|
|
13710
14292
|
<!-- remove preprocess-xslt -->
|
13711
14293
|
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
|
14294
|
+
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_pres"/>
|
13712
14295
|
|
13713
|
-
<xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
14296
|
+
<xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
13714
14297
|
<xsl:copy-of select="."/>
|
13715
14298
|
</xsl:template>
|
13716
14299
|
|
@@ -13792,6 +14375,77 @@
|
|
13792
14375
|
<xsl:copy-of select="$maths"/>
|
13793
14376
|
</xsl:template>
|
13794
14377
|
|
14378
|
+
<!-- update new Presentation XML -->
|
14379
|
+
<xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="update_xml_step1"/>
|
14380
|
+
<xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="update_xml_pres"/>
|
14381
|
+
<xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_step1"/>
|
14382
|
+
<xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_pres"/>
|
14383
|
+
<xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
|
14384
|
+
<xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_pres"/>
|
14385
|
+
|
14386
|
+
<xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_step1">
|
14387
|
+
<xsl:copy>
|
14388
|
+
<xsl:apply-templates select="@*" mode="update_xml_step1"/>
|
14389
|
+
<xsl:copy-of select="preceding-sibling::*[1][local-name() = 'section-title']/@depth"/>
|
14390
|
+
<xsl:apply-templates select="node()" mode="update_xml_step1"/>
|
14391
|
+
</xsl:copy>
|
14392
|
+
</xsl:template>
|
14393
|
+
<xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_pres">
|
14394
|
+
<xsl:copy>
|
14395
|
+
<xsl:apply-templates select="@*" mode="update_xml_pres"/>
|
14396
|
+
<xsl:copy-of select="preceding-sibling::*[1][local-name() = 'section-title']/@depth"/>
|
14397
|
+
<xsl:apply-templates select="node()" mode="update_xml_pres"/>
|
14398
|
+
</xsl:copy>
|
14399
|
+
</xsl:template>
|
14400
|
+
|
14401
|
+
<xsl:template match="*[local-name() = 'fmt-title']"/>
|
14402
|
+
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
|
14403
|
+
<xsl:element name="title" namespace="{$namespace_full}">
|
14404
|
+
<xsl:copy-of select="@*"/>
|
14405
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
14406
|
+
</xsl:element>
|
14407
|
+
</xsl:template>
|
14408
|
+
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
|
14409
|
+
<xsl:element name="title" namespace="{$namespace_full}">
|
14410
|
+
<xsl:copy-of select="@*"/>
|
14411
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
14412
|
+
</xsl:element>
|
14413
|
+
</xsl:template>
|
14414
|
+
|
14415
|
+
<xsl:template match="*[local-name() = 'fmt-name']"/>
|
14416
|
+
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
|
14417
|
+
<xsl:element name="name" namespace="{$namespace_full}">
|
14418
|
+
<xsl:copy-of select="@*"/>
|
14419
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
14420
|
+
</xsl:element>
|
14421
|
+
</xsl:template>
|
14422
|
+
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_pres">
|
14423
|
+
<xsl:element name="name" namespace="{$namespace_full}">
|
14424
|
+
<xsl:copy-of select="@*"/>
|
14425
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
14426
|
+
</xsl:element>
|
14427
|
+
</xsl:template>
|
14428
|
+
|
14429
|
+
<xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
|
14430
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
14431
|
+
</xsl:template>
|
14432
|
+
<xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_pres" priority="3">
|
14433
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
14434
|
+
</xsl:template>
|
14435
|
+
|
14436
|
+
<xsl:template match="*[local-name() = 'semx']" mode="update_xml_step1">
|
14437
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
14438
|
+
</xsl:template>
|
14439
|
+
<xsl:template match="*[local-name() = 'semx']" mode="update_xml_pres">
|
14440
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
14441
|
+
</xsl:template>
|
14442
|
+
|
14443
|
+
<xsl:template match="*[local-name() = 'fmt-xref-label']"/>
|
14444
|
+
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_step1"/>
|
14445
|
+
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_pres"/>
|
14446
|
+
|
14447
|
+
<!-- END: update new Presentation XML -->
|
14448
|
+
|
13795
14449
|
<!-- =========================================================================== -->
|
13796
14450
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
13797
14451
|
<!-- =========================================================================== -->
|
@@ -14088,7 +14742,7 @@
|
|
14088
14742
|
<xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
|
14089
14743
|
<xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
|
14090
14744
|
|
14091
|
-
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
14745
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::*[local-name() = 'name'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
14092
14746
|
|
14093
14747
|
<xsl:variable name="parent" select="local-name(..)"/>
|
14094
14748
|
|
@@ -14670,6 +15324,7 @@
|
|
14670
15324
|
</pdf:catalog>
|
14671
15325
|
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
14672
15326
|
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
15327
|
+
<!-- Commented after upgrade to Apache FOP 2.10
|
14673
15328
|
<rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" rdf:about="">
|
14674
15329
|
<pdfaExtension:schemas>
|
14675
15330
|
<rdf:Bag>
|
@@ -14702,7 +15357,7 @@
|
|
14702
15357
|
</rdf:li>
|
14703
15358
|
</rdf:Bag>
|
14704
15359
|
</pdfaExtension:schemas>
|
14705
|
-
</rdf:Description>
|
15360
|
+
</rdf:Description> -->
|
14706
15361
|
<rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
|
14707
15362
|
<!-- Dublin Core properties go here -->
|
14708
15363
|
<dc:title>
|
@@ -14749,7 +15404,7 @@
|
|
14749
15404
|
<xsl:variable name="dc_description">
|
14750
15405
|
<xsl:variable name="abstract">
|
14751
15406
|
|
14752
|
-
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
|
15407
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'fmt-title']) and not(ancestor::*[local-name() = 'title']) and not(ancestor::*[local-name() = 'fmt-xref-label'])]"/>
|
14753
15408
|
|
14754
15409
|
</xsl:variable>
|
14755
15410
|
<rdf:Alt>
|
@@ -15292,31 +15947,123 @@
|
|
15292
15947
|
|
15293
15948
|
<!-- END: insert cover page image -->
|
15294
15949
|
|
15295
|
-
|
15950
|
+
<!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
|
15951
|
+
<xsl:variable name="regex_ja_spec_">[
|
15952
|
+
<!-- Rotate 90° clockwise -->
|
15953
|
+
\u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
|
15954
|
+
\uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
|
15955
|
+
\u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
|
15956
|
+
\uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
|
15957
|
+
\u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
|
15958
|
+
\uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
|
15959
|
+
\u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
|
15960
|
+
\uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
|
15961
|
+
\u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
|
15962
|
+
\u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
|
15963
|
+
\u3010 <!-- U+3010 LEFT BLACK LENTICULAR BRACKET (【) -->
|
15964
|
+
\u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
|
15965
|
+
\u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
|
15966
|
+
\u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
|
15967
|
+
\uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
|
15968
|
+
\u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
|
15969
|
+
\uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
|
15970
|
+
\u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
|
15971
|
+
\u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
|
15972
|
+
\u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
|
15973
|
+
\u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
|
15974
|
+
\uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
|
15975
|
+
\u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
|
15976
|
+
\uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
|
15977
|
+
\u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
|
15978
|
+
\u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
|
15979
|
+
\u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
|
15980
|
+
\u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
|
15981
|
+
|
15982
|
+
\u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
|
15983
|
+
\u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
|
15984
|
+
\u301C <!-- U+301C WAVE DASH (〜) -->
|
15985
|
+
\u3030 <!-- U+3030 WAVY DASH (〰 )-->
|
15986
|
+
\u30FC <!-- U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK (ー) -->
|
15987
|
+
\u2329 <!-- U+2329 LEFT-POINTING ANGLE BRACKET (〈) -->
|
15988
|
+
\u232A <!-- U+232A RIGHT-POINTING ANGLE BRACKET (〉) -->
|
15989
|
+
\u3018 <!-- U+3018 LEFT WHITE TORTOISE SHELL BRACKET (〘) -->
|
15990
|
+
\u3019 <!-- U+3019 RIGHT WHITE TORTOISE SHELL BRACKET (〙) -->
|
15991
|
+
\u30A0 <!-- U+30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN (゠) -->
|
15992
|
+
\uFE59 <!-- U+FE59 SMALL LEFT PARENTHESIS (﹙) -->
|
15993
|
+
\uFE5A <!-- U+FE5A SMALL RIGHT PARENTHESIS (﹚) -->
|
15994
|
+
\uFE5B <!-- U+FE5B SMALL LEFT CURLY BRACKET (﹛) -->
|
15995
|
+
\uFE5C <!-- U+FE5C SMALL RIGHT CURLY BRACKET (﹜) -->
|
15996
|
+
\uFE5D <!-- U+FE5D SMALL LEFT TORTOISE SHELL BRACKET (﹝) -->
|
15997
|
+
\uFE5E <!-- U+FE5E SMALL RIGHT TORTOISE SHELL BRACKET (﹞) -->
|
15998
|
+
\uFF5C <!-- U+FF5C FULLWIDTH VERTICAL LINE (|) -->
|
15999
|
+
\uFF5F <!-- U+FF5F FULLWIDTH LEFT WHITE PARENTHESIS (⦅) -->
|
16000
|
+
\uFF60 <!-- U+FF60 FULLWIDTH RIGHT WHITE PARENTHESIS (⦆) -->
|
16001
|
+
\uFFE3 <!-- U+FFE3 FULLWIDTH MACRON ( ̄) -->
|
16002
|
+
\uFF3F <!-- U+FF3F FULLWIDTH LOW LINE (_) -->
|
16003
|
+
\uFF5E <!-- U+FF5E FULLWIDTH TILDE (~) -->
|
16004
|
+
<!-- Rotate 180° -->
|
16005
|
+
\u309C <!-- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜) -->
|
16006
|
+
\u3002 <!-- U+3002 IDEOGRAPHIC FULL STOP (。) -->
|
16007
|
+
\uFE52 <!-- U+FE52 SMALL FULL STOP (﹒) -->
|
16008
|
+
\uFF0E <!-- U+FF0E FULLWIDTH FULL STOP (.) -->
|
16009
|
+
]</xsl:variable>
|
16010
|
+
<xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
|
15296
16011
|
<xsl:template name="insertVerticalChar">
|
15297
16012
|
<xsl:param name="str"/>
|
15298
16013
|
<xsl:param name="writing-mode">lr-tb</xsl:param>
|
15299
16014
|
<xsl:param name="reference-orientation">90</xsl:param>
|
15300
|
-
<xsl:
|
15301
|
-
|
15302
|
-
|
15303
|
-
|
15304
|
-
|
15305
|
-
|
15306
|
-
<xsl:
|
15307
|
-
|
15308
|
-
<xsl:
|
16015
|
+
<xsl:param name="add_zero_width_space">false</xsl:param>
|
16016
|
+
<xsl:choose>
|
16017
|
+
<xsl:when test="ancestor::*[local-name() = 'span'][@class = 'norotate']">
|
16018
|
+
<xsl:value-of select="$str"/>
|
16019
|
+
</xsl:when>
|
16020
|
+
<xsl:otherwise>
|
16021
|
+
<xsl:if test="string-length($str) > 0">
|
16022
|
+
<xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
|
16023
|
+
<xsl:variable name="char" select="substring($str,1,1)"/>
|
16024
|
+
<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">
|
16025
|
+
<xsl:if test="normalize-space($writing-mode) != ''">
|
16026
|
+
<xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
|
16027
|
+
<xsl:attribute name="reference-orientation">90</xsl:attribute>
|
16028
|
+
</xsl:if>
|
16029
|
+
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
|
16030
|
+
<xsl:attribute name="reference-orientation">0</xsl:attribute>
|
16031
|
+
</xsl:if>
|
16032
|
+
<xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
|
16033
|
+
<!-- Rotate 180°:
|
16034
|
+
U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
|
16035
|
+
U+3002 IDEOGRAPHIC FULL STOP (。)
|
16036
|
+
U+FE52 SMALL FULL STOP (﹒)
|
16037
|
+
U+FF0E FULLWIDTH FULL STOP (.)
|
16038
|
+
-->
|
16039
|
+
<xsl:attribute name="reference-orientation">-90</xsl:attribute>
|
16040
|
+
</xsl:if>
|
16041
|
+
<fo:block-container width="1em">
|
16042
|
+
<fo:block line-height="1em">
|
16043
|
+
<xsl:choose>
|
16044
|
+
<xsl:when test="$horizontal_mode = 'true'">
|
16045
|
+
<xsl:value-of select="$str"/>
|
16046
|
+
</xsl:when>
|
16047
|
+
<xsl:otherwise>
|
16048
|
+
<xsl:value-of select="$char"/>
|
16049
|
+
</xsl:otherwise>
|
16050
|
+
</xsl:choose>
|
16051
|
+
</fo:block>
|
16052
|
+
</fo:block-container>
|
16053
|
+
</fo:inline-container>
|
16054
|
+
<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>
|
16055
|
+
|
16056
|
+
<xsl:if test="$horizontal_mode = 'false'">
|
16057
|
+
<xsl:call-template name="insertVerticalChar">
|
16058
|
+
<xsl:with-param name="str" select="substring($str, 2)"/>
|
16059
|
+
<xsl:with-param name="writing-mode" select="$writing-mode"/>
|
16060
|
+
<xsl:with-param name="reference-orientation" select="$reference-orientation"/>
|
16061
|
+
<xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
|
16062
|
+
</xsl:call-template>
|
16063
|
+
</xsl:if>
|
15309
16064
|
</xsl:if>
|
15310
|
-
|
15311
|
-
|
15312
|
-
</fo:block-container>
|
15313
|
-
</fo:inline-container>
|
15314
|
-
<xsl:call-template name="insertVerticalChar">
|
15315
|
-
<xsl:with-param name="str" select="substring($str, 2)"/>
|
15316
|
-
<xsl:with-param name="writing-mode" select="$writing-mode"/>
|
15317
|
-
<xsl:with-param name="reference-orientation" select="$reference-orientation"/>
|
15318
|
-
</xsl:call-template>
|
15319
|
-
</xsl:if>
|
16065
|
+
</xsl:otherwise>
|
16066
|
+
</xsl:choose>
|
15320
16067
|
</xsl:template>
|
15321
16068
|
|
15322
16069
|
<xsl:template name="number-to-words">
|