metanorma-iso 2.8.9 → 2.9.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.
@@ -1898,7 +1898,7 @@
1898
1898
  </fo:table-cell>
1899
1899
  <fo:table-cell number-columns-spanned="2" display-align="after" padding-left="6mm">
1900
1900
  <fo:block font-size="19pt" font-weight="bold" line-height="1">
1901
- <xsl:if test="$stage &gt;=60">
1901
+ <xsl:if test="$stage &gt;=60 and $substage != 0">
1902
1902
  <xsl:attribute name="color"><xsl:value-of select="$color_red"/></xsl:attribute>
1903
1903
  </xsl:if>
1904
1904
  <xsl:value-of select="$docidentifierISO"/>
@@ -1924,7 +1924,7 @@
1924
1924
  <xsl:call-template name="insertTitlesLangMain"/>
1925
1925
  </fo:block>
1926
1926
 
1927
- <xsl:if test="not($stage-abbreviation = 'FDAMD' or $stage-abbreviation = 'FDAM')">
1927
+ <xsl:if test="not($stage-abbreviation = 'FDAMD' or $stage-abbreviation = 'FDAM' or $stage-abbreviation = 'PRF')">
1928
1928
  <xsl:for-each select="xalan:nodeset($lang_other)/lang">
1929
1929
  <xsl:variable name="lang_other" select="."/>
1930
1930
  <fo:block font-size="12pt" role="SKIP"><xsl:value-of select="$linebreak"/></fo:block>
@@ -1961,7 +1961,7 @@
1961
1961
  </xsl:if>
1962
1962
 
1963
1963
  <xsl:if test="$doctype = 'amendment'"> <!-- and not($stage-abbreviation = 'FDAMD' or $stage-abbreviation = 'FDAM') -->
1964
- <fo:block font-size="18pt" font-weight="bold" margin-bottom="3mm">
1964
+ <fo:block font-size="15pt" font-weight="bold" margin-bottom="3mm">
1965
1965
  <xsl:value-of select="$doctype_uppercased"/>
1966
1966
  <xsl:text> </xsl:text>
1967
1967
  <xsl:variable name="amendment-number" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:project-number/@amendment"/>
@@ -2030,7 +2030,10 @@
2030
2030
  <xsl:variable name="additionalNotes">
2031
2031
  <xsl:call-template name="insertCoverPageAdditionalNotes"/>
2032
2032
  </xsl:variable>
2033
- <xsl:if test="normalize-space($additionalNotes) != '' or $stage-abbreviation = 'PRF'">
2033
+
2034
+ <xsl:variable name="feedback_link" select="normalize-space(/iso:iso-standard/iso:metanorma-extension/iso:semantic-metadata/iso:feedback-link)"/>
2035
+
2036
+ <xsl:if test="normalize-space($additionalNotes) != ''"> <!-- or $stage-abbreviation = 'PRF' -->
2034
2037
  <xsl:attribute name="display-align">center</xsl:attribute>
2035
2038
  <fo:block>
2036
2039
  <xsl:copy-of select="$additionalNotes"/>
@@ -2038,7 +2041,10 @@
2038
2041
  </xsl:if>
2039
2042
 
2040
2043
  <xsl:if test="$stage-abbreviation = 'PRF'">
2041
- <fo:block font-size="28pt" font-weight="bold">
2044
+ <fo:block font-size="34pt" font-weight="bold">
2045
+ <xsl:if test="normalize-space($additionalNotes) = '' and $feedback_link = ''">
2046
+ <xsl:attribute name="margin-bottom">3.5mm</xsl:attribute>
2047
+ </xsl:if>
2042
2048
  <xsl:call-template name="add-letter-spacing">
2043
2049
  <xsl:with-param name="text" select="$proof-text"/>
2044
2050
  <xsl:with-param name="letter-spacing" select="0.65"/>
@@ -2047,7 +2053,6 @@
2047
2053
  </xsl:if>
2048
2054
 
2049
2055
  <fo:block>
2050
- <xsl:variable name="feedback_link" select="normalize-space(/iso:iso-standard/iso:metanorma-extension/iso:semantic-metadata/iso:feedback-link)"/>
2051
2056
  <xsl:if test="$stage &gt;=60 and $feedback_link != ''">
2052
2057
  <fo:block-container width="69mm" background-color="rgb(242,242,242)" display-align="before">
2053
2058
  <fo:table table-layout="fixed" width="100%" role="SKIP">
@@ -2973,7 +2978,7 @@
2973
2978
  <xsl:when test="($stage-abbreviation = 'IS' or $stage-abbreviation = 'D') and /iso:iso-standard/iso:bibdata/iso:date[@type = 'created']">
2974
2979
  <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:date[@type = 'created']"/>
2975
2980
  </xsl:when>
2976
- <xsl:when test="$stage-abbreviation = 'IS' or $stage-abbreviation = 'published'">
2981
+ <xsl:when test="$stage-abbreviation = 'IS' or $stage-abbreviation = 'published' or $stage-abbreviation = 'PRF'">
2977
2982
  <xsl:value-of select="substring(/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date,1, 7)"/>
2978
2983
  </xsl:when>
2979
2984
  </xsl:choose>
@@ -3587,10 +3592,10 @@
3587
3592
  <!-- ============================= -->
3588
3593
 
3589
3594
  <!-- element with title -->
3590
- <xsl:template match="*[iso:title]" mode="contents">
3595
+ <xsl:template match="*[iso:title or iso:fmt-title]" mode="contents">
3591
3596
  <xsl:variable name="level">
3592
3597
  <xsl:call-template name="getLevel">
3593
- <xsl:with-param name="depth" select="iso:title/@depth"/>
3598
+ <xsl:with-param name="depth" select="iso:fmt-title/@depth | iso:title/@depth"/>
3594
3599
  </xsl:call-template>
3595
3600
  </xsl:variable>
3596
3601
 
@@ -3731,6 +3736,21 @@
3731
3736
  </xsl:choose>
3732
3737
  </xsl:template>
3733
3738
 
3739
+ <xsl:template match="iso:copyright-statement/iso:clause" priority="3">
3740
+ <fo:block role="SKIP">
3741
+ <xsl:if test="@id = 'boilerplate-copyright-default' and ../iso:clause[not(@id = 'boilerplate-copyright-default')]">
3742
+ <xsl:attribute name="color">blue</xsl:attribute>
3743
+ <xsl:attribute name="border">1pt solid blue</xsl:attribute>
3744
+ <xsl:attribute name="padding">1mm</xsl:attribute>
3745
+ </xsl:if>
3746
+ <xsl:if test="not(@id = 'boilerplate-copyright-default') and preceding-sibling::iso:clause">
3747
+ <xsl:attribute name="margin-top">5mm</xsl:attribute>
3748
+ </xsl:if>
3749
+ <xsl:copy-of select="@id"/>
3750
+ <xsl:apply-templates/>
3751
+ </fo:block>
3752
+ </xsl:template>
3753
+
3734
3754
  <xsl:template match="iso:copyright-statement//iso:p" priority="2">
3735
3755
  <xsl:choose>
3736
3756
  <xsl:when test="$layoutVersion = '1951'">
@@ -3777,7 +3797,7 @@
3777
3797
  <xsl:attribute name="margin-left">0.5mm</xsl:attribute>
3778
3798
  <xsl:attribute name="margin-right">0.5mm</xsl:attribute>
3779
3799
  </xsl:if>
3780
- <xsl:if test="contains(@id, 'address')">
3800
+ <xsl:if test="contains(@id, 'address') or contains(normalize-space(), 'Tel:') or contains(normalize-space(), 'Phone:')">
3781
3801
  <xsl:attribute name="margin-left">4.5mm</xsl:attribute>
3782
3802
  </xsl:if>
3783
3803
  <xsl:apply-templates/>
@@ -4415,6 +4435,8 @@
4415
4435
  </xsl:if>
4416
4436
  </xsl:if>
4417
4437
 
4438
+ <xsl:call-template name="addReviewHelper"/>
4439
+
4418
4440
  <xsl:call-template name="processElementContent"/>
4419
4441
  </fo:block>
4420
4442
  </xsl:template>
@@ -4431,6 +4453,8 @@
4431
4453
 
4432
4454
  <xsl:call-template name="refine_clause_style"/>
4433
4455
 
4456
+ <xsl:call-template name="addReviewHelper"/>
4457
+
4434
4458
  <xsl:call-template name="processElementContent"/>
4435
4459
 
4436
4460
  </fo:block>
