metanorma-ogc 2.3.3 → 2.3.4

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: 4fc9c0bc51e804a7f6f333abdc8f18509fda087d9ad9978d1d3f09873745b4c0
4
- data.tar.gz: 75e291d2155ff6fc9b81342b8a817485f3ae283c77c407f9dd066f9d1bf4cf2c
3
+ metadata.gz: e8f16660dc4e9b8e16ea11cfddfc8b40fd617a9b7c8848c31f8fdfeb6d02835d
4
+ data.tar.gz: 9e2c89ee7f4caa6c115a02f18eb8a3e4704ab460307b25cf624ea6eabd697cb0
5
5
  SHA512:
6
- metadata.gz: d12c68acab1037cf2b67970d99d2c21ff0b9a67afcf1080518c4e5913ddba67df0e842ab545ca48fe0d9d03ace9ae512d7efcf8994400344fbefa43214aee385
7
- data.tar.gz: 3d99691f22c7c95a52f00232a79eebe9e94c4be5a3938508427309d8413ab26fdc0e3d9ec40cf85b8e309481730139c62b37e25676fd56024b5e0489a58cea2d
6
+ metadata.gz: 1236035fa414f29a2f2cd82a982d9aca23a36bf50c405729710f9a954276cf67d581945f3c7a747a53fb0a30338a155c5331fcdda69885f0c55bc2894dc03c7f
7
+ data.tar.gz: b75a75e64a73e7f1fd33d36007304f83ed4254e5ac90a6c4df38fd9187c31662c97374236ce2e98ea31fb9c4aa4aa3fc65981db8e9243860102c2c8ef1e2968e
@@ -699,6 +699,10 @@ dl {
699
699
  max-width: 100%;
700
700
  height: auto; }
701
701
 
