metanorma-itu 2.2.5 → 2.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae8bffca61b97282d12a8f010fd5e9845a457f7b926cdb369c8e00182a8b535a
4
- data.tar.gz: 16dff326beb84a5a35f90051ca0be7ad3f9daac15104a626367bf2ca3c361da4
3
+ metadata.gz: d0aff593cb44fbd43690c0dec7b796aae694c20641669d1a52e57e0108b2ec04
4
+ data.tar.gz: 67ec47347f5d85262cb552330a25578f5b2cc6ea98466ad5ba6317f93b3da23a
5
5
  SHA512:
6
- metadata.gz: aa49e3402d52df88338cd0b838ee77433c13e1b04f65167b4d2c7c8e75353704123588061b050a16e0536aa7d4aa5a41034a43c27972c42290f742922b6cb487
7
- data.tar.gz: 54557e86c7cb3f9bfe58561a516df13aa333d69753e42ead97f7cd1368472d235a6f1fb923a8db44aaad0d61d9b81e8158965528ab5051e66084a29f47998bea
6
+ metadata.gz: 5cd80af4151d3c3a9e47a1ad5aae96df063a4e2b76bc67acc92754cadb856309dab054b0082ab0dfa086852e3308465a99b38e354b78a50e0aa51303dfc2872a
7
+ data.tar.gz: efc85fde805aa5f92f6670ef714c7c8361a4ba2e9dec95f907556897ac5ad255bb30185f769e094989e1c93b5fe12d247f6fdf41ec2cb8676e3949a738f1b02c
@@ -882,6 +882,10 @@ nav #toc {
882
882
  max-width: 100%;
883
883
  height: auto; }
884
884
 
885
+ table div.figure {
886
+ padding: 0;
887
+ margin: 0; }
888
+
885
889
  .SourceTitle {
886
890
  font-weight: 700;
887
891
  font-size: 1em;
@@ -158,6 +158,12 @@ nav {
158
158
  font-size: $monospacefontsize;
159
159
  }
160
160
 
161
+ table div.figure {
162
+ padding: 0;
163
+ margin: 0;
164
+ }
165
+
166
+
161
167
  .SourceTitle {
162
168
  @include blockTitle();
163
169
  }
@@ -3899,7 +3899,7 @@
3899
3899
  <xsl:variable name="isDeleted" select="@deleted"/>
3900
3900
 
3901
3901
  <xsl:choose>
3902
- <xsl:when test="@width">
3902
+ <xsl:when test="@width and @width != 'full-page-width' and @width != 'text-width'">
3903
3903
 
3904
3904
  <!-- centered table when table name is centered (see table-name-style) -->
3905
3905
 
@@ -4224,6 +4224,7 @@
4224
4224
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
4225
4225
  <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
4226
4226
  <!-- difference between the available space and the minimum table width -->
4227
+ <_width_min><xsl:value-of select="@width_min"/></_width_min>
4227
4228
  <xsl:variable name="W" select="$page_width - @width_min"/>
4228
4229
  <W><xsl:value-of select="$W"/></W>
4229
4230
  <!-- difference between maximum and minimum width of the table -->
@@ -4891,19 +4892,22 @@
4891
4892
  <xsl:for-each select="xalan:nodeset($references)//fn">
4892
4893
  <xsl:variable name="reference" select="@reference"/>
4893
4894
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
4894
- <fo:block xsl:use-attribute-sets="table-fn-style">
4895
4895
 
4896
- <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
4896
+ <fo:block xsl:use-attribute-sets="table-fn-style">
4897
4897
 
4898
- <xsl:value-of select="@reference"/>
4898
+ <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
4899
4899
 
4900
- <xsl:text>)</xsl:text>
4900
+ <xsl:value-of select="@reference"/>
4901
+
4902
+ <xsl:text>)</xsl:text>
4903
+
4904
+ </fo:inline>
4905
+ <fo:inline xsl:use-attribute-sets="table-fn-body-style">
4906
+ <xsl:copy-of select="./node()"/>
4907
+ </fo:inline>
4908
+
4909
+ </fo:block>
4901
4910
 
