metanorma-iso 2.3.4 → 2.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,6 +19,7 @@
19
19
  </xsl:if>
20
20
  </xsl:variable>
21
21
  <xsl:variable name="docidentifierISO" select="normalize-space($docidentifierISO_)"/>
22
+ <xsl:variable name="docidentifierISO_with_break" select="java:replaceAll(java:java.lang.String.new($docidentifierISO),'^([^\d]+) (\d)', concat('$1', $linebreak, '$2'))"/> <!-- add line break before 1st sequence 'space digit' -->
22
23
 
23
24
  <xsl:variable name="all_rights_reserved">
24
25
  <xsl:call-template name="getLocalizedString">
@@ -856,7 +857,7 @@
856
857
  <xsl:if test="$font-size != ''">
857
858
  <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
858
859
  </xsl:if>
859
- <xsl:value-of select="$docidentifierISO"/>
860
+ <xsl:value-of select="$docidentifierISO_with_break"/>
860
861
  </fo:block>
861
862
  </fo:table-cell>
862
863
  </fo:table-row>
@@ -1105,7 +1106,7 @@
1105
1106
  </fo:table-cell>
1106
1107
  <fo:table-cell>
1107
1108
  <fo:block text-align="right" font-weight="bold" margin-bottom="13mm">
1108
- <xsl:value-of select="$docidentifierISO"/>
1109
+ <xsl:value-of select="$docidentifierISO_with_break"/>
1109
1110
  </fo:block>
1110
1111
  </fo:table-cell>
1111
1112
  </fo:table-row>
@@ -4102,7 +4103,7 @@
4102
4103
  <xsl:variable name="isDeleted" select="@deleted"/>
4103
4104
 
4104
4105
  <xsl:choose>
4105
- <xsl:when test="@width">
4106
+ <xsl:when test="@width and @width != 'full-page-width' and @width != 'text-width'">
4106
4107
 
4107
4108
  <!-- centered table when table name is centered (see table-name-style) -->
4108
4109
 
@@ -4446,6 +4447,7 @@
4446
4447
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
4447
4448
  <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
4448
4449
  <!-- difference between the available space and the minimum table width -->
4450
+ <_width_min><xsl:value-of select="@width_min"/></_width_min>
4449
4451
  <xsl:variable name="W" select="$page_width - @width_min"/>
4450
4452
  <W><xsl:value-of select="$W"/></W>
4451
4453
  <!-- difference between maximum and minimum width of the table -->
@@ -5154,17 +5156,20 @@
5154
5156
  <xsl:for-each select="xalan:nodeset($references)//fn">
5155
5157
  <xsl:variable name="reference" select="@reference"/>
5156
5158
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
5157
- <fo:block xsl:use-attribute-sets="table-fn-style">
5158
5159
 
5159
- <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
5160
+ <fo:block xsl:use-attribute-sets="table-fn-style">
5160
5161
 
5161
- <xsl:value-of select="@reference"/>
5162
+ <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
5163
+
5164
+ <xsl:value-of select="@reference"/>
5165
+
5166
+ </fo:inline>
5167
+ <fo:inline xsl:use-attribute-sets="table-fn-body-style">
5168
+ <xsl:copy-of select="./node()"/>
5169
+ </fo:inline>
5170
+
5171
+ </fo:block>
5162
5172
 
5163
- </fo:inline>
5164
- <fo:inline xsl:use-attribute-sets="table-fn-body-style">
5165
- <xsl:copy-of select="./node()"/>
5166
- </fo:inline>
5167
- </fo:block>
5168
5173
  </xsl:if>
5169
5174
  </xsl:for-each>
5170
5175
  </xsl:template>
@@ -5363,7 +5368,7 @@
5363
5368
 
5364
5369
  <xsl:variable name="key_iso">
5365
5370
 
5366
- <xsl:if test="$parent = 'figure' or $parent = 'formula'">true</xsl:if>
5371
+ <xsl:if test="$parent = 'figure' or $parent = 'formula' or ../@key = 'true'">true</xsl:if>
5367
5372
  <!-- and (not(../@class) or ../@class !='pseudocode') -->
