metanorma-ieee 1.0.14 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1061,23 +1061,22 @@
1061
1061
  <fo:flow flow-name="xsl-region-body">
1062
1062
  <!-- debugpage=<xsl:copy-of select="."/> -->
1063
1063
 
1064
- <xsl:if test="position() = 1">
1065
-
1064
+ <!-- <xsl:if test="position() = 1">
1065
+
1066
1066
  <xsl:choose>
1067
1067
  <xsl:when test="$current_template = 'draft'">
1068
1068
  <fo:block font-family="Arial" font-size="23pt" font-weight="bold" margin-top="70pt" margin-bottom="48pt">
1069
-
1069
+
1070
1070
  <xsl:if test="contains('amendment corrigendum erratum', $subdoctype) and $subdoctype != ''">
1071
1071
  <xsl:attribute name="font-size">24pt</xsl:attribute>
1072
1072
  </xsl:if>
1073
-
1073
+
1074
1074
  <xsl:copy-of select="$title_prefix"/>
1075
1075
  <xsl:copy-of select="$title"/>
1076
-
1077
- <!-- <xsl:copy-of select="$draft_title_part"/> -->
1076
+
1078
1077
  </fo:block>
1079
1078
  </xsl:when>
1080
-
1079
+
1081
1080
  <xsl:when test="$current_template = 'standard'">
1082
1081
  <fo:block font-family="Arial" font-weight="bold" margin-top="13mm" space-after="12pt">
1083
1082
  <fo:block font-weight="bold" space-before="13mm">
@@ -1085,30 +1084,21 @@
1085
1084
  </fo:block>
1086
1085
  </fo:block>
1087
1086
  </xsl:when>
1087
+
1088
+ <xsl:otherwise> --><!-- $current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report' -->
1088
1089
 
1089
- <xsl:otherwise> <!-- $current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report' -->
1090
-
1091
- <xsl:attribute name="font-family">Calibri Light</xsl:attribute>
1090
+ <!-- <xsl:attribute name="font-family">Calibri Light</xsl:attribute>
1092
1091
  <xsl:attribute name="font-size">12pt</xsl:attribute>
1093
-
1092
+
1094
1093
  <fo:block font-family="Arial Black" font-size="20pt" margin-top="18pt">
1095
1094
  <xsl:copy-of select="$title"/>
1096
- <!-- <xsl:copy-of select="$draft_title_part"/> -->
1097
1095
  </fo:block>
1098
1096
  <xsl:call-template name="addBlueBox"/>
1099
- <!-- <fo:block font-size="1" margin-top="3mm">
1100
- <fo:instream-foreign-object content-width="57mm" content-height="3mm" scaling="non-uniform" fox:alt-text="Image Box">
1101
- <xsl:call-template name="insertImageBoxSVG">
1102
- <xsl:with-param name="color"><xsl:value-of select="$color_blue"/></xsl:with-param>
1103
- </xsl:call-template>
1104
- </fo:instream-foreign-object>
1105
- </fo:block>
1106
- <fo:block margin-top="12pt" margin-bottom="12pt">&#xa0;</fo:block> -->
1107
- <fo:block margin-bottom="12pt"> </fo:block>
1097
+ <fo:block margin-bottom="12pt">&#xa0;</fo:block>
1108
1098
  </xsl:otherwise>
1109
1099
  </xsl:choose>
1110
-
1111
- </xsl:if>
1100
+
1101
+ </xsl:if> -->
1112
1102
 
1113
1103
  <xsl:apply-templates select="*" mode="page"/>
1114
1104
  <xsl:if test="position() = last()"><fo:block id="lastBlockMain"/></xsl:if>
@@ -1736,6 +1726,32 @@
1736
1726
  </xsl:choose>
1737
1727
  </xsl:template>
1738
1728
 