702
+ table div.figure {
703
+ padding: 0;
704
+ margin: 0; }
705
+
702
706
  .document-stage-band {
703
707
  left: 0;
704
708
  top: 0;
@@ -139,6 +139,12 @@ nav {
139
139
  @include figureBlock();
140
140
  }
141
141
 
142
+ table div.figure {
143
+ padding: 0;
144
+ margin: 0;
145
+ }
146
+
147
+
142
148
  .document-stage-band {
143
149
  @include docBand($order: 1, $textLength: 160px, $fontWeight: 300);
144
150
  }
@@ -3232,6 +3232,7 @@
3232
3232
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
3233
3233
 
3234
3234
  <xsl:choose>
3235
+ <xsl:when test="@width = 'full-page-width' or @width = 'text-width'">100%</xsl:when>
3235
3236
  <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
3236
3237
  <xsl:otherwise><xsl:value-of select="$table_width_default"/></xsl:otherwise>
3237
3238
  </xsl:choose>
@@ -3348,7 +3349,7 @@
3348
3349
  <xsl:variable name="isDeleted" select="@deleted"/>
3349
3350
 
3350
3351
  <xsl:choose>
3351
- <xsl:when test="@width">
3352
+ <xsl:when test="@width and @width != 'full-page-width' and @width != 'text-width'">
3352
3353
 
3353
3354
  <!-- centered table when table name is centered (see table-name-style) -->
3354
3355
 
@@ -3670,6 +3671,7 @@
3670
3671
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
3671
3672
  <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
3672
3673
  <!-- difference between the available space and the minimum table width -->
3674
+ <_width_min><xsl:value-of select="@width_min"/></_width_min>
3673
3675
  <xsl:variable name="W" select="$page_width - @width_min"/>
3674
3676
  <W><xsl:value-of select="$W"/></W>
3675
3677
  <!-- difference between maximum and minimum width of the table -->
@@ -4301,17 +4303,20 @@
4301
4303
  <xsl:for-each select="xalan:nodeset($references)//fn">
4302
4304
  <xsl:variable name="reference" select="@reference"/>
4303
4305
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
4304
- <fo:block xsl:use-attribute-sets="table-fn-style">
4305
4306
 
4306
- <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
4307
+ <fo:block xsl:use-attribute-sets="table-fn-style">
4307
4308
 
4308
- <xsl:value-of select="@reference"/>
4309
+ <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
4310
+
4311
+ <xsl:value-of select="@reference"/>
4312
+
4313
+ </fo:inline>
4314
+ <fo:inline xsl:use-attribute-sets="table-fn-body-style">
4315
+ <xsl:copy-of select="./node()"/>
4316
+ </fo:inline>
4317
+
4318
+ </fo:block>
4309
4319
 
4310
- </fo:inline>
4311
- <fo:inline xsl:use-attribute-sets="table-fn-body-style">
4312
- <xsl:copy-of select="./node()"/>
4313
- </fo:inline>
4314
- </fo:block>
4315
4320
  </xsl:if>
4316
4321
  </xsl:for-each>
4317
4322
  </xsl:template>
@@ -5263,12 +5268,12 @@
5263
5268
  <xsl:param name="value"/>
5264
5269
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
5265
5270
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
5266
- <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
5267
- <xsl:attribute name="height">5mm</xsl:attribute>
5271
+ <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%"><!-- alignment-baseline="middle" -->
5272
+ <xsl:attribute name="height">3.5mm</xsl:attribute> <!-- 5mm -->
5268
5273
  <xsl:attribute name="content-width">100%</xsl:attribute>
5269
5274
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5270
5275
  <xsl:attribute name="scaling">uniform</xsl:attribute>
5271
- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
5276
+ <!-- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
5272
5277
  <g>
5273
5278
  <xsl:if test="$type = 'closing' or $type = 'end'">
5274
5279
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
@@ -5282,6 +5287,27 @@
5282
5287
  </xsl:if>
5283
5288
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
5284
5289
  </text>
5290
+ </svg> -->
5291
+ <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
5292
+ <g>
5293
+ <xsl:if test="$type = 'closing' or $type = 'end'">
5294
+ <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
5295
+ </xsl:if>
5296
+ <polyline points="0,2.5 {$maxwidth},2.5 {$maxwidth + 20},40 {$maxwidth},77.5 0,77.5" stroke="black" stroke-width="5" fill="white"/>
5297
+ <line x1="9.5" y1="0" x2="9.5" y2="80" stroke="black" stroke-width="19"/>
5298
+ </g>
5299
+ <xsl:variable name="text_x">
5300
+ <xsl:choose>
5301
+ <xsl:when test="$type = 'closing' or $type = 'end'">28</xsl:when>
5302
+ <xsl:otherwise>22</xsl:otherwise>
5303
+ </xsl:choose>
5304
+ </xsl:variable>
5305
+ <text font-family="Arial" x="{$text_x}" y="50" font-size="40pt">
5306
+ <xsl:value-of select="$kind"/>
5307
+ </text>
5308
+ <text font-family="Arial" x="{$text_x + 33}" y="65" font-size="38pt">
5309
+ <xsl:value-of select="$value"/>
5310
+ </text>
5285
5311
  </svg>
5286
5312
  </fo:instream-foreign-object>
5287
5313
  </xsl:template>
@@ -5536,18 +5562,23 @@
5536
5562
 
5537
5563
  <xsl:template name="add-zero-spaces-java">
5538
5564
  <xsl:param name="text" select="."/>
5539
- <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, arrow right -->
5540
- <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |→)','$1​')"/>
5565
+
5566
+ <!-- add zero-width space (#x200B) after dot with next non-digit -->
5567
+ <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(\.)([^\d\s])','$1​$2')"/>
5568
+ <!-- add zero-width space (#x200B) after characters: dash, equal, underscore, em dash, thin space, arrow right -->
5569
+ <xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1),'(-|=|_|—| |→)','$1​')"/>
5570
+ <!-- add zero-width space (#x200B) after characters: colon, if there aren't digits after -->
5571
+ <xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2),'(:)(\D)','$1​$2')"/>
5541
5572
  <!-- add zero-width space (#x200B) after characters: 'great than' -->
5542
- <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' -->
5573
+ <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' -->
5543
5574
  <!-- add zero-width space (#x200B) before characters: 'less than' -->
5544
- <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' -->
5575
+ <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' -->
5545
5576
  <!-- add zero-width space (#x200B) before character: { -->
5546
- <xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
5577
+ <xsl:variable name="text6" select="java:replaceAll(java:java.lang.String.new($text5), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
5547
5578
  <!-- add zero-width space (#x200B) after character: , -->
5548
- <xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
5579
+ <xsl:variable name="text7" select="java:replaceAll(java:java.lang.String.new($text6), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
5549
5580
 
5550
- <xsl:value-of select="$text5"/>
5581
+ <xsl:value-of select="$text7"/>
5551
5582
  </xsl:template>
5552
5583
 
5553
5584
  <xsl:template name="add-zero-spaces-link-java">
@@ -5556,7 +5587,9 @@
5556
5587
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
5557
5588
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5558
5589
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
5559
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
5590
+ <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
5591
+ <!-- remove zero-width space at the end -->
5592
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5560
5593
  </xsl:template>
5561
5594
 
5562
5595
  <!-- add zero space after dash character (for table's entries) -->
@@ -5693,7 +5726,7 @@
5693
5726
  </xsl:copy>
5694
5727
  </xsl:template>
5695
5728
 
5696
- <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">
5729
+ <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">
5697
5730
  <xsl:copy>
5698
5731
  <xsl:copy-of select="@*"/>
5699
5732
  <p>
@@ -5769,6 +5802,14 @@
5769
5802
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
5770
5803
  </xsl:template>
5771
5804
 
5805
+ <xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'ol' or local-name() = 'ul']" mode="table-without-br">
5806
+ <xsl:apply-templates mode="table-without-br"/>
5807
+ </xsl:template>
5808
+
5809
+ <xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'li']" mode="table-without-br">
5810
+ <xsl:apply-templates mode="table-without-br"/>
5811
+ </xsl:template>
5812
+
5772
5813
  <!-- mode="table-without-br" -->
5773
5814
  <!-- ================================== -->
5774
5815
  <!-- END: Step 0. replace <br/> to <p>...</p> -->
@@ -6586,7 +6627,7 @@
6586
6627
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
6587
6628
  </xsl:if>
6588
6629
 
6589
- <fo:block-container margin-left="0mm">
6630
+ <fo:block-container margin-left="0mm" margin-right="0mm">
6590
6631
 
6591
6632
  <fo:block>
6592
6633
 
@@ -6764,11 +6805,14 @@
6764
6805
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
6765
6806
  </xsl:call-template>
6766
6807
 
6808
+ <!-- Example: Dimensions in millimeters -->
6809
+ <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
6810
+
6767
6811
  <fo:block xsl:use-attribute-sets="figure-style">
6768
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6812
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
6769
6813
  </fo:block>
6770
6814
  <xsl:call-template name="fn_display_figure"/>
6771
- <xsl:for-each select="*[local-name() = 'note']">
6815
+ <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
6772
6816
  <xsl:call-template name="note"/>
6773
6817
  </xsl:for-each>
6774
6818
 
@@ -7025,24 +7069,47 @@
7025
7069
 
7026
7070
  </xsl:when>
7027
7071
  <xsl:otherwise>
7028
- <fo:block xsl:use-attribute-sets="image-style">
7029
- <fo:instream-foreign-object fox:alt-text="{$alt-text}">
7030
- <xsl:attribute name="width">100%</xsl:attribute>
7031
- <xsl:attribute name="content-height">100%</xsl:attribute>
7032
- <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7033
- <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
7034
- <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
7035
- <!-- effective height 297 - 27.4 - 13 = 256.6 -->
7036
- <!-- effective width 210 - 12.5 - 25 = 172.5 -->
7037
- <!-- effective height / width = 1.48, 1.4 - with title -->
7038
- <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
7039
- <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
7040
- <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
7041
- </xsl:if>
7042
- <xsl:attribute name="scaling">uniform</xsl:attribute>
7043
- <xsl:copy-of select="$svg_content"/>
7044
- </fo:instream-foreign-object>
7045
- </fo:block>
7072
+
7073
+ <xsl:variable name="element">
7074
+ <xsl:choose>
7075
+ <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
7076
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
7077
+ </xsl:when>
7078
+ <xsl:otherwise>
7079
+ <fo:block xsl:use-attribute-sets="image-style">
7080
+ <xsl:if test="ancestor::*[local-name() = 'dt']">
7081
+ <xsl:attribute name="text-align">left</xsl:attribute>
7082
+ </xsl:if>
7083
+ </fo:block>
7084
+ </xsl:otherwise>
7085
+ </xsl:choose>
7086
+ </xsl:variable>
7087
+
7088
+ <xsl:for-each select="xalan:nodeset($element)/*">
7089
+ <xsl:copy>
7090
+ <xsl:copy-of select="@*"/>
7091
+ <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
7092
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
7093
+ <xsl:if test="$isGenerateTableIF = 'false'">
7094
+ <xsl:attribute name="width">100%</xsl:attribute>
7095
+ </xsl:if>
7096
+ <xsl:attribute name="content-height">100%</xsl:attribute>
7097
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7098
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
7099
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
7100
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
7101
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
7102
+ <!-- effective height / width = 1.48, 1.4 - with title -->
7103
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
7104
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
7105
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
7106
+ </xsl:if>
7107
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
7108
+ <xsl:copy-of select="$svg_content"/>
7109
+ </fo:instream-foreign-object>
7110
+ <!-- </fo:block> -->
7111
+ </xsl:copy>
7112
+ </xsl:for-each>
7046
7113
  </xsl:otherwise>
7047
7114
  </xsl:choose>
7048
7115
  </xsl:template>
@@ -7134,6 +7201,13 @@
7134
7201
  </xsl:for-each>
7135
7202
  </xsl:template>
7136
7203
 
7204
+ <!-- For the structures like: <dt><image src="" mimetype="image/svg+xml" height="" width=""><svg xmlns="http://www.w3.org/2000/svg" ... -->
7205
+ <xsl:template match="*[local-name() != 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
7206
+ <xsl:for-each select="*[local-name() = 'svg']">
7207
+ <xsl:call-template name="image_svg"/>
7208
+ </xsl:for-each>
7209
+ </xsl:template>
7210
+
7137
7211
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
7138
7212
  <xsl:variable name="svg_content" select="document(@src)"/>
7139
7213
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -7272,6 +7346,8 @@
7272
7346
  <xsl:value-of select="."/>
7273
7347
  </xsl:template>
7274
7348
 
7349
+ <xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="bookmarks" priority="3"/>
7350
+
7275
7351
  <xsl:template match="node()" mode="contents">
7276
7352
  <xsl:apply-templates mode="contents"/>
7277
7353
  </xsl:template>
@@ -7597,7 +7673,15 @@
7597
7673
  <xsl:value-of select="@section"/>
7598
7674
  <xsl:text> </xsl:text>
7599
7675
  </xsl:if>
7600
- <xsl:value-of select="normalize-space(title)"/>
7676
+ <xsl:variable name="title">
7677
+ <xsl:for-each select="title/node()">
7678
+ <xsl:choose>
7679
+ <xsl:when test="local-name() = 'add' and starts-with(., $ace_tag)"><!-- skip --></xsl:when>
7680
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7681
+ </xsl:choose>
7682
+ </xsl:for-each>
7683
+ </xsl:variable>
7684
+ <xsl:value-of select="normalize-space($title)"/>
7601
7685
  </fo:bookmark-title>
7602
7686
  <xsl:apply-templates mode="bookmark"/>
7603
7687
  </fo:bookmark>
@@ -7623,6 +7707,12 @@
7623
7707
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
7624
7708
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/>
7625
7709
 
7710
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] | *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
7711
+ <fo:block text-align="right" keep-with-next="always">
7712
+ <xsl:apply-templates/>
7713
+ </fo:block>
7714
+ </xsl:template>
7715
+
7626
7716
  <!-- ====== -->
7627
7717
  <!-- ====== -->
7628
7718
  <xsl:template match="*[local-name() = 'title']" mode="contents_item">
@@ -7772,6 +7862,10 @@
7772
7862
  </xsl:for-each>
7773
7863
  </xsl:template>
7774
7864
 
7865
+ <xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="contents_item" priority="2">
7866
+ <xsl:value-of select="."/>
7867
+ </xsl:template>
7868
+
7775
7869
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
7776
7870
  <xsl:template match="*[local-name() = 'span']" mode="contents_item">
7777
7871
  <xsl:apply-templates mode="contents_item"/>