4902
- </fo:inline>
4903
- <fo:inline xsl:use-attribute-sets="table-fn-body-style">
4904
- <xsl:copy-of select="./node()"/>
4905
- </fo:inline>
4906
- </fo:block>
4907
4911
  </xsl:if>
4908
4912
  </xsl:for-each>
4909
4913
  </xsl:template>
@@ -5859,12 +5863,12 @@
5859
5863
  <xsl:param name="value"/>
5860
5864
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
5861
5865
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
5862
- <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
5863
- <xsl:attribute name="height">5mm</xsl:attribute>
5866
+ <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%"><!-- alignment-baseline="middle" -->
5867
+ <xsl:attribute name="height">3.5mm</xsl:attribute> <!-- 5mm -->
5864
5868
  <xsl:attribute name="content-width">100%</xsl:attribute>
5865
5869
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5866
5870
  <xsl:attribute name="scaling">uniform</xsl:attribute>
5867
- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
5871
+ <!-- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
5868
5872
  <g>
5869
5873
  <xsl:if test="$type = 'closing' or $type = 'end'">
5870
5874
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
@@ -5878,6 +5882,27 @@
5878
5882
  </xsl:if>
5879
5883
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
5880
5884
  </text>
5885
+ </svg> -->
5886
+ <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
5887
+ <g>
5888
+ <xsl:if test="$type = 'closing' or $type = 'end'">
5889
+ <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
5890
+ </xsl:if>
5891
+ <polyline points="0,2.5 {$maxwidth},2.5 {$maxwidth + 20},40 {$maxwidth},77.5 0,77.5" stroke="black" stroke-width="5" fill="white"/>
5892
+ <line x1="9.5" y1="0" x2="9.5" y2="80" stroke="black" stroke-width="19"/>
5893
+ </g>
5894
+ <xsl:variable name="text_x">
5895
+ <xsl:choose>
5896
+ <xsl:when test="$type = 'closing' or $type = 'end'">28</xsl:when>
5897
+ <xsl:otherwise>22</xsl:otherwise>
5898
+ </xsl:choose>
5899
+ </xsl:variable>
5900
+ <text font-family="Arial" x="{$text_x}" y="50" font-size="40pt">
5901
+ <xsl:value-of select="$kind"/>
5902
+ </text>
5903
+ <text font-family="Arial" x="{$text_x + 33}" y="65" font-size="38pt">
5904
+ <xsl:value-of select="$value"/>
5905
+ </text>
5881
5906
  </svg>
5882
5907
  </fo:instream-foreign-object>
5883
5908
  </xsl:template>
@@ -6132,18 +6157,23 @@
6132
6157
 
6133
6158
  <xsl:template name="add-zero-spaces-java">
6134
6159
  <xsl:param name="text" select="."/>