1729
+ <xsl:template match="ieee:p[@class = 'zzSTDTitle1']" priority="4">
1730
+ <xsl:choose>
1731
+ <xsl:when test="$current_template = 'draft'">
1732
+ <fo:block font-family="Arial" font-size="23pt" font-weight="bold" margin-top="70pt" margin-bottom="48pt">
1733
+ <xsl:if test="contains('amendment corrigendum erratum', $subdoctype) and $subdoctype != ''">
1734
+ <xsl:attribute name="font-size">24pt</xsl:attribute>
1735
+ </xsl:if>
1736
+ <xsl:apply-templates/>
1737
+ </fo:block>
1738
+ </xsl:when>
1739
+ <xsl:when test="$current_template = 'standard'">
1740
+ <fo:block font-family="Arial" font-weight="bold" margin-top="13mm" space-after="12pt">
1741
+ <xsl:apply-templates/>
1742
+ </fo:block>
1743
+ </xsl:when>
1744
+ <xsl:otherwise> <!-- $current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report' -->
1745
+
1746
+ <fo:block font-family="Arial Black" font-size="20pt" margin-top="18pt">
1747
+ <xsl:apply-templates/>
1748
+ </fo:block>
1749
+ <xsl:call-template name="addBlueBox"/>
1750
+ <fo:block margin-bottom="12pt"> </fo:block>
1751
+ </xsl:otherwise>
1752
+ </xsl:choose>
1753
+ </xsl:template>
1754
+
1739
1755
  <xsl:template match="node()">
1740
1756
  <xsl:apply-templates/>
1741
1757
  </xsl:template>
@@ -3881,21 +3897,32 @@
3881
3897
  <xsl:variable name="titles_">
3882
3898
 
3883
3899
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
3884
- <title-toc lang="en">
3885
-
3900
+ <!-- <title-toc lang="en">
3901
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
3886
3902
  <xsl:text>Contents</xsl:text>
3887
-
3888
- </title-toc>
3889
- <title-toc lang="fr">
3903
+ </xsl:if>
3904
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
3905
+ <xsl:text>Table of Contents</xsl:text>
3906
+ </xsl:if>
3907
+ <xsl:if test="$namespace = 'gb'">
3908
+ <xsl:text>Table of contents</xsl:text>
3909
+ </xsl:if>
3910
+ </title-toc> -->
3911
+ <title-toc lang="en">Table of contents</title-toc>
3912
+ <!-- <title-toc lang="fr">
3890
3913
  <xsl:text>Sommaire</xsl:text>
3891
- </title-toc>
3892
- <title-toc lang="zh">
3893
-
3914
+ </title-toc> -->
3915
+ <!-- <title-toc lang="zh">
3916
+ <xsl:choose>
3917
+ <xsl:when test="$namespace = 'gb'">
3918
+ <xsl:text>目次</xsl:text>
3919
+ </xsl:when>
3920
+ <xsl:otherwise>
3894
3921
  <xsl:text>Contents</xsl:text>
3895
-
3896
- </title-toc>
3897
-
3898
- <title-descriptors lang="en">Descriptors</title-descriptors>
3922
+ </xsl:otherwise>
3923
+ </xsl:choose>
3924
+ </title-toc> -->
3925
+ <title-toc lang="zh">目次</title-toc>
3899
3926
 
3900
3927
  <title-part lang="en">
3901
3928
 
@@ -3911,20 +3938,6 @@
3911
3938
  <title-subpart lang="en">Sub-part #</title-subpart>
3912
3939
  <title-subpart lang="fr">Partie de sub #</title-subpart>
3913
3940
 
3914
- <title-list-tables lang="en">List of Tables</title-list-tables>
3915
-
3916
- <title-list-figures lang="en">List of Figures</title-list-figures>
3917
-
3918
- <title-table-figures lang="en">Table of Figures</title-table-figures>
3919
-
3920
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
3921
-
3922
- <title-summary lang="en">Summary</title-summary>
3923
-
3924
- <title-continued lang="ru">(продолжение)</title-continued>
3925
- <title-continued lang="en">(continued)</title-continued>
3926
- <title-continued lang="fr">(continué)</title-continued>
3927
-
3928
3941
  </xsl:variable>