@@ -5080,12 +5104,22 @@
5080
5104
  <xsl:param name="font-weight" select="'bold'"/>
5081
5105
  <xsl:attribute name="text-align">center</xsl:attribute>
5082
5106
  <xsl:attribute name="line-height">1.1</xsl:attribute>
5107
+ <xsl:if test="$stage-abbreviation = 'PRF'">
5108
+ <fo:block font-size="10pt" font-weight="bold" text-align="center">
5109
+ <xsl:value-of select="$proof-text"/>
5110
+ </fo:block>
5111
+ </xsl:if>
5083
5112
  <fo:block font-size="9pt">
5084
5113
  <!-- <xsl:call-template name="insertInterFont"/> -->
5085
5114
  <xsl:value-of select="$copyrightText"/>
5086
5115
  </fo:block>
5087
- <xsl:if test="$copyrightAbbrIEEE = ''"><fo:block> </fo:block></xsl:if>
5088
- <fo:block font-size="11pt" font-weight="{$font-weight}"><fo:page-number/></fo:block>
5116
+ <xsl:if test="$copyrightAbbrIEEE = '' and $stage-abbreviation != 'PRF'"><fo:block> </fo:block></xsl:if>
5117
+ <fo:block font-size="11pt" font-weight="{$font-weight}">
5118
+ <xsl:if test="$stage-abbreviation = 'PRF'">
5119
+ <xsl:attribute name="margin-top">1mm</xsl:attribute>
5120
+ </xsl:if>
5121
+ <fo:page-number/>
5122
+ </fo:block>
5089
5123
  </xsl:template>
5090
5124
  <xsl:template name="insertLayoutVersionAttributesTop">
5091
5125
  <xsl:param name="odd_or_even"/>
@@ -5301,7 +5335,7 @@
5301
5335
  </fo:table-cell>
5302
5336
  <fo:table-cell number-columns-spanned="2" text-align="right" display-align="after">
5303
5337
  <fo:block font-size="16pt" font-weight="bold" margin-bottom="1mm" margin-right="1.5mm">
5304
- <xsl:if test="$stage &gt;=60">
5338
+ <xsl:if test="$stage &gt;=60 and $substage != 0">
5305
5339
  <xsl:attribute name="color"><xsl:value-of select="$color_red"/></xsl:attribute>
5306
5340
  </xsl:if>
5307
5341
  <xsl:text>iso.org</xsl:text>
@@ -5341,7 +5375,7 @@
5341
5375
  <xsl:variable name="Image-ISO-Logo-SVG">
5342
5376
  <xsl:variable name="logo_color">
5343
5377
  <xsl:choose>
5344
- <xsl:when test="$stage &gt;=60"><xsl:value-of select="$color_red"/></xsl:when>
5378
+ <xsl:when test="$stage &gt;=60 and $substage != 0"><xsl:value-of select="$color_red"/></xsl:when>
5345
5379
  <xsl:otherwise>rgb(88,88,90)</xsl:otherwise>
5346
5380
  </xsl:choose>
5347
5381
  </xsl:variable>
@@ -5505,7 +5539,7 @@
5505
5539
  <fo:block id="lastBlock" font-size="1pt" keep-with-previous="always" role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block>
5506
5540
  </xsl:template>
5507
5541
 
5508
- <xsl:strip-space elements="iso:xref"/>
5542
+ <!-- <xsl:strip-space elements="iso:xref"/> -->
5509
5543
 
5510
5544
  <xsl:variable name="namespace_full" select="namespace-uri(/*)"/> <!-- example: https://www.metanorma.org/ns/iso -->
5511
5545
  <xsl:variable name="root_element" select="local-name(/*)"/> <!-- example: iso-standard -->
@@ -6718,6 +6752,10 @@
6718
6752
 
6719
6753
  <xsl:template name="refine_termnote-name-style">
6720
6754
 
6755
+ <!-- <xsl:if test="$namespace = 'ieee'">
6756
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
6757
+ </xsl:if> -->
6758
+
6721
6759
  </xsl:template>
6722
6760
 
6723
6761
  <xsl:attribute-set name="termnote-p-style">
@@ -7433,9 +7471,21 @@
7433
7471
  <xsl:template name="processTables_Contents">
7434
7472
  <tables>
7435
7473
  <xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
7436
- <table id="{@id}" alt-text="{*[local-name() = 'name']}">
7437
- <xsl:copy-of select="*[local-name() = 'name']"/>
7438
- </table>
7474
+ <xsl:choose>
7475
+ <xsl:when test="*[local-name() = 'fmt-name']">
7476
+ <xsl:variable name="fmt_name">
7477
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
7478
+ </xsl:variable>
7479
+ <table id="{@id}" alt-text="{normalize-space($fmt_name)}">
7480
+ <xsl:copy-of select="$fmt_name"/>
7481
+ </table>
7482
+ </xsl:when>
7483
+ <xsl:otherwise>
7484
+ <table id="{@id}" alt-text="{*[local-name() = 'name']}">
7485
+ <xsl:copy-of select="*[local-name() = 'name']"/>
7486
+ </table>
7487
+ </xsl:otherwise>
7488
+ </xsl:choose>
7439
7489
  </xsl:for-each>
7440
7490
  </tables>
7441
7491
  </xsl:template>
@@ -7443,9 +7493,21 @@
7443
7493
  <xsl:template name="processFigures_Contents">
7444
7494
  <figures>
7445
7495
  <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) != '']">
7446
- <figure id="{@id}" alt-text="{*[local-name() = 'name']}">
7447
- <xsl:copy-of select="*[local-name() = 'name']"/>
7448
- </figure>
7496
+ <xsl:choose>
7497
+ <xsl:when test="*[local-name() = 'fmt-name']">
7498
+ <xsl:variable name="fmt_name">
7499
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
7500
+ </xsl:variable>
7501
+ <figure id="{@id}" alt-text="{normalize-space($fmt_name)}">
7502
+ <xsl:copy-of select="$fmt_name"/>
7503
+ </figure>
7504
+ </xsl:when>
7505
+ <xsl:otherwise>
7506
+ <figure id="{@id}" alt-text="{*[local-name() = 'name']}">
7507
+ <xsl:copy-of select="*[local-name() = 'name']"/>
7508
+ </figure>
7509
+ </xsl:otherwise>
7510
+ </xsl:choose>
7449
7511
  </xsl:for-each>
7450
7512
  </figures>
7451
7513
  </xsl:template>
@@ -9357,6 +9419,11 @@
9357
9419
 
9358
9420
  <xsl:value-of select="@reference"/>
9359
9421
 
9422
+ <!-- commented https://github.com/metanorma/isodoc/issues/614 -->
9423
+ <!-- <xsl:if test="$namespace = 'itu'">
9424
+ <xsl:text>)</xsl:text>
9425
+ </xsl:if> -->
9426
+
9360
9427
  </fo:inline>
9361
9428
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
9362
9429
  <xsl:copy-of select="./node()"/>
@@ -9366,7 +9433,7 @@
9366
9433
 
9367
9434
  </xsl:if>
9368
9435
  </xsl:for-each>
9369
- </xsl:template>
9436
+ </xsl:template> <!-- table_fn_display -->
9370
9437
 
9371
9438
  <xsl:template name="create_fn">
9372
9439
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -9394,8 +9461,10 @@
9394
9461
  <!-- EMD table's footnotes rendering -->
9395
9462
  <!-- ============================ -->
9396
9463
 
9464
+ <!-- ============================ -->
9397
9465
  <!-- figure's footnotes rendering -->
9398
- <xsl:template name="fn_display_figure">
9466
+ <!-- ============================ -->
9467
+ <xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
9399
9468
 
9400
9469
  <!-- current figure id -->
9401
9470
  <xsl:variable name="figure_id_">
@@ -9508,9 +9577,28 @@
9508
9577
 
9509
9578
  </fo:block>
9510
9579
  </xsl:if>
9511
-
9512
9580
  </xsl:template> <!-- fn_display_figure -->
9513
9581
 