5368
5373
  </xsl:variable>
5369
5374
 
@@ -6123,12 +6128,12 @@
6123
6128
  <xsl:param name="value"/>
6124
6129
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
6125
6130
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
6126
- <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
6127
- <xsl:attribute name="height">5mm</xsl:attribute>
6131
+ <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%"><!-- alignment-baseline="middle" -->
6132
+ <xsl:attribute name="height">3.5mm</xsl:attribute> <!-- 5mm -->
6128
6133
  <xsl:attribute name="content-width">100%</xsl:attribute>
6129
6134
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6130
6135
  <xsl:attribute name="scaling">uniform</xsl:attribute>
6131
- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
6136
+ <!-- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
6132
6137
  <g>
6133
6138
  <xsl:if test="$type = 'closing' or $type = 'end'">
6134
6139
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
@@ -6142,6 +6147,27 @@
6142
6147
  </xsl:if>
6143
6148
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
6144
6149
  </text>
6150
+ </svg> -->
6151
+ <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
6152
+ <g>
6153
+ <xsl:if test="$type = 'closing' or $type = 'end'">
6154
+ <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
6155
+ </xsl:if>
6156
+ <polyline points="0,2.5 {$maxwidth},2.5 {$maxwidth + 20},40 {$maxwidth},77.5 0,77.5" stroke="black" stroke-width="5" fill="white"/>
6157
+ <line x1="9.5" y1="0" x2="9.5" y2="80" stroke="black" stroke-width="19"/>
6158
+ </g>
6159
+ <xsl:variable name="text_x">
6160
+ <xsl:choose>
6161
+ <xsl:when test="$type = 'closing' or $type = 'end'">28</xsl:when>
6162
+ <xsl:otherwise>22</xsl:otherwise>
6163
+ </xsl:choose>
6164
+ </xsl:variable>
6165
+ <text font-family="Arial" x="{$text_x}" y="50" font-size="40pt">
6166
+ <xsl:value-of select="$kind"/>
6167
+ </text>
6168
+ <text font-family="Arial" x="{$text_x + 33}" y="65" font-size="38pt">
6169
+ <xsl:value-of select="$value"/>
6170
+ </text>
6145
6171
  </svg>
6146
6172
  </fo:instream-foreign-object>
6147
6173
  </xsl:template>
@@ -6210,7 +6236,7 @@
6210
6236
  </xsl:copy>
6211
6237
  </xsl:template>
6212
6238
 
6213
- <xsl:template match="*[local-name() = 'pagebreak']" mode="landscape_portrait">
6239
+ <xsl:template match="*[local-name() = 'pagebreak'][not(following-sibling::*[1][local-name() = 'pagebreak'])]" mode="landscape_portrait">
6214
6240
 
6215
6241
  <!-- determine pagebreak is last element before </fo:flow> or not -->
6216
6242
  <xsl:variable name="isLast">
@@ -6222,16 +6248,18 @@
6222
6248
  <xsl:if test="contains($isLast, 'false')">
6223
6249
 
6224
6250
  <xsl:variable name="orientation" select="normalize-space(@orientation)"/>
6225
- <xsl:variable name="tree">
6251
+
6252
+ <xsl:variable name="tree_">
6226
6253
  <xsl:for-each select="ancestor::*[ancestor::fo:flow]">
6227
6254
  <element pos="{position()}">
6228
6255
  <xsl:value-of select="name()"/>
6229
6256
  </element>
6230
6257
  </xsl:for-each>
6231
6258
  </xsl:variable>
6259
+ <xsl:variable name="tree" select="xalan:nodeset($tree_)"/>
6232
6260
 
6233
6261
  <!-- close fo:page-sequence (closing preceding fo elements) -->
6234
- <xsl:for-each select="xalan:nodeset($tree)//element">
6262
+ <xsl:for-each select="$tree//element">
6235
6263
  <xsl:sort data-type="number" order="descending" select="@pos"/>