3929
3942
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
3930
3943
 
@@ -3932,8 +3945,8 @@
3932
3945
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
3933
3946
  <xsl:value-of select="$toc_table_title"/>
3934
3947
  <xsl:if test="normalize-space($toc_table_title) = ''">
3935
- <xsl:call-template name="getTitle">
3936
- <xsl:with-param name="name" select="'title-list-tables'"/>
3948
+ <xsl:call-template name="getLocalizedString">
3949
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
3937
3950
  </xsl:call-template>
3938
3951
  </xsl:if>
3939
3952
  </xsl:variable>
@@ -3942,8 +3955,8 @@
3942
3955
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
3943
3956
  <xsl:value-of select="$toc_figure_title"/>
3944
3957
  <xsl:if test="normalize-space($toc_figure_title) = ''">
3945
- <xsl:call-template name="getTitle">
3946
- <xsl:with-param name="name" select="'title-list-figures'"/>
3958
+ <xsl:call-template name="getLocalizedString">
3959
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
3947
3960
  </xsl:call-template>
3948
3961
  </xsl:if>
3949
3962
  </xsl:variable>
@@ -3952,8 +3965,8 @@
3952
3965
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
3953
3966
  <xsl:value-of select="$toc_requirement_title"/>
3954
3967
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
3955
- <xsl:call-template name="getTitle">
3956
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
3968
+ <xsl:call-template name="getLocalizedString">
3969
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
3957
3970
  </xsl:call-template>
3958
3971
  </xsl:if>
3959
3972
  </xsl:variable>
@@ -6434,13 +6447,13 @@
6434
6447
  <fo:table-body>
6435
6448
 
6436
6449
  <xsl:variable name="title_continued_">
6437
- <xsl:call-template name="getTitle">
6438
- <xsl:with-param name="name" select="'title-continued'"/>
6450
+ <xsl:call-template name="getLocalizedString">
6451
+ <xsl:with-param name="key">continued</xsl:with-param>
6439
6452
  </xsl:call-template>
6440
6453
  </xsl:variable>
6441
-
6454
+ <xsl:variable name="title_continued_in_parenthesis" select="concat('(',$title_continued_,')')"/>
6442
6455
  <xsl:variable name="title_continued">
6443
- <xsl:value-of select="$title_continued_"/>
6456
+ <xsl:value-of select="$title_continued_in_parenthesis"/>
6444
6457
 
6445
6458
  </xsl:variable>
6446
6459
 
@@ -7750,6 +7763,9 @@
7750
7763
  <!-- END Definition List -->
7751
7764
  <!-- ===================== -->
7752
7765
 
7766
+ <!-- default: ignore title in sections/p -->
7767
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
7768
+
7753
7769
  <!-- ========================= -->
7754
7770
  <!-- Rich text formatting -->
7755
7771
  <!-- ========================= -->
@@ -7825,7 +7841,7 @@
7825
7841
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
7826
7842
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
7827
7843
  <xsl:choose>
7828
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
7844
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
7829
7845
  <!-- url -->
7830
7846
  <xsl:call-template name="add-zero-spaces-link-java"/>
7831
7847
  </xsl:when>
@@ -8287,10 +8303,13 @@
8287
8303
  </xsl:choose>
8288
8304
  </xsl:variable>
8289
8305
 
8306
+ <!-- replace sequence #x200B to one &#x200B -->
8307
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
8308
+
8290
8309
  <!-- replace sequence #x200B and space TO space -->
8291
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
8310
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
8292
8311
 
8293
- <xsl:value-of select="$text10"/>
8312
+ <xsl:value-of select="$text11"/>
8294
8313
  </xsl:template>