9582
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
9583
+ <!-- figure's footnote label -->
9584
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'dl'][@key = 'true']/*[local-name() = 'dt']/ *[local-name() = 'p'][count(node()[normalize-space() != '']) = 1]/*[local-name() = 'sup']" priority="3">
9585
+ <xsl:variable name="key_iso">
9586
+ true
9587
+ </xsl:variable>
9588
+ <xsl:if test="normalize-space($key_iso) = 'true'">
9589
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
9590
+
9591
+ </xsl:if>
9592
+ <fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
9593
+ <!-- <xsl:value-of select="@reference"/> -->
9594
+ <xsl:apply-templates/>
9595
+ </fo:inline>
9596
+ </xsl:template>
9597
+
9598
+ <!-- ============================ -->
9599
+ <!-- END: figure's footnotes rendering -->
9600
+ <!-- ============================ -->
9601
+
9514
9602
  <!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
9515
9603
  <xsl:template match="*[local-name()='fn']">
9516
9604
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
@@ -9526,6 +9614,10 @@
9526
9614
 
9527
9615
  <xsl:value-of select="@reference"/>
9528
9616
 
9617
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
9618
+ <!-- <xsl:if test="$namespace = 'jis'">
9619
+ <fo:inline font-weight="normal">)</fo:inline>
9620
+ </xsl:if> -->
9529
9621
  </fo:basic-link>
9530
9622
  </fo:inline>
9531
9623
  </xsl:template>
@@ -9656,17 +9748,22 @@
9656
9748
  </fo:block>
9657
9749
  </xsl:when> <!-- END: a few components -->
9658
9750
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
9659
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
9751
+ <!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
9752
+ <xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
9660
9753
 
9661
- <xsl:call-template name="refine_figure_key_style"/>
9754
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
9662
9755
 
9663
- <xsl:variable name="title-key">
9664
- <xsl:call-template name="getLocalizedString">
9665
- <xsl:with-param name="key">key</xsl:with-param>
9666
- </xsl:call-template>
9667
- </xsl:variable>
9668
- <xsl:value-of select="$title-key"/>
9669
- </fo:block>
9756
+ <xsl:call-template name="refine_figure_key_style"/>
9757
+
9758
+ <xsl:variable name="title-key">
9759
+ <xsl:call-template name="getLocalizedString">
9760
+ <xsl:with-param name="key">key</xsl:with-param>
9761
+ </xsl:call-template>
9762
+ </xsl:variable>
9763
+ <xsl:value-of select="$title-key"/>
9764
+ </fo:block>
9765
+
9766
+ </xsl:if>
9670
9767
  </xsl:when> <!-- END: definition list in a figure -->
9671
9768
  </xsl:choose>
9672
9769
 
@@ -9856,6 +9953,14 @@
9856
9953
 
9857
9954
  </xsl:template> <!-- END: dl -->
9858
9955
 
9956
+ <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
9957
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
9958
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
9959
+ <xsl:call-template name="refine_figure_key_style"/>
9960
+ <xsl:apply-templates/>
9961
+ </fo:block>
9962
+ </xsl:template>
9963
+
9859
9964
  <xsl:template name="refine_dl_formula_where_style">
9860
9965
 
9861
9966
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -11988,6 +12093,39 @@
11988
12093
  </xsl:copy>
11989
12094
  </xsl:template>
11990
12095
 
12096
+ <xsl:template match="@*|node()" mode="mathml_linebreak">
12097
+ <xsl:copy>
12098
+ <xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
12099
+ </xsl:copy>
12100
+ </xsl:template>
12101
+
12102
+ <!-- split math into two math -->
12103
+ <xsl:template match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
12104
+ <xsl:variable name="math_elements_tree_">
12105
+ <xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
12106
+ <element pos="{position()}">
12107
+ <xsl:copy-of select="@*[local-name() != 'id']"/>
12108
+ <xsl:value-of select="name()"/>
12109
+ </element>
12110
+ </xsl:for-each>
12111
+ </xsl:variable>
12112
+
12113
+ <xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
12114
+
12115
+ <xsl:call-template name="insertClosingElements">
12116
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
12117
+ </xsl:call-template>
12118
+
12119
+ <xsl:element name="br" namespace="{$namespace_full}"/>
12120
+
12121
+ <xsl:call-template name="insertOpeningElements">
12122
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
12123
+ <xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
12124
+ <xsl:with-param name="add_continue">false</xsl:with-param>
12125
+ </xsl:call-template>
12126
+
12127
+ </xsl:template>
12128
+
11991
12129
  <!-- Examples:
11992
12130
  <stem type="AsciiMath">x = 1</stem>
11993
12131
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -12241,9 +12379,11 @@
12241
12379
  </xsl:template>
12242
12380
 
12243
12381
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
12382
+ <!-- https://github.com/metanorma/isodoc/issues/607
12244
12383
  <xsl:if test="normalize-space() != ''">
12245
- <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
12246
- </xsl:if>
12384
+ <xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
12385
+ </xsl:if> -->
12386
+ <xsl:apply-templates/>
12247
12387
  </xsl:template>
12248
12388
 
12249
12389
  <!-- stem inside formula with name (with formula's number) -->
@@ -12314,6 +12454,8 @@
12314
12454
 
12315
12455
  <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
12316
12456
 
12457
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab"/>
12458
+
12317
12459
  <xsl:call-template name="refine_note-name-style"/>
12318
12460
 
12319
12461
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
@@ -12393,10 +12535,6 @@
12393
12535
 
12394
12536
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
12395
12537
 
12396
- <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
12397
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
12398
- </xsl:if>
12399
-
12400
12538
  <xsl:call-template name="refine_termnote-name-style"/>
12401
12539
 
12402
12540
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
@@ -12422,10 +12560,21 @@
12422
12560
  </xsl:when>
12423
12561
  <xsl:otherwise>
12424
12562
 
12563
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
12564
+ <!-- <xsl:if test="$namespace = 'ieee'">
12565
+ <xsl:text>—</xsl:text> em dash &#x2014;
12566
+ </xsl:if> -->
12567
+ <!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
12568
+ <xsl:text>:</xsl:text>
12569
+ </xsl:if> -->
12570
+
12425
12571
  <xsl:if test="$layoutVersion = '1987' and . = translate(.,'1234567890','')"> <!-- NOTE without number -->
12426
12572
  <xsl:text> — </xsl:text>
12427
12573
  </xsl:if>
12428
12574
 
12575
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
12576
+ <xsl:text> – </xsl:text> en dash &#x2013;
12577
+ </xsl:if> -->
12429
12578
  </xsl:otherwise>
12430
12579
  </xsl:choose>
12431
12580
  </xsl:variable>
@@ -12444,8 +12593,16 @@
12444
12593
  </xsl:when>
12445
12594
  <xsl:otherwise>
12446
12595
 
12596
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
12597
+ <!-- <xsl:if test="$namespace = 'ieee'">
12598
+ <xsl:text>—</xsl:text> em dash &#x2014;
12599
+ </xsl:if> -->
12600
+ <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' or $namespace = 'rsd' or $namespace = 'jcgm'">
12447
12601
  <xsl:text>:</xsl:text>
12448
-
12602
+ </xsl:if> -->
12603
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
12604
+ <xsl:text> – </xsl:text> en dash &#x2013;
12605
+ </xsl:if> -->
12449
12606
  </xsl:otherwise>
12450
12607
  </xsl:choose>
12451
12608
  </xsl:variable>
@@ -12530,17 +12687,29 @@
12530
12687
  <!-- Example: Dimensions in millimeters -->
12531
12688
  <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
12532
12689
 
12690
+ <xsl:variable name="show_figure_key_in_block_container">
12691
+ true
12692
+ </xsl:variable>
12693
+
12533
12694
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
12534
12695
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
12535
12696
  </fo:block>
12536
- <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
12537
- <xsl:call-template name="note"/>
12538
- </xsl:for-each>
12539
- <xsl:call-template name="fn_display_figure"/>
12697
+
12698
+ <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
12699
+ <xsl:call-template name="showFigureKey"/>
12700
+ </xsl:if>
12540
12701
 
12541
12702
  <xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image -->
12542
12703
 
12543
12704
  </fo:block-container>
12705
+
12706
+ </xsl:template>
12707
+
12708
+ <xsl:template name="showFigureKey">
12709
+ <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
12710
+ <xsl:call-template name="note"/>
12711
+ </xsl:for-each>
12712
+ <xsl:call-template name="fn_display_figure"/>
12544
12713
  </xsl:template>
12545
12714
 
12546
12715
  <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
@@ -12736,6 +12905,22 @@
12736
12905
  </xsl:if>
12737
12906
  </xsl:template>
12738
12907
 
12908
+ <xsl:template name="getImageSrc">
12909
+ <xsl:choose>
12910
+ <xsl:when test="not(starts-with(@src, 'data:'))">
12911
+ <xsl:choose>
12912
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12913
+ <xsl:value-of select="@src"/>
12914
+ </xsl:when>
12915
+ <xsl:otherwise>
12916
+ <xsl:value-of select="concat($basepath, @src)"/>
12917
+ </xsl:otherwise>
12918
+ </xsl:choose>
12919
+ </xsl:when>
12920
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
12921
+ </xsl:choose>
12922
+ </xsl:template>
12923
+
12739
12924
  <xsl:template name="getImageScale">
12740
12925
  <xsl:param name="indent"/>
12741
12926
  <xsl:variable name="indent_left">
@@ -12745,19 +12930,7 @@
12745
12930
  </xsl:choose>
12746
12931
  </xsl:variable>
12747
12932
  <xsl:variable name="img_src">
12748
- <xsl:choose>
12749
- <xsl:when test="not(starts-with(@src, 'data:'))">
12750
- <xsl:choose>
12751
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12752
- <xsl:value-of select="@src"/>
12753
- </xsl:when>
12754
- <xsl:otherwise>
12755
- <xsl:value-of select="concat($basepath, @src)"/>
12756
- </xsl:otherwise>
12757
- </xsl:choose>
12758
- </xsl:when>
12759
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
12760
- </xsl:choose>
12933
+ <xsl:call-template name="getImageSrc"/>
12761
12934
  </xsl:variable>
12762
12935
 
12763
12936
  <xsl:variable name="image_width_effective">
@@ -12765,10 +12938,15 @@
12765
12938
  <xsl:value-of select="$width_effective - number($indent_left)"/>
12766
12939
 
12767
12940
  </xsl:variable>
12941
+ <xsl:variable name="image_height_effective" select="$height_effective - number($indent_left)"/>
12768
12942
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
12769
12943
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
12770
12944
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
12771
- <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
12945
+ <xsl:variable name="scale">
12946
+
12947
+ <xsl:value-of select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
12948
+
12949
+ </xsl:variable>
12772
12950
  <xsl:value-of select="$scale"/>
12773
12951
  </xsl:template>
12774
12952
 
@@ -13321,20 +13499,48 @@
13321
13499
  <xsl:template match="*[local-name() = 'emf']"/>
13322
13500
 
13323
13501
  <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">
13502
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
13503
+ <xsl:apply-templates mode="contents"/>
13504
+ <xsl:text> </xsl:text>
13505
+ </xsl:if>
13506
+ </xsl:template>
13507
+
13508
+ <xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="contents"/>
13509
+
13510
+ <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">
13324
13511
  <xsl:apply-templates mode="contents"/>
13325
13512
  <xsl:text> </xsl:text>
13326
13513
  </xsl:template>
13327
13514
 
13328
13515
  <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">
13516
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
13517
+ <xsl:apply-templates mode="bookmarks"/>
13518
+ <xsl:text> </xsl:text>
13519
+ </xsl:if>
13520
+ </xsl:template>
13521
+
13522
+ <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">
13329
13523
  <xsl:apply-templates mode="bookmarks"/>
13330
13524
  <xsl:text> </xsl:text>
13331
13525
  </xsl:template>
13332
13526
 
13333
13527
  <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">
13528
+ <xsl:if test="not(../following-sibling::*[1][local-name() = 'fmt-name'])">
13529
+ <xsl:value-of select="."/>
13530
+ </xsl:if>
13531
+ </xsl:template>
13532
+
13533
+ <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">
13334
13534
  <xsl:value-of select="."/>
13335
13535
  </xsl:template>
13336
13536
 
13337
13537
  <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">
13538
+ <xsl:if test="not(../following-sibling::*[1][local-name() = 'fmt-name'])">
13539
+ <xsl:value-of select="."/>
13540
+ </xsl:if>
13541
+ </xsl:template>
13542
+
13543
+ <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">
13338
13544
  <xsl:value-of select="."/>
13339
13545
  </xsl:template>
13340
13546
 
@@ -13355,7 +13561,7 @@
13355
13561
  </xsl:template>
13356
13562
 
13357
13563
  <!-- special case: ignore section-title if @depth different than @depth of parent clause, or @depth of parent clause = 1 -->
13358
- <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"/>
13564
+ <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"/>
13359
13565
 
13360
13566
  <xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" name="contents_section-title" mode="contents">
13361
13567
  <xsl:variable name="level">
@@ -13367,6 +13573,9 @@
13367
13573
  <xsl:variable name="section">
13368
13574
  <xsl:choose>
13369
13575
  <xsl:when test="@type = 'section-title'"/>
13576
+ <xsl:when test="*[local-name() = 'span'][@class = 'fmt-caption-delim']">
13577
+ <xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
13578
+ </xsl:when>
13370
13579
  <xsl:otherwise>
13371
13580
  <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
13372
13581
  </xsl:otherwise>
@@ -13389,6 +13598,19 @@
13389
13598
 
13390
13599
  <xsl:variable name="title">
13391
13600
  <xsl:choose>
13601
+ <!-- https://github.com/metanorma/mn-native-pdf/issues/770 -->
13602
+ <xsl:when test="*[local-name() = 'span'][@class = 'fmt-caption-delim']">
13603
+ <xsl:choose>
13604
+ <xsl:when test="@type = 'section-title'">
13605
+ <xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
13606
+ <xsl:text>: </xsl:text>
13607
+ <xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
13608
+ </xsl:when>
13609
+ <xsl:otherwise>
13610
+ <xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
13611
+ </xsl:otherwise>
13612
+ </xsl:choose>
13613
+ </xsl:when>
13392
13614
  <xsl:when test="*[local-name() = 'tab']">
13393
13615
  <xsl:choose>
13394
13616
  <xsl:when test="@type = 'section-title'">
@@ -13424,7 +13646,7 @@
13424
13646
  <xsl:apply-templates mode="bookmarks"/>
13425
13647
  </xsl:template>
13426
13648
 
13427
- <xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
13649
+ <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">
13428
13650
  <xsl:apply-templates select="."/>
13429
13651
  </xsl:template>
13430
13652
 
@@ -13437,6 +13659,10 @@
13437
13659
  <xsl:apply-templates mode="contents"/>
13438
13660
  </xsl:template>
13439
13661
 
13662
+ <xsl:template match="*[local-name() = 'semx']" mode="contents">
13663
+ <xsl:apply-templates mode="contents"/>
13664
+ </xsl:template>
13665
+
13440
13666
  <xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
13441
13667
  <xsl:apply-templates mode="bookmarks"/>
13442
13668
  </xsl:template>
@@ -13446,9 +13672,14 @@
13446
13672
  <xsl:apply-templates mode="bookmarks"/>
13447
13673
  </xsl:template>
13448
13674
 
13675
+ <xsl:template match="*[local-name() = 'semx']" mode="bookmarks">
13676
+ <xsl:apply-templates mode="bookmarks"/>
13677
+ </xsl:template>
13678
+
13449
13679
  <!-- Bookmarks -->
13450
13680
  <xsl:template name="addBookmarks">
13451
13681
  <xsl:param name="contents"/>
13682
+ <xsl:param name="contents_addon"/>
13452
13683
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
13453
13684
  <xsl:if test="$contents_nodes//item">
13454
13685
  <fo:bookmark-tree>
@@ -13546,6 +13777,9 @@
13546
13777
  </xsl:otherwise>
13547
13778
  </xsl:choose>
13548
13779
 
13780
+ <!-- for $namespace = 'nist-sp' $namespace = 'ogc' $namespace = 'ogc-white-paper' -->
13781
+ <xsl:copy-of select="$contents_addon"/>
13782
+
13549
13783
  </fo:bookmark-tree>
13550
13784
  </xsl:if>
13551
13785
  </xsl:template>
@@ -13699,6 +13933,16 @@
13699
13933
  <!-- ====== -->
13700
13934
  <!-- ====== -->
13701
13935
  <xsl:template match="*[local-name() = 'title']" mode="contents_item">
13936
+ <xsl:param name="mode">bookmarks</xsl:param>
13937
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-title'])">
13938
+ <xsl:apply-templates mode="contents_item">
13939
+ <xsl:with-param name="mode" select="$mode"/>
13940
+ </xsl:apply-templates>
13941
+ <!-- <xsl:text> </xsl:text> -->
13942
+ </xsl:if>
13943
+ </xsl:template>
13944
+
13945
+ <xsl:template match="*[local-name() = 'fmt-title']" mode="contents_item">
13702
13946
  <xsl:param name="mode">bookmarks</xsl:param>
13703
13947
  <xsl:apply-templates mode="contents_item">
13704
13948
  <xsl:with-param name="mode" select="$mode"/>
@@ -13706,12 +13950,38 @@
13706
13950
  <!-- <xsl:text> </xsl:text> -->
13707
13951
  </xsl:template>
13708
13952
 
13953
+ <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">
13954
+ <xsl:apply-templates mode="contents_item"/>
13955
+ </xsl:template>
13956
+
13957
+ <xsl:template match="*[local-name() = 'semx']" mode="contents_item">
13958
+ <xsl:apply-templates mode="contents_item"/>
13959
+ </xsl:template>
13960
+
13961
+ <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="contents_item"/>
13962
+
13709
13963
  <xsl:template name="getSection">
13710
- <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
13964
+ <xsl:choose>
13965
+ <xsl:when test="*[local-name() = 'fmt-title']">
13966
+ <xsl:variable name="fmt_title_section">
13967
+ <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')]"/>
13968
+ </xsl:variable>
13969
+ <xsl:value-of select="normalize-space($fmt_title_section)"/>
13970
+ </xsl:when>
13971
+ <xsl:otherwise>
13972
+ <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
13973
+ </xsl:otherwise>
13974
+ </xsl:choose>
13711
13975
  </xsl:template>
13712
13976
 
13713
13977
  <xsl:template name="getName">
13714
13978
  <xsl:choose>
13979
+ <xsl:when test="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']]">
13980
+ <xsl:copy-of select="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']][1]/following-sibling::node()"/>
13981
+ </xsl:when>
13982
+ <xsl:when test="*[local-name() = 'fmt-title']">
13983
+ <xsl:copy-of select="*[local-name() = 'fmt-title']/node()"/>
13984
+ </xsl:when>
13715
13985
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
13716
13986
  <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
13717
13987
  </xsl:when>
@@ -13818,6 +14088,15 @@
13818
14088
  </xsl:template>
13819
14089
 
13820
14090
  <xsl:template match="*[local-name() = 'name']" mode="contents_item">
14091
+ <xsl:param name="mode">bookmarks</xsl:param>
14092
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
14093
+ <xsl:apply-templates mode="contents_item">
14094
+ <xsl:with-param name="mode" select="$mode"/>
14095
+ </xsl:apply-templates>
14096
+ </xsl:if>
14097
+ </xsl:template>
14098
+
14099
+ <xsl:template match="*[local-name() = 'fmt-name']" mode="contents_item">
13821
14100
  <xsl:param name="mode">bookmarks</xsl:param>
13822
14101
  <xsl:apply-templates mode="contents_item">
13823
14102
  <xsl:with-param name="mode" select="$mode"/>
@@ -14615,7 +14894,7 @@
14615
14894
  <xsl:if test="normalize-space() != ''">
14616
14895
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
14617
14896
  <xsl:call-template name="refine_termexample-name-style"/>
14618
- <xsl:apply-templates/>
14897
+ <xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
14619
14898
  </fo:inline>
14620
14899
  </xsl:if>
14621
14900
  </xsl:template>
@@ -14656,112 +14935,113 @@
14656
14935
  -->
14657
14936
  <xsl:template match="*[local-name() = 'example']">
14658
14937
 
14659
- <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
14660
-
14661
- <xsl:call-template name="setBlockSpanAll"/>
14938
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
14662
14939
 
14663
- <xsl:call-template name="refine_example-style"/>
14940
+ <xsl:call-template name="setBlockSpanAll"/>
14664
14941
 
14665
- <xsl:variable name="fo_element">
14666
- <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
14942
+ <xsl:call-template name="refine_example-style"/>
14667
14943
 
14668
- <xsl:choose>
14669
- <xsl:when test="$layoutVersion = '1951' and $revision_date_num &lt; 19610101">list</xsl:when>
14670
- <xsl:otherwise>inline</xsl:otherwise>
14671
- </xsl:choose>
14944
+ <xsl:variable name="fo_element">
14945
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
14672
14946
 
14673
- </xsl:variable>
14947
+ <xsl:choose>
14948
+ <xsl:when test="$layoutVersion = '1951' and $revision_date_num &lt; 19610101">list</xsl:when>
14949
+ <xsl:otherwise>inline</xsl:otherwise>
14950
+ </xsl:choose>
14674
14951
 
14675
- <fo:block-container margin-left="0mm" role="SKIP">
14952
+ </xsl:variable>
14676
14953
 
14677
- <xsl:choose>
14954
+ <fo:block-container margin-left="0mm" role="SKIP">
14678
14955
 
14679
- <xsl:when test="contains(normalize-space($fo_element), 'block')">
14956
+ <xsl:choose>
14680
14957
 
14681
- <!-- display name 'EXAMPLE' in a separate block -->
14682
- <fo:block>
14683
- <xsl:apply-templates select="*[local-name()='name']">
14684
- <xsl:with-param name="fo_element" select="$fo_element"/>
14685
- </xsl:apply-templates>
14686
- </fo:block>
14958
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
14687
14959
 
14688
- <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
14689
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
14690
- <xsl:variable name="example_body">
14691
- <xsl:apply-templates select="node()[not(local-name() = 'name')]">
14960
+ <!-- display name 'EXAMPLE' in a separate block -->
14961
+ <fo:block>
14962
+ <xsl:apply-templates select="*[local-name()='name']">
14692
14963
  <xsl:with-param name="fo_element" select="$fo_element"/>
14693
14964
  </xsl:apply-templates>
14965
+ </fo:block>
14966
+
14967
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
14968
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
14969
+ <xsl:variable name="example_body">
14970
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
14971
+ <xsl:with-param name="fo_element" select="$fo_element"/>
14972
+ </xsl:apply-templates>
14973
+ </xsl:variable>
14974
+ <xsl:choose>
14975
+ <xsl:when test="xalan:nodeset($example_body)/*">
14976
+ <xsl:copy-of select="$example_body"/>
14977
+ </xsl:when>
14978
+ <xsl:otherwise><fo:block/><!-- prevent empty block-container --></xsl:otherwise>
14979
+ </xsl:choose>
14980
+ </fo:block-container>
14981
+ </fo:block-container>
14982
+ </xsl:when> <!-- end block -->
14983
+
14984
+ <xsl:when test="contains(normalize-space($fo_element), 'list')">
14985
+
14986
+ <xsl:variable name="provisional_distance_between_starts_">
14987
+ 45
14694
14988
  </xsl:variable>
14695
- <xsl:choose>
14696
- <xsl:when test="xalan:nodeset($example_body)/*">
14697
- <xsl:copy-of select="$example_body"/>
14698
- </xsl:when>
14699
- <xsl:otherwise><fo:block/><!-- prevent empty block-container --></xsl:otherwise>
14700
- </xsl:choose>
14701
- </fo:block-container>
14702
- </fo:block-container>
14703
- </xsl:when> <!-- end block -->
14989
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
14990
+ <xsl:variable name="indent_">
14991
+ 28
14992
+ </xsl:variable>
14993
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
14704
14994
 
14705
- <xsl:when test="contains(normalize-space($fo_element), 'list')">
14995
+ <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
14996
+ <fo:list-item>
14997
+ <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
14998
+ <fo:block>
14999
+ <xsl:apply-templates select="*[local-name()='name']">
15000
+ <xsl:with-param name="fo_element">block</xsl:with-param>
15001
+ </xsl:apply-templates>
15002
+ </fo:block>
15003
+ </fo:list-item-label>
15004
+ <fo:list-item-body start-indent="body-start()">
15005
+ <fo:block>
15006
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
15007
+ <xsl:with-param name="fo_element" select="$fo_element"/>
15008
+ </xsl:apply-templates>
15009
+ </fo:block>
15010
+ </fo:list-item-body>
15011
+ </fo:list-item>
15012
+ </fo:list-block>
15013
+ </xsl:when> <!-- end list -->
14706
15014
 
14707
- <xsl:variable name="provisional_distance_between_starts_">
14708
- 45
14709
- </xsl:variable>
14710
- <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
14711
- <xsl:variable name="indent_">
14712
- 28
14713
- </xsl:variable>
14714
- <xsl:variable name="indent" select="normalize-space($indent_)"/>
15015
+ <xsl:otherwise> <!-- inline -->
14715
15016
 
14716
- <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
14717
- <fo:list-item>
14718
- <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
14719
- <fo:block>
14720
- <xsl:apply-templates select="*[local-name()='name']">
14721
- <xsl:with-param name="fo_element">block</xsl:with-param>
14722
- </xsl:apply-templates>
14723
- </fo:block>
14724
- </fo:list-item-label>
14725
- <fo:list-item-body start-indent="body-start()">
14726
- <fo:block>
14727
- <xsl:apply-templates select="node()[not(local-name() = 'name')]">
15017
+ <!-- display 'EXAMPLE' and first element in the same line -->
15018
+ <fo:block>
15019
+ <xsl:apply-templates select="*[local-name()='name']">
15020
+ <xsl:with-param name="fo_element" select="$fo_element"/>
15021
+ </xsl:apply-templates>
15022
+ <fo:inline>
15023
+ <xsl:apply-templates select="*[not(local-name() = 'name')][1]">
14728
15024
  <xsl:with-param name="fo_element" select="$fo_element"/>
14729
15025
  </xsl:apply-templates>
14730
- </fo:block>
14731
- </fo:list-item-body>
14732
- </fo:list-item>
14733
- </fo:list-block>
14734
- </xsl:when> <!-- end list -->
14735
-
14736
- <xsl:otherwise> <!-- inline -->
15026
+ </fo:inline>
15027
+ </fo:block>
14737
15028
 
14738
- <!-- display 'EXAMPLE' and first element in the same line -->
14739
- <fo:block>
14740
- <xsl:apply-templates select="*[local-name()='name']">
14741
- <xsl:with-param name="fo_element" select="$fo_element"/>
14742
- </xsl:apply-templates>
14743
- <fo:inline>
14744
- <xsl:apply-templates select="*[not(local-name() = 'name')][1]">
14745
- <xsl:with-param name="fo_element" select="$fo_element"/>
14746
- </xsl:apply-templates>
14747
- </fo:inline>
14748
- </fo:block>
15029
+ <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
15030
+ <!-- display further elements in blocks -->
15031
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
15032
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
15033
+ <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
15034
+ <xsl:with-param name="fo_element" select="'block'"/>
15035
+ </xsl:apply-templates>
15036
+ </fo:block-container>
15037
+ </fo:block-container>
15038
+ </xsl:if>
15039
+ </xsl:otherwise> <!-- end inline -->
14749
15040
 
14750
- <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
14751
- <!-- display further elements in blocks -->
14752
- <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
14753
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
14754
- <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
14755
- <xsl:with-param name="fo_element" select="'block'"/>
14756
- </xsl:apply-templates>
14757
- </fo:block-container>
14758
- </fo:block-container>
14759
- </xsl:if>
14760
- </xsl:otherwise> <!-- end inline -->
15041
+ </xsl:choose>
15042
+ </fo:block-container>
15043
+ </fo:block-container>
14761
15044
 
14762
- </xsl:choose>
14763
- </fo:block-container>
14764
- </fo:block-container>
14765
15045
  </xsl:template>
14766
15046
 
14767
15047
  <xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
@@ -14782,7 +15062,7 @@
14782
15062
  <xsl:otherwise>
14783
15063
  <fo:inline xsl:use-attribute-sets="example-name-style">
14784
15064
  <xsl:call-template name="refine_example-name-style"/>
14785
- <xsl:apply-templates/>
15065
+ <xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
14786
15066
  </fo:inline>
14787
15067
  </xsl:otherwise>
14788
15068
  </xsl:choose>
@@ -14974,15 +15254,17 @@
14974
15254
 
14975
15255
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
14976
15256
  <fo:block role="BlockQuote">
14977
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
15257
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source') and not(local-name() = 'attribution')]"/> <!-- process all nested nodes, except author and source -->
14978
15258
  </fo:block>
14979
15259
  </fo:block-container>
14980
15260
  </fo:block-container>
14981
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
15261
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
14982
15262
  <fo:block xsl:use-attribute-sets="quote-source-style">
14983
15263
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
14984
15264
  <xsl:apply-templates select="*[local-name() = 'author']"/>
14985
15265
  <xsl:apply-templates select="*[local-name() = 'source']"/>
15266
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
15267
+ <xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
14986
15268
  </fo:block>
14987
15269
  </xsl:if>
14988
15270
 
@@ -15004,9 +15286,13 @@
15004
15286
  </xsl:template>
15005
15287
 
15006
15288
  <xsl:template match="*[local-name() = 'author']">
15007
- <xsl:text>— </xsl:text>
15289
+ <xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
15290
+ <xsl:text>— </xsl:text>
15291
+ </xsl:if>
15008
15292
  <xsl:apply-templates/>
15009
15293
  </xsl:template>
15294
+
15295
+ <xsl:template match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
15010
15296
  <!-- ====== -->
15011
15297
  <!-- ====== -->
15012
15298
 
@@ -15148,6 +15434,15 @@
15148
15434
 
15149
15435
  </xsl:template> <!-- tab -->
15150
15436
 
15437
+ <xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
15438
+ <xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
15439
+
15440
+ <xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab">
15441
+
15442
+ <xsl:attribute name="padding-right">6mm</xsl:attribute>
15443
+
15444
+ </xsl:template>
15445
+
15151
15446
  <xsl:template name="insertNonBreakSpaces">
15152
15447
  <xsl:param name="count"/>
15153
15448
  <xsl:if test="$count &gt; 0">
@@ -15187,8 +15482,12 @@
15187
15482
  </xsl:template>
15188
15483
 
15189
15484
  <xsl:template match="*[local-name() = 'domain']">
15485
+ <!-- https://github.com/metanorma/isodoc/issues/607
15190
15486
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
15191
- <xsl:text> </xsl:text>
15487
+ <xsl:text> </xsl:text> -->
15488
+ <xsl:if test="not(@hidden = 'true')">
15489
+ <xsl:apply-templates/>
15490
+ </xsl:if>
15192
15491
  </xsl:template>
15193
15492
 
15194
15493
  <xsl:template match="*[local-name() = 'admitted']">
@@ -15236,6 +15535,29 @@
15236
15535
  <!-- END definition -->
15237
15536
  <!-- ========== -->
15238
15537
 
15538
+ <xsl:variable name="reviews_">
15539
+ <xsl:for-each select="//*[local-name() = 'review'][@from]">
15540
+ <xsl:copy>
15541
+ <xsl:copy-of select="@from"/>
15542
+ <xsl:copy-of select="@id"/>
15543
+ </xsl:copy>
15544
+ </xsl:for-each>
15545
+ </xsl:variable>
15546
+ <xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
15547
+
15548
+ <xsl:template name="addReviewHelper">
15549
+ <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
15550
+ <xsl:variable name="curr_id" select="@id"/>
15551
+ <xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
15552
+ <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
15553
+ <fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
15554
+ </xsl:if>
15555
+ <!-- <fo:block>
15556
+ <curr_id><xsl:value-of select="$curr_id"/></curr_id>
15557
+ <xsl:copy-of select="$reviews"/>
15558
+ </fo:block> -->
15559
+ </xsl:template>
15560
+
15239
15561
  <!-- main sections -->
15240
15562
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
15241
15563
 
@@ -15244,6 +15566,8 @@
15244
15566
 
15245
15567
  <xsl:call-template name="sections_element_style"/>
15246
15568
 
15569
+ <xsl:call-template name="addReviewHelper"/>
15570
+
15247
15571
  <xsl:apply-templates/>
15248
15572
  </fo:block>
15249
15573
 
@@ -15290,6 +15614,7 @@
15290
15614
 
15291
15615
  <fo:block>
15292
15616
  <xsl:call-template name="setId"/>
15617
+ <xsl:call-template name="addReviewHelper"/>
15293
15618
  <xsl:apply-templates/>
15294
15619
  </fo:block>
15295
15620
  </xsl:template>
@@ -15326,6 +15651,8 @@
15326
15651
 
15327
15652
  <xsl:call-template name="refine_clause_style"/>
15328
15653
 
15654
+ <xsl:call-template name="addReviewHelper"/>
15655
+
15329
15656
  <xsl:apply-templates/>
15330
15657
  </fo:block>
15331
15658
  </xsl:template>
@@ -15378,6 +15705,23 @@
15378
15705
 
15379
15706
  <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
15380
15707
 
15708
+ <xsl:if test="1 = 1">
15709
+ <xsl:choose>
15710
+ <!-- if there isn't the attribute '@from', then -->
15711
+ <xsl:when test="$id_from = ''">
15712
+ <fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
15713
+ </xsl:when>
15714
+ <!-- if there isn't element with id 'from', then create 'bookmark' here -->
15715
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
15716
+ <fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
15717
+ </xsl:when>
15718
+ <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
15719
+ <fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
15720
+ </xsl:when>
15721
+ </xsl:choose>
15722
+ </xsl:if>
15723
+
15724
+ <xsl:if test="1 = 2">
15381
15725
  <xsl:choose>
15382
15726
  <!-- if there isn't the attribute '@from', then -->
15383
15727
  <xsl:when test="$id_from = ''">
@@ -15391,6 +15735,7 @@
15391
15735
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
15392
15736
  </xsl:when>
15393
15737
  </xsl:choose>
15738
+ </xsl:if>
15394
15739
 
15395
15740
  </xsl:template>
15396
15741
 
@@ -16545,9 +16890,9 @@
16545
16890
  </xsl:if>
16546
16891
 
16547
16892
  <xsl:if test="@type != 'editorial'">
16548
- <xsl:call-template name="displayAdmonitionName">
16549
- <xsl:with-param name="sep"> — </xsl:with-param>
16550
- </xsl:call-template>
16893
+ <xsl:call-template name="displayAdmonitionName"/>
16894
+ <!-- https://github.com/metanorma/isodoc/issues/614 -->
16895
+ <!-- <xsl:with-param name="sep"> — </xsl:with-param> -->
16551
16896
  </xsl:if>
16552
16897
 
16553
16898
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -16696,6 +17041,10 @@
16696
17041
  <!-- - Remove semantic xml part -->
16697
17042
  <!-- - Remove image/emf (EMF vector image for Word) -->
16698
17043
  <!-- - add @id, redundant for table auto-layout algorithm -->
17044
+ <!-- - process 'passthrough' element -->
17045
+ <!-- - split math by element with @linebreak into maths -->
17046
+ <!-- - rename fmt-title to title, fmt-name to name and another changes to convert new presentation XML to -->
17047
+ <!-- - old XML without significant changes in XSLT -->
16699
17048
  <!-- =========================================================================== -->
16700
17049
  <xsl:template match="@*|node()" mode="update_xml_step1">
16701
17050
  <xsl:copy>
@@ -16703,6 +17052,12 @@
16703
17052
  </xsl:copy>
16704
17053
  </xsl:template>
16705
17054
 
17055
+ <xsl:template match="@*|node()" mode="update_xml_pres">
17056
+ <xsl:copy>
17057
+ <xsl:apply-templates select="@*|node()" mode="update_xml_pres"/>
17058
+ </xsl:copy>
17059
+ </xsl:template>
17060
+
16706
17061
  <!-- change section's order based on @displayorder value -->
16707
17062
  <xsl:template match="*[local-name() = 'preface']" mode="update_xml_step1">
16708
17063
  <xsl:copy>
@@ -16779,7 +17134,7 @@
16779
17134
  </xsl:template>
16780
17135
 
16781
17136
  <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
16782
- <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">
17137
+ <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">
16783
17138
  <xsl:copy>
16784
17139
  <xsl:copy-of select="@*"/>
16785
17140
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -16798,14 +17153,17 @@
16798
17153
 
16799
17154
  <!-- remove semantic xml -->
16800
17155
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
17156
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_pres"/>
16801
17157
 
16802
17158
  <!-- remove image/emf -->
16803
17159
  <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
17160
+ <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_pres"/>
16804
17161
 
16805
17162
  <!-- remove preprocess-xslt -->
16806
17163
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
17164
+ <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_pres"/>
16807
17165
 
16808
- <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
17166
+ <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">
16809
17167
  <xsl:copy-of select="."/>
16810
17168
  </xsl:template>
16811
17169
 
@@ -16871,6 +17229,93 @@
16871
17229
  </xsl:choose>
16872
17230
  </xsl:template>
16873
17231
 
17232
+ <xsl:variable name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
17233
+ <xsl:template match="*[local-name() = 'passthrough']" mode="update_xml_step1">
17234
+ <!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
17235
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
17236
+ <xsl:apply-templates mode="update_xml_step1"/>
17237
+ </xsl:if>
17238
+ </xsl:template>
17239
+
17240
+ <!-- split math by element with @linebreak into maths -->
17241
+ <xsl:template match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
17242
+ <xsl:variable name="maths">
17243
+ <xsl:apply-templates select="." mode="mathml_linebreak"/>
17244
+ </xsl:variable>
17245
+ <xsl:copy-of select="$maths"/>
17246
+ </xsl:template>
17247
+
17248
+ <!-- update new Presentation XML -->
17249
+ <xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="update_xml_step1"/>
17250
+ <xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="update_xml_pres"/>
17251
+ <xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_step1"/>
17252
+ <xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_pres"/>
17253
+ <xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
17254
+ <xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_pres"/>
17255
+
17256
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_step1">
17257
+ <xsl:copy>
17258
+ <xsl:apply-templates select="@*" mode="update_xml_step1"/>
17259
+ <xsl:copy-of select="preceding-sibling::*[1][local-name() = 'section-title']/@depth"/>
17260
+ <xsl:apply-templates select="node()" mode="update_xml_step1"/>
17261
+ </xsl:copy>
17262
+ </xsl:template>
17263
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_pres">
17264
+ <xsl:copy>
17265
+ <xsl:apply-templates select="@*" mode="update_xml_pres"/>
17266
+ <xsl:copy-of select="preceding-sibling::*[1][local-name() = 'section-title']/@depth"/>
17267
+ <xsl:apply-templates select="node()" mode="update_xml_pres"/>
17268
+ </xsl:copy>
17269
+ </xsl:template>
17270
+
17271
+ <xsl:template match="*[local-name() = 'fmt-title']"/>
17272
+ <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
17273
+ <xsl:element name="title" namespace="{$namespace_full}">
17274
+ <xsl:copy-of select="@*"/>
17275
+ <xsl:apply-templates mode="update_xml_step1"/>
17276
+ </xsl:element>
17277
+ </xsl:template>
17278
+ <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
17279
+ <xsl:element name="title" namespace="{$namespace_full}">
17280
+ <xsl:copy-of select="@*"/>
17281
+ <xsl:apply-templates mode="update_xml_pres"/>
17282
+ </xsl:element>
17283
+ </xsl:template>
17284
+
17285
+ <xsl:template match="*[local-name() = 'fmt-name']"/>
17286
+ <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
17287
+ <xsl:element name="name" namespace="{$namespace_full}">
17288
+ <xsl:copy-of select="@*"/>
17289
+ <xsl:apply-templates mode="update_xml_step1"/>
17290
+ </xsl:element>
17291
+ </xsl:template>
17292
+ <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_pres">
17293
+ <xsl:element name="name" namespace="{$namespace_full}">
17294
+ <xsl:copy-of select="@*"/>
17295
+ <xsl:apply-templates mode="update_xml_pres"/>
17296
+ </xsl:element>
17297
+ </xsl:template>
17298
+
17299
+ <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">
17300
+ <xsl:apply-templates mode="update_xml_step1"/>
17301
+ </xsl:template>
17302
+ <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">
17303
+ <xsl:apply-templates mode="update_xml_pres"/>
17304
+ </xsl:template>
17305
+
17306
+ <xsl:template match="*[local-name() = 'semx']" mode="update_xml_step1">
17307
+ <xsl:apply-templates mode="update_xml_step1"/>
17308
+ </xsl:template>
17309
+ <xsl:template match="*[local-name() = 'semx']" mode="update_xml_pres">
17310
+ <xsl:apply-templates mode="update_xml_pres"/>
17311
+ </xsl:template>
17312
+
17313
+ <xsl:template match="*[local-name() = 'fmt-xref-label']"/>
17314
+ <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_step1"/>
17315
+ <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_pres"/>
17316
+
17317
+ <!-- END: update new Presentation XML -->
17318
+
16874
17319
  <!-- =========================================================================== -->
16875
17320
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
16876
17321
  <!-- =========================================================================== -->
@@ -16974,6 +17419,8 @@
16974
17419
 
16975
17420
  <xsl:template name="insertOpeningElements">
16976
17421
  <xsl:param name="tree"/>
17422
+ <xsl:param name="xmlns"/>
17423
+ <xsl:param name="add_continue">true</xsl:param>
16977
17424
  <xsl:for-each select="$tree//element">
16978
17425
  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
16979
17426
  <xsl:value-of select="."/>
@@ -16984,7 +17431,8 @@
16984
17431
  <xsl:value-of select="."/>
16985
17432
  <xsl:text>"</xsl:text>
16986
17433
  </xsl:for-each>
16987
- <xsl:if test="position() = 1"> continue="true"</xsl:if>
17434
+ <xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
17435
+ <xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
16988
17436
  <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
16989
17437
  <xsl:if test="$debug = 'true'">
16990
17438
  <xsl:message>&lt;<xsl:value-of select="."/>&gt;</xsl:message>
@@ -17164,7 +17612,7 @@
17164
17612
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
17165
17613
  <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>
17166
17614
 
17167
- <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">
17615
+ <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">
17168
17616
 
17169
17617
  <xsl:variable name="parent" select="local-name(..)"/>
17170
17618
 
@@ -17766,6 +18214,7 @@
17766
18214
  </pdf:catalog>
17767
18215
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
17768
18216
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
18217
+ <!-- Commented after upgrade to Apache FOP 2.10
17769
18218
  <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="">
17770
18219
  <pdfaExtension:schemas>
17771
18220
  <rdf:Bag>
@@ -17798,7 +18247,7 @@
17798
18247
  </rdf:li>
17799
18248
  </rdf:Bag>
17800
18249
  </pdfaExtension:schemas>
17801
- </rdf:Description>
18250
+ </rdf:Description> -->
17802
18251
  <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
17803
18252
  <!-- Dublin Core properties go here -->
17804
18253
  <dc:title>
@@ -17845,7 +18294,7 @@
17845
18294
  <xsl:variable name="dc_description">
17846
18295
  <xsl:variable name="abstract">
17847
18296
 
17848
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
18297
+ <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'])]"/>
17849
18298
 
17850
18299
  </xsl:variable>
17851
18300
  <rdf:Alt>
@@ -18390,31 +18839,123 @@
18390
18839
 
18391
18840
  <!-- END: insert cover page image -->
18392
18841
 
18393
- <xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
18842
+ <!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
18843
+ <xsl:variable name="regex_ja_spec_">[
18844
+ <!-- Rotate 90° clockwise -->
18845
+ \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
18846
+ \uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
18847
+ \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
18848
+ \uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
18849
+ \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
18850
+ \uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
18851
+ \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
18852
+ \uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
18853
+ \u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
18854
+ \u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
18855
+ \u3010 <!-- U+3010 LEFT BLACK LENTICULAR BRACKET (【) -->
18856
+ \u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
18857
+ \u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
18858
+ \u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
18859
+ \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
18860
+ \u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
18861
+ \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
18862
+ \u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
18863
+ \u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
18864
+ \u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
18865
+ \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
18866
+ \uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
18867
+ \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
18868
+ \uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
18869
+ \u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
18870
+ \u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
18871
+ \u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
18872
+ \u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
18873
+
18874
+ \u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
18875
+ \u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
18876
+ \u301C <!-- U+301C WAVE DASH (〜) -->
18877
+ \u3030 <!-- U+3030 WAVY DASH (〰 )-->
18878
+ \u30FC <!-- U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK (ー) -->
18879
+ \u2329 <!-- U+2329 LEFT-POINTING ANGLE BRACKET (〈) -->
18880
+ \u232A <!-- U+232A RIGHT-POINTING ANGLE BRACKET (〉) -->
18881
+ \u3018 <!-- U+3018 LEFT WHITE TORTOISE SHELL BRACKET (〘) -->
18882
+ \u3019 <!-- U+3019 RIGHT WHITE TORTOISE SHELL BRACKET (〙) -->
18883
+ \u30A0 <!-- U+30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN (゠) -->
18884
+ \uFE59 <!-- U+FE59 SMALL LEFT PARENTHESIS (﹙) -->
18885
+ \uFE5A <!-- U+FE5A SMALL RIGHT PARENTHESIS (﹚) -->
18886
+ \uFE5B <!-- U+FE5B SMALL LEFT CURLY BRACKET (﹛) -->
18887
+ \uFE5C <!-- U+FE5C SMALL RIGHT CURLY BRACKET (﹜) -->
18888
+ \uFE5D <!-- U+FE5D SMALL LEFT TORTOISE SHELL BRACKET (﹝) -->
18889
+ \uFE5E <!-- U+FE5E SMALL RIGHT TORTOISE SHELL BRACKET (﹞) -->
18890
+ \uFF5C <!-- U+FF5C FULLWIDTH VERTICAL LINE (|) -->
18891
+ \uFF5F <!-- U+FF5F FULLWIDTH LEFT WHITE PARENTHESIS (⦅) -->
18892
+ \uFF60 <!-- U+FF60 FULLWIDTH RIGHT WHITE PARENTHESIS (⦆) -->
18893
+ \uFFE3 <!-- U+FFE3 FULLWIDTH MACRON ( ̄) -->
18894
+ \uFF3F <!-- U+FF3F FULLWIDTH LOW LINE (_) -->
18895
+ \uFF5E <!-- U+FF5E FULLWIDTH TILDE (~) -->
18896
+ <!-- Rotate 180° -->
18897
+ \u309C <!-- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜) -->
18898
+ \u3002 <!-- U+3002 IDEOGRAPHIC FULL STOP (。) -->
18899
+ \uFE52 <!-- U+FE52 SMALL FULL STOP (﹒) -->
18900
+ \uFF0E <!-- U+FF0E FULLWIDTH FULL STOP (.) -->
18901
+ ]</xsl:variable>
18902
+ <xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
18394
18903
  <xsl:template name="insertVerticalChar">
18395
18904
  <xsl:param name="str"/>
18396
18905
  <xsl:param name="writing-mode">lr-tb</xsl:param>
18397
18906
  <xsl:param name="reference-orientation">90</xsl:param>
18398
- <xsl:if test="string-length($str) &gt; 0">
18399
- <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">
18400
- <xsl:if test="normalize-space($writing-mode) != ''">
18401
- <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
18402
- <xsl:attribute name="reference-orientation">90</xsl:attribute>
18403
- </xsl:if>
18404
- <xsl:variable name="char" select="substring($str,1,1)"/>
18405
- <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
18406
- <xsl:attribute name="reference-orientation">0</xsl:attribute>
18907
+ <xsl:param name="add_zero_width_space">false</xsl:param>
18908
+ <xsl:choose>
18909
+ <xsl:when test="ancestor::*[local-name() = 'span'][@class = 'norotate']">
18910
+ <xsl:value-of select="$str"/>
18911
+ </xsl:when>
18912
+ <xsl:otherwise>
18913
+ <xsl:if test="string-length($str) &gt; 0">
18914
+ <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
18915
+ <xsl:variable name="char" select="substring($str,1,1)"/>
18916
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
18917
+ <xsl:if test="normalize-space($writing-mode) != ''">
18918
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
18919
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
18920
+ </xsl:if>
18921
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
18922
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
18923
+ </xsl:if>
18924
+ <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
18925
+ <!-- Rotate 180°:
18926
+ U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
18927
+ U+3002 IDEOGRAPHIC FULL STOP (。)
18928
+ U+FE52 SMALL FULL STOP (﹒)
18929
+ U+FF0E FULLWIDTH FULL STOP (.)
18930
+ -->
18931
+ <xsl:attribute name="reference-orientation">-90</xsl:attribute>
18932
+ </xsl:if>
18933
+ <fo:block-container width="1em">
18934
+ <fo:block line-height="1em">
18935
+ <xsl:choose>
18936
+ <xsl:when test="$horizontal_mode = 'true'">
18937
+ <xsl:value-of select="$str"/>
18938
+ </xsl:when>
18939
+ <xsl:otherwise>
18940
+ <xsl:value-of select="$char"/>
18941
+ </xsl:otherwise>
18942
+ </xsl:choose>
18943
+ </fo:block>
18944
+ </fo:block-container>
18945
+ </fo:inline-container>
18946
+ <xsl:if test="$add_zero_width_space = 'true' and ($char = ',' or $char = '.' or $char = ' ' or $char = '·' or $char = ')' or $char = ']' or $char = '}')"><xsl:value-of select="$zero_width_space"/></xsl:if>
18947
+
18948
+ <xsl:if test="$horizontal_mode = 'false'">
18949
+ <xsl:call-template name="insertVerticalChar">
18950
+ <xsl:with-param name="str" select="substring($str, 2)"/>
18951
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
18952
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
18953
+ <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
18954
+ </xsl:call-template>
18955
+ </xsl:if>
18407
18956
  </xsl:if>
18408
- <fo:block-container width="1em">
18409
- <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
18410
- </fo:block-container>
18411
- </fo:inline-container>
18412
- <xsl:call-template name="insertVerticalChar">
18413
- <xsl:with-param name="str" select="substring($str, 2)"/>
18414
- <xsl:with-param name="writing-mode" select="$writing-mode"/>
18415
- <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
18416
- </xsl:call-template>
18417
- </xsl:if>
18957
+ </xsl:otherwise>
18958
+ </xsl:choose>
18418
18959
  </xsl:template>
18419
18960
 
18420
18961
  <xsl:template name="number-to-words">