6236
6264
  <xsl:text disable-output-escaping="yes">&lt;/</xsl:text>
6237
6265
  <xsl:value-of select="."/>
@@ -6242,7 +6270,6 @@
6242
6270
 
6243
6271
  <!-- <pagebreak/> -->
6244
6272
  <!-- create a new fo:page-sequence (opening fo elements) -->
6245
-
6246
6273
  <xsl:text disable-output-escaping="yes">&lt;fo:page-sequence master-reference="document</xsl:text><xsl:if test="$orientation != ''">-<xsl:value-of select="$orientation"/></xsl:if><xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
6247
6274
  <fo:static-content flow-name="xsl-footnote-separator">
6248
6275
  <fo:block>
@@ -6252,7 +6279,7 @@
6252
6279
  <xsl:call-template name="insertHeaderFooter"/>
6253
6280
  <xsl:text disable-output-escaping="yes">&lt;fo:flow flow-name="xsl-region-body"&gt;</xsl:text>
6254
6281
 
6255
- <xsl:for-each select="xalan:nodeset($tree)//element">
6282
+ <xsl:for-each select="$tree//element">
6256
6283
  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
6257
6284
  <xsl:value-of select="."/>
6258
6285
  <xsl:for-each select="@*[local-name() != 'pos']">
@@ -6264,6 +6291,7 @@
6264
6291
  </xsl:for-each>
6265
6292
  <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
6266
6293
  </xsl:for-each>
6294
+
6267
6295
  </xsl:if>
6268
6296
  </xsl:template>
6269
6297
  <!-- ================================================================ -->
@@ -6465,18 +6493,23 @@
6465
6493
 
6466
6494
  <xsl:template name="add-zero-spaces-java">
6467
6495
  <xsl:param name="text" select="."/>