8295
8314
 
8296
8315
  <xsl:template name="add-zero-spaces-link-java">
@@ -8300,8 +8319,12 @@
8300
8319
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
8301
8320
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
8302
8321
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
8322
+
8323
+ <!-- replace sequence #x200B to one &#x200B -->
8324
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
8325
+
8303
8326
  <!-- remove zero-width space at the end -->
8304
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
8327
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
8305
8328
  </xsl:template>
8306
8329
 
8307
8330
  <!-- add zero space after dash character (for table's entries) -->
@@ -9566,7 +9589,7 @@
9566
9589
 
9567
9590
  <xsl:call-template name="refine_note_block_style"/>
9568
9591
 
9569
- <fo:inline xsl:use-attribute-sets="note-name-style">
9592
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
9570
9593
 
9571
9594
  <xsl:call-template name="refine_note-name-style"/>
9572
9595
 
@@ -9603,12 +9626,12 @@
9603
9626
  <xsl:variable name="num"><xsl:number/></xsl:variable>
9604
9627
  <xsl:choose>
9605
9628
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
9606
- <fo:inline xsl:use-attribute-sets="note-p-style">
9629
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
9607
9630
  <xsl:apply-templates/>
9608
9631
  </fo:inline>
9609
9632
  </xsl:when>
9610
9633
  <xsl:otherwise>
9611
- <fo:block xsl:use-attribute-sets="note-p-style">
9634
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
9612
9635
  <xsl:apply-templates/>
9613
9636
  </fo:block>
9614
9637
  </xsl:otherwise>
@@ -9827,25 +9850,45 @@
9827
9850
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
9828
9851
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
9829
9852
 
9830
- <xsl:variable name="img_src">
9831
- <xsl:choose>
9832
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
9833
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
9834
- </xsl:choose>
9835
- </xsl:variable>
9853
+ <xsl:if test="@width != '' and @width != 'auto'">
9854
+ <xsl:attribute name="width">
9855
+ <xsl:value-of select="@width"/>
9856
+ </xsl:attribute>
9857
+ </xsl:if>
9836
9858
 
9837
- <xsl:variable name="image_width_effective">
9859
+ <xsl:if test="@height != '' and @height != 'auto'">
9860
+ <xsl:attribute name="height">
9861
+ <xsl:value-of select="@height"/>
9862
+ </xsl:attribute>
9863
+ </xsl:if>
9838
9864
 
9839
- <xsl:value-of select="$width_effective"/>
9865
+ <xsl:choose>
9866
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
9867
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
9868
+ </xsl:when>
9869
+ <xsl:otherwise>
9840
9870
 
9841
- </xsl:variable>
9871
+ <xsl:variable name="img_src">
9872
+ <xsl:choose>
9873
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
9874
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
9875
+ </xsl:choose>
9876
+ </xsl:variable>
9842
9877
 
9843
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
9844
- <xsl:if test="number($scale) &lt; 100">
9878
+ <xsl:variable name="image_width_effective">
9845
9879
 
9846
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
9880
+ <xsl:value-of select="$width_effective"/>
9847
9881
 
9848
- </xsl:if>
9882
+ </xsl:variable>
9883
+
9884
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
9885
+ <xsl:if test="number($scale) &lt; 100">
9886
+
9887
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
9888
+
9889
+ </xsl:if>
9890
+ </xsl:otherwise>
9891
+ </xsl:choose>
9849
9892
 
9850
9893
  </xsl:if>
9851
9894
 
@@ -13540,7 +13583,7 @@
13540
13583
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
13541
13584
  <xsl:apply-templates mode="update_xml_step1"/>
13542
13585
  </xsl:template>
13543
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
13586
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
13544
13587
  <xsl:copy>
13545
13588
  <xsl:copy-of select="@*"/>
13546
13589
  <xsl:apply-templates mode="update_xml_step1"/>