6135
- <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, arrow right -->
6136
- <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |→)','$1​')"/>
6160
+
6161
+ <!-- add zero-width space (#x200B) after dot with next non-digit -->
6162
+ <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(\.)([^\d\s])','$1​$2')"/>
6163
+ <!-- add zero-width space (#x200B) after characters: dash, equal, underscore, em dash, thin space, arrow right -->
6164
+ <xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1),'(-|=|_|—| |→)','$1​')"/>
6165
+ <!-- add zero-width space (#x200B) after characters: colon, if there aren't digits after -->
6166
+ <xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2),'(:)(\D)','$1​$2')"/>
6137
6167
  <!-- add zero-width space (#x200B) after characters: 'great than' -->
6138
- <xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1), '(\u003e)(?!\u003e)', '$1​')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
6168
+ <xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(\u003e)(?!\u003e)', '$1​')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
6139
6169
  <!-- add zero-width space (#x200B) before characters: 'less than' -->
6140
- <xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2), '(?&lt;!\u003c)(\u003c)', '​$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
6170
+ <xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(?&lt;!\u003c)(\u003c)', '​$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
6141
6171
  <!-- add zero-width space (#x200B) before character: { -->
6142
- <xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
6172
+ <xsl:variable name="text6" select="java:replaceAll(java:java.lang.String.new($text5), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
6143
6173
  <!-- add zero-width space (#x200B) after character: , -->
6144
- <xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
6174
+ <xsl:variable name="text7" select="java:replaceAll(java:java.lang.String.new($text6), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
6145
6175
 
6146
- <xsl:value-of select="$text5"/>
6176
+ <xsl:value-of select="$text7"/>
6147
6177
  </xsl:template>
6148
6178
 
6149
6179
  <xsl:template name="add-zero-spaces-link-java">
@@ -6152,7 +6182,9 @@
6152
6182
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
6153
6183
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
6154
6184
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
6155
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
6185
+ <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
6186
+ <!-- remove zero-width space at the end -->
6187
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
6156
6188
  </xsl:template>
6157
6189
 
6158
6190
  <!-- add zero space after dash character (for table's entries) -->
@@ -6289,7 +6321,7 @@
6289
6321
  </xsl:copy>
6290
6322
  </xsl:template>
6291
6323
 
6292
- <xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode'])]" mode="table-without-br">
6324
+ <xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode']) and not(*[local-name()='ul']) and not(*[local-name()='ol'])]" mode="table-without-br">
6293
6325
  <xsl:copy>
6294
6326
  <xsl:copy-of select="@*"/>
6295
6327
  <p>
@@ -6365,6 +6397,14 @@
6365
6397
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
6366
6398
  </xsl:template>
6367
6399
 
6400
+ <xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'ol' or local-name() = 'ul']" mode="table-without-br">
6401
+ <xsl:apply-templates mode="table-without-br"/>
6402
+ </xsl:template>
6403
+
6404
+ <xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'li']" mode="table-without-br">
6405
+ <xsl:apply-templates mode="table-without-br"/>
6406
+ </xsl:template>
6407
+
6368
6408
  <!-- mode="table-without-br" -->
6369
6409
  <!-- ================================== -->
6370
6410
  <!-- END: Step 0. replace <br/> to <p>...</p> -->
@@ -7178,7 +7218,7 @@
7178
7218
 
7179
7219
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
7180
7220
 
7181
- <fo:block-container margin-left="0mm">
7221
+ <fo:block-container margin-left="0mm" margin-right="0mm">
7182
7222
 
7183
7223
  <fo:block>
7184
7224
 
@@ -7360,11 +7400,14 @@
7360
7400
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
7361
7401
  </xsl:call-template>
7362
7402
 
7403
+ <!-- Example: Dimensions in millimeters -->
7404
+ <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
7405
+
7363
7406
  <fo:block xsl:use-attribute-sets="figure-style">
7364
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7407
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
7365
7408
  </fo:block>
7366
7409
  <xsl:call-template name="fn_display_figure"/>
7367
- <xsl:for-each select="*[local-name() = 'note']">
7410
+ <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
7368
7411
  <xsl:call-template name="note"/>
7369
7412
  </xsl:for-each>
7370
7413
 
@@ -7621,24 +7664,47 @@
7621
7664
 
7622
7665
  </xsl:when>
7623
7666
  <xsl:otherwise>
7624
- <fo:block xsl:use-attribute-sets="image-style">
7625
- <fo:instream-foreign-object fox:alt-text="{$alt-text}">
7626
- <xsl:attribute name="width">100%</xsl:attribute>
7627
- <xsl:attribute name="content-height">100%</xsl:attribute>
7628
- <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7629
- <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
7630
- <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
7631
- <!-- effective height 297 - 27.4 - 13 = 256.6 -->
7632
- <!-- effective width 210 - 12.5 - 25 = 172.5 -->
7633
- <!-- effective height / width = 1.48, 1.4 - with title -->
7634
- <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
7635
- <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
7636
- <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
7637
- </xsl:if>
7638
- <xsl:attribute name="scaling">uniform</xsl:attribute>
7639
- <xsl:copy-of select="$svg_content"/>
7640
- </fo:instream-foreign-object>
7641
- </fo:block>
7667
+
7668
+ <xsl:variable name="element">
7669
+ <xsl:choose>
7670
+ <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
7671
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
7672
+ </xsl:when>
7673
+ <xsl:otherwise>
7674
+ <fo:block xsl:use-attribute-sets="image-style">
7675
+ <xsl:if test="ancestor::*[local-name() = 'dt']">
7676
+ <xsl:attribute name="text-align">left</xsl:attribute>
7677
+ </xsl:if>
7678
+ </fo:block>
7679
+ </xsl:otherwise>
7680
+ </xsl:choose>
7681
+ </xsl:variable>
7682
+
7683
+ <xsl:for-each select="xalan:nodeset($element)/*">
7684
+ <xsl:copy>
7685
+ <xsl:copy-of select="@*"/>
7686
+ <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
7687
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
7688
+ <xsl:if test="$isGenerateTableIF = 'false'">
7689
+ <xsl:attribute name="width">100%</xsl:attribute>
7690
+ </xsl:if>
7691
+ <xsl:attribute name="content-height">100%</xsl:attribute>
7692
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7693
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
7694
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
7695
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
7696
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
7697
+ <!-- effective height / width = 1.48, 1.4 - with title -->
7698
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
7699
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
7700
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
7701
+ </xsl:if>
7702
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
7703
+ <xsl:copy-of select="$svg_content"/>
7704
+ </fo:instream-foreign-object>
7705
+ <!-- </fo:block> -->
7706
+ </xsl:copy>
7707
+ </xsl:for-each>
7642
7708
  </xsl:otherwise>
7643
7709
  </xsl:choose>
7644
7710
  </xsl:template>
@@ -7730,6 +7796,13 @@
7730
7796
  </xsl:for-each>
7731
7797
  </xsl:template>
7732
7798
 
7799
+ <!-- For the structures like: <dt><image src="" mimetype="image/svg+xml" height="" width=""><svg xmlns="http://www.w3.org/2000/svg" ... -->
7800
+ <xsl:template match="*[local-name() != 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
7801
+ <xsl:for-each select="*[local-name() = 'svg']">
7802
+ <xsl:call-template name="image_svg"/>
7803
+ </xsl:for-each>
7804
+ </xsl:template>
7805
+
7733
7806
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
7734
7807
  <xsl:variable name="svg_content" select="document(@src)"/>
7735
7808
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -7868,6 +7941,8 @@
7868
7941
  <xsl:value-of select="."/>
7869
7942
  </xsl:template>
7870
7943
 
7944
+ <xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="bookmarks" priority="3"/>
7945
+
7871
7946
  <xsl:template match="node()" mode="contents">
7872
7947
  <xsl:apply-templates mode="contents"/>
7873
7948
  </xsl:template>
@@ -8175,7 +8250,15 @@
8175
8250
  <xsl:value-of select="@section"/>
8176
8251
  <xsl:text> </xsl:text>
8177
8252
  </xsl:if>
8178
- <xsl:value-of select="normalize-space(title)"/>
8253
+ <xsl:variable name="title">
8254
+ <xsl:for-each select="title/node()">
8255
+ <xsl:choose>
8256
+ <xsl:when test="local-name() = 'add' and starts-with(., $ace_tag)"><!-- skip --></xsl:when>
8257
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
8258
+ </xsl:choose>
8259
+ </xsl:for-each>
8260
+ </xsl:variable>
8261
+ <xsl:value-of select="normalize-space($title)"/>
8179
8262
  </fo:bookmark-title>
8180
8263
  <xsl:apply-templates mode="bookmark"/>
8181
8264
  </fo:bookmark>
@@ -8201,6 +8284,12 @@
8201
8284
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
8202
8285
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/>
8203
8286
 
8287
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] | *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
8288
+ <fo:block text-align="right" keep-with-next="always">
8289
+ <xsl:apply-templates/>
8290
+ </fo:block>
8291
+ </xsl:template>
8292
+
8204
8293
  <!-- ====== -->
8205
8294
  <!-- ====== -->
8206
8295
  <xsl:template match="*[local-name() = 'title']" mode="contents_item">
@@ -8350,6 +8439,10 @@
8350
8439
  </xsl:for-each>
8351
8440
  </xsl:template>
8352
8441
 
8442
+ <xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="contents_item" priority="2">
8443
+ <xsl:value-of select="."/>
8444
+ </xsl:template>
8445
+
8353
8446
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
8354
8447
  <xsl:template match="*[local-name() = 'span']" mode="contents_item">
8355
8448
  <xsl:apply-templates mode="contents_item"/>