6468
- <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, arrow right -->
6469
- <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |→)','$1​')"/>
6496
+
6497
+ <!-- add zero-width space (#x200B) after dot with next non-digit -->
6498
+ <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(\.)([^\d\s])','$1​$2')"/>
6499
+ <!-- add zero-width space (#x200B) after characters: dash, equal, underscore, em dash, thin space, arrow right -->
6500
+ <xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1),'(-|=|_|—| |→)','$1​')"/>
6501
+ <!-- add zero-width space (#x200B) after characters: colon, if there aren't digits after -->
6502
+ <xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2),'(:)(\D)','$1​$2')"/>
6470
6503
  <!-- add zero-width space (#x200B) after characters: 'great than' -->
6471
- <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' -->
6504
+ <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' -->
6472
6505
  <!-- add zero-width space (#x200B) before characters: 'less than' -->
6473
- <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' -->
6506
+ <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' -->
6474
6507
  <!-- add zero-width space (#x200B) before character: { -->
6475
- <xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
6508
+ <xsl:variable name="text6" select="java:replaceAll(java:java.lang.String.new($text5), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
6476
6509
  <!-- add zero-width space (#x200B) after character: , -->
6477
- <xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
6510
+ <xsl:variable name="text7" select="java:replaceAll(java:java.lang.String.new($text6), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
6478
6511
 
6479
- <xsl:value-of select="$text5"/>
6512
+ <xsl:value-of select="$text7"/>
6480
6513
  </xsl:template>
6481
6514
 
6482
6515
  <xsl:template name="add-zero-spaces-link-java">
@@ -6485,7 +6518,9 @@
6485
6518
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
6486
6519
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
6487
6520
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
6488
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
6521
+ <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
6522
+ <!-- remove zero-width space at the end -->
6523
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
6489
6524
  </xsl:template>
6490
6525
 
6491
6526
  <!-- add zero space after dash character (for table's entries) -->
@@ -6622,7 +6657,7 @@
6622
6657
  </xsl:copy>
6623
6658
  </xsl:template>
6624
6659
 
6625
- <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">
6660
+ <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">
6626
6661
  <xsl:copy>
6627
6662
  <xsl:copy-of select="@*"/>
6628
6663
  <p>
@@ -6698,6 +6733,14 @@
6698
6733
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
6699
6734
  </xsl:template>
6700
6735
 
6736
+ <xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'ol' or local-name() = 'ul']" mode="table-without-br">
6737
+ <xsl:apply-templates mode="table-without-br"/>
6738
+ </xsl:template>
6739
+
6740
+ <xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'li']" mode="table-without-br">
6741
+ <xsl:apply-templates mode="table-without-br"/>
6742
+ </xsl:template>
6743
+
6701
6744
  <!-- mode="table-without-br" -->
6702
6745
  <!-- ================================== -->
6703
6746
  <!-- END: Step 0. replace <br/> to <p>...</p> -->
@@ -7522,7 +7565,7 @@
7522
7565
  <xsl:attribute name="font-size">inherit</xsl:attribute>
7523
7566
  </xsl:if>
7524
7567
 
7525
- <fo:block-container margin-left="0mm">
7568
+ <fo:block-container margin-left="0mm" margin-right="0mm">
7526
7569
 
7527
7570
  <fo:block>
7528
7571
 
@@ -7704,11 +7747,14 @@
7704
7747
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
7705
7748
  </xsl:call-template>
7706
7749
 
7750
+ <!-- Example: Dimensions in millimeters -->
7751
+ <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
7752
+
7707
7753
  <fo:block xsl:use-attribute-sets="figure-style">
7708
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7754
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
7709
7755
  </fo:block>
7710
7756
  <xsl:call-template name="fn_display_figure"/>
7711
- <xsl:for-each select="*[local-name() = 'note']">
7757
+ <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
7712
7758
  <xsl:call-template name="note"/>
7713
7759
  </xsl:for-each>
7714
7760
 
@@ -7965,24 +8011,47 @@
7965
8011
 
7966
8012
  </xsl:when>
7967
8013
  <xsl:otherwise>
7968
- <fo:block xsl:use-attribute-sets="image-style">
7969
- <fo:instream-foreign-object fox:alt-text="{$alt-text}">
7970
- <xsl:attribute name="width">100%</xsl:attribute>
7971
- <xsl:attribute name="content-height">100%</xsl:attribute>
7972
- <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7973
- <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
7974
- <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
7975
- <!-- effective height 297 - 27.4 - 13 = 256.6 -->
7976
- <!-- effective width 210 - 12.5 - 25 = 172.5 -->
7977
- <!-- effective height / width = 1.48, 1.4 - with title -->
7978
- <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
7979
- <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
7980
- <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
7981
- </xsl:if>
7982
- <xsl:attribute name="scaling">uniform</xsl:attribute>
7983
- <xsl:copy-of select="$svg_content"/>
7984
- </fo:instream-foreign-object>
7985
- </fo:block>
8014
+
8015
+ <xsl:variable name="element">
8016
+ <xsl:choose>
8017
+ <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
8018
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
8019
+ </xsl:when>
8020
+ <xsl:otherwise>
8021
+ <fo:block xsl:use-attribute-sets="image-style">
8022
+ <xsl:if test="ancestor::*[local-name() = 'dt']">
8023
+ <xsl:attribute name="text-align">left</xsl:attribute>
8024
+ </xsl:if>
8025
+ </fo:block>
8026
+ </xsl:otherwise>
8027
+ </xsl:choose>
8028
+ </xsl:variable>
8029
+
8030
+ <xsl:for-each select="xalan:nodeset($element)/*">
8031
+ <xsl:copy>
8032
+ <xsl:copy-of select="@*"/>
8033
+ <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
8034
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
8035
+ <xsl:if test="$isGenerateTableIF = 'false'">
8036
+ <xsl:attribute name="width">100%</xsl:attribute>
8037
+ </xsl:if>
8038
+ <xsl:attribute name="content-height">100%</xsl:attribute>
8039
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
8040
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
8041
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
8042
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
8043
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
8044
+ <!-- effective height / width = 1.48, 1.4 - with title -->
8045
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
8046
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
8047
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
8048
+ </xsl:if>
8049
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
8050
+ <xsl:copy-of select="$svg_content"/>
8051
+ </fo:instream-foreign-object>
8052
+ <!-- </fo:block> -->
8053
+ </xsl:copy>
8054
+ </xsl:for-each>
7986
8055
  </xsl:otherwise>
7987
8056
  </xsl:choose>
7988
8057
  </xsl:template>
@@ -8074,6 +8143,13 @@
8074
8143
  </xsl:for-each>
8075
8144
  </xsl:template>
8076
8145
 
8146
+ <!-- For the structures like: <dt><image src="" mimetype="image/svg+xml" height="" width=""><svg xmlns="http://www.w3.org/2000/svg" ... -->
8147
+ <xsl:template match="*[local-name() != 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
8148
+ <xsl:for-each select="*[local-name() = 'svg']">
8149
+ <xsl:call-template name="image_svg"/>
8150
+ </xsl:for-each>
8151
+ </xsl:template>
8152
+
8077
8153
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
8078
8154
  <xsl:variable name="svg_content" select="document(@src)"/>
8079
8155
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -8212,6 +8288,8 @@
8212
8288
  <xsl:value-of select="."/>
8213
8289
  </xsl:template>
8214
8290
 
8291
+ <xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="bookmarks" priority="3"/>
8292
+
8215
8293
  <xsl:template match="node()" mode="contents">
8216
8294
  <xsl:apply-templates mode="contents"/>
8217
8295
  </xsl:template>
@@ -8519,7 +8597,15 @@
8519
8597
  <xsl:value-of select="@section"/>
8520
8598
  <xsl:text> </xsl:text>
8521
8599
  </xsl:if>
8522
- <xsl:value-of select="normalize-space(title)"/>
8600
+ <xsl:variable name="title">
8601
+ <xsl:for-each select="title/node()">
8602
+ <xsl:choose>
8603
+ <xsl:when test="local-name() = 'add' and starts-with(., $ace_tag)"><!-- skip --></xsl:when>
8604
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
8605
+ </xsl:choose>
8606
+ </xsl:for-each>
8607
+ </xsl:variable>
8608
+ <xsl:value-of select="normalize-space($title)"/>
8523
8609
  </fo:bookmark-title>
8524
8610
  <xsl:apply-templates mode="bookmark"/>
8525
8611
  </fo:bookmark>
@@ -8545,6 +8631,12 @@
8545
8631
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
8546
8632
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/>
8547
8633
 
8634
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] | *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
8635
+ <fo:block text-align="right" keep-with-next="always">
8636
+ <xsl:apply-templates/>
8637
+ </fo:block>
8638
+ </xsl:template>
8639
+
8548
8640
  <!-- ====== -->
8549
8641
  <!-- ====== -->
8550
8642
  <xsl:template match="*[local-name() = 'title']" mode="contents_item">
@@ -8694,6 +8786,10 @@
8694
8786
  </xsl:for-each>
8695
8787
  </xsl:template>
8696
8788
 
8789
+ <xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="contents_item" priority="2">
8790
+ <xsl:value-of select="."/>
8791
+ </xsl:template>
8792
+
8697
8793
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
8698
8794
  <xsl:template match="*[local-name() = 'span']" mode="contents_item">
8699
8795
  <xsl:apply-templates mode="contents_item"/>
@@ -10922,7 +11018,6 @@
10922
11018
  <xsl:if test="@type = 'editorial'">
10923
11019
  <xsl:attribute name="color">green</xsl:attribute>
10924
11020
  <xsl:attribute name="font-weight">normal</xsl:attribute>
10925
-
10926
11021
  <!-- <xsl:variable name="note-style">
10927
11022
  <style xsl:use-attribute-sets="note-style"></style>
10928
11023
  </xsl:variable>