metanorma-iho 0.9.4 → 0.9.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb6946f10c3caf2a5be78ad05de574a12f0631def9348c00a3bffc91227b59e2
4
- data.tar.gz: 7b43557687b137ab71d9e2694c620c3925b45b0e83bebd2f7e60573df3bdfaf6
3
+ metadata.gz: 9235ece5f7a31d06148e5dd18f7979336a37bef005ae9e420c333733339f249c
4
+ data.tar.gz: 99006e2e105a07036518c427e6f755338d20733e7bfc5b3834167141ed10c09e
5
5
  SHA512:
6
- metadata.gz: c6d684c1dc5de2a59f50f297f5865e25b3cfaaf7b4241396ef030d188aafa4ea3c5a1f5ad7e8cbf2a7f72f673091caea18d01101925ba7e1486be3d70c852b28
7
- data.tar.gz: 7340cdc0e5f4cd5edac28ca4864f7f6bd7acd07441ecc5723f710eea3a66cb10882a547903f77a195232bee26810e7907ec82b4f790e227b7414ac477f7458e7
6
+ metadata.gz: 02d66f4e533538a1cfa4b236b6c8d7f254d5c9d18fb74cd3402f9a8d8e36b004fae4b3009093dda8849481b3d8dded3deb6708ba2427721bfc366a65f98c1a58
7
+ data.tar.gz: 55eb88213a0d2dec8407fc7773171ff49bca20357aaff5973d80eac5a4db0c2ad5c33c4c49e6ec6b5ce38a96b761d3d04b537b5c64261947a9f5962dfebf3624
@@ -854,17 +854,30 @@
854
854
  <xsl:param name="add_math_as_text">true</xsl:param> <!-- add math in text behind svg formula, to copy-paste formula from PDF as text -->
855
855
 
856
856
  <xsl:param name="table_if">false</xsl:param> <!-- generate extended table in IF for autolayout-algorithm -->
857
- <xsl:param name="table_widths"/> <!-- path to xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
857
+ <xsl:param name="table_widths"/> <!-- (debug: path to) xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
858
858
  <!-- Example: <tables>
859
- <table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
860
- <tbody>
861
- <tr>
862
- <td id="tab-symdu_1_1">
863
- <p_len>6</p_len>
864
- <p_len>100</p_len> for 2nd paragraph
865
- <word_len>6</word_len>
866
- <word_len>20</word_len>
867
- ...
859
+ <table page-width="509103" id="table1" width_max="223561" width_min="223560">
860
+ <column width_max="39354" width_min="39354"/>
861
+ <column width_max="75394" width_min="75394"/>
862
+ <column width_max="108813" width_min="108813"/>
863
+ <tbody>
864
+ <tr>
865
+ <td width_max="39354" width_min="39354">
866
+ <p_len>39354</p_len>
867
+ <word_len>39354</word_len>
868
+ </td>
869
+
870
+ OLD:
871
+ <tables>
872
+ <table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
873
+ <tbody>
874
+ <tr>
875
+ <td id="tab-symdu_1_1">
876
+ <p_len>6</p_len>
877
+ <p_len>100</p_len> for 2nd paragraph
878
+ <word_len>6</word_len>
879
+ <word_len>20</word_len>
880
+ ...
868
881
  -->
869
882
 
870
883
  <!-- for command line debug: <xsl:variable name="table_widths_from_if" select="document($table_widths)"/> -->
@@ -1083,6 +1096,10 @@
1083
1096
  <xsl:variable name="zero_width_space">​</xsl:variable>
1084
1097
  <xsl:variable name="hair_space"> </xsl:variable>
1085
1098
  <xsl:variable name="en_dash">–</xsl:variable>
1099
+ <xsl:variable name="em_dash">—</xsl:variable>
1100
+ <xsl:variable name="cr">&#13;</xsl:variable>
1101
+ <xsl:variable name="lf">
1102
+ </xsl:variable>
1086
1103
 
1087
1104
  <xsl:template name="getTitle">
1088
1105
  <xsl:param name="name"/>
@@ -1404,6 +1421,10 @@
1404
1421
 
1405
1422
  </xsl:attribute-set> <!-- example-name-style -->
1406
1423
 
1424
+ <xsl:template name="refine_example-name-style">
1425
+
1426
+ </xsl:template>
1427
+
1407
1428
  <xsl:attribute-set name="example-p-style">
1408
1429
 
1409
1430
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -1421,6 +1442,10 @@
1421
1442
 
1422
1443
  </xsl:attribute-set> <!-- termexample-name-style -->
1423
1444
 
1445
+ <xsl:template name="refine_termexample-name-style">
1446
+
1447
+ </xsl:template>
1448
+
1424
1449
  <!-- ========================== -->
1425
1450
  <!-- Table styles -->
1426
1451
  <!-- ========================== -->
@@ -1604,6 +1629,10 @@
1604
1629
 
1605
1630
  </xsl:attribute-set> <!-- table-fn-style -->
1606
1631
 
1632
+ <xsl:template name="refine_table-fn-style">
1633
+
1634
+ </xsl:template>
1635
+
1607
1636
  <xsl:attribute-set name="table-fn-number-style">
1608
1637
  <xsl:attribute name="font-size">80%</xsl:attribute>
1609
1638
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
@@ -1612,6 +1641,10 @@
1612
1641
 
1613
1642
  </xsl:attribute-set> <!-- table-fn-number-style -->
1614
1643
 
1644
+ <xsl:template name="refine_table-fn-number-style">
1645
+
1646
+ </xsl:template>
1647
+
1615
1648
  <xsl:attribute-set name="fn-container-body-style">
1616
1649
  <xsl:attribute name="text-indent">0</xsl:attribute>
1617
1650
  <xsl:attribute name="start-indent">0</xsl:attribute>
@@ -2734,6 +2767,20 @@
2734
2767
  </xsl:for-each>
2735
2768
  </xsl:template>
2736
2769
 
2770
+ <xsl:param name="table_only_with_id"/><!-- Example: table1, for table auto-layout algorithm -->
2771
+
2772
+ <xsl:template match="*[local-name()='table']" priority="2">
2773
+ <xsl:choose>
2774
+ <xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
2775
+ <xsl:call-template name="table"/>
2776
+ </xsl:when>
2777
+ <xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
2778
+ <xsl:otherwise>
2779
+ <xsl:call-template name="table"/>
2780
+ </xsl:otherwise>
2781
+ </xsl:choose>
2782
+ </xsl:template>
2783
+
2737
2784
  <xsl:template match="*[local-name()='table']" name="table">
2738
2785
 
2739
2786
  <xsl:variable name="table-preamble">
@@ -2743,9 +2790,11 @@
2743
2790
  <xsl:variable name="table">
2744
2791
 
2745
2792
  <xsl:variable name="simple-table">
2746
- <xsl:call-template name="getSimpleTable">
2747
- <xsl:with-param name="id" select="@id"/>
2748
- </xsl:call-template>
2793
+ <xsl:if test="$isGenerateTableIF = 'true' and $isApplyAutolayoutAlgorithm = 'true'">
2794
+ <xsl:call-template name="getSimpleTable">
2795
+ <xsl:with-param name="id" select="@id"/>
2796
+ </xsl:call-template>
2797
+ </xsl:if>
2749
2798
  </xsl:variable>
2750
2799
  <!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
2751
2800
 
@@ -2841,9 +2890,9 @@
2841
2890
  </xsl:attribute>
2842
2891
  </xsl:for-each>
2843
2892
 
2844
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2893
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'][not(@type = 'units')] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2845
2894
  <xsl:if test="$isNoteOrFnExist = 'true'">
2846
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2895
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
2847
2896
  </xsl:if>
2848
2897
 
2849
2898
  <xsl:choose>
@@ -2928,6 +2977,7 @@
2928
2977
  <!-- centered table when table name is centered (see table-name-style) -->
2929
2978
 
2930
2979
  <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
2980
+
2931
2981
  <fo:table-column column-width="proportional-column-width(1)"/>
2932
2982
  <fo:table-column column-width="{@width}"/>
2933
2983
  <fo:table-column column-width="proportional-column-width(1)"/>
@@ -2995,9 +3045,28 @@
2995
3045
 
2996
3046
  </fo:block>
2997
3047
 
3048
+ <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
3049
+ <xsl:if test="$continued = 'true'">
3050
+ <fo:block text-align="right">
3051
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
3052
+ </fo:block>
3053
+ </xsl:if>
3054
+ <!-- </xsl:if> -->
3055
+
2998
3056
  </xsl:if>
2999
3057
  </xsl:template> <!-- table/name -->
3000
3058
 
3059
+ <!-- workaround solution for https://github.com/metanorma/metanorma-iso/issues/1151#issuecomment-2033087938 -->
3060
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'note'][@type = 'units']/*[local-name() = 'p']/text()" priority="4">
3061
+ <xsl:choose>
3062
+ <xsl:when test="preceding-sibling::*[local-name() = 'br']">
3063
+ <!-- remove CR or LF at start -->
3064
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'^(&#13;&#10;|&#13;|&#10;)', '')"/>
3065
+ </xsl:when>
3066
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
3067
+ </xsl:choose>
3068
+ </xsl:template>
3069
+
3001
3070
  <!-- SOURCE: ... -->
3002
3071
  <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
3003
3072
  <xsl:call-template name="termsource"/>
@@ -3408,7 +3477,7 @@
3408
3477
  <xsl:param name="colwidths"/>
3409
3478
  <xsl:param name="colgroup"/>
3410
3479
 
3411
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
3480
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
3412
3481
 
3413
3482
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3414
3483
 
@@ -3480,7 +3549,7 @@
3480
3549
 
3481
3550
  <xsl:apply-templates select="../*[local-name()='p']"/>
3482
3551
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3483
- <xsl:apply-templates select="../*[local-name()='note']"/>
3552
+ <xsl:apply-templates select="../*[local-name()='note'][not(@type = 'units')]"/>
3484
3553
  <xsl:apply-templates select="../*[local-name()='example']"/>
3485
3554
  <xsl:apply-templates select="../*[local-name()='source']"/>
3486
3555
 
@@ -3490,7 +3559,7 @@
3490
3559
 
3491
3560
  <!-- horizontal row separator -->
3492
3561
  <xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
3493
- <xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
3562
+ <xsl:if test="(../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
3494
3563
  <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
3495
3564
 
3496
3565
  <xsl:call-template name="setBordersTableArray"/>
@@ -3969,8 +4038,9 @@
3969
4038
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
3970
4039
 
3971
4040
  <fo:block xsl:use-attribute-sets="table-fn-style">
3972
-
4041
+ <xsl:call-template name="refine_table-fn-style"/>
3973
4042
  <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
4043
+ <xsl:call-template name="refine_table-fn-number-style"/>
3974
4044
 
3975
4045
  <xsl:value-of select="@reference"/>
3976
4046
 
@@ -4154,7 +4224,20 @@
4154
4224
  <!-- Definition List -->
4155
4225
  <!-- ===================== -->
4156
4226
 
4157
- <xsl:template match="*[local-name()='dl']">
4227
+ <!-- for table auto-layout algorithm -->
4228
+ <xsl:template match="*[local-name()='dl']" priority="2">
4229
+ <xsl:choose>
4230
+ <xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
4231
+ <xsl:call-template name="dl"/>
4232
+ </xsl:when>
4233
+ <xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
4234
+ <xsl:otherwise>
4235
+ <xsl:call-template name="dl"/>
4236
+ </xsl:otherwise>
4237
+ </xsl:choose>
4238
+ </xsl:template>
4239
+
4240
+ <xsl:template match="*[local-name()='dl']" name="dl">
4158
4241
  <xsl:variable name="isAdded" select="@added"/>
4159
4242
  <xsl:variable name="isDeleted" select="@deleted"/>
4160
4243
  <!-- <dl><xsl:copy-of select="."/></dl> -->
@@ -5115,11 +5198,16 @@
5115
5198
  <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
5116
5199
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
5117
5200
  <xsl:variable name="text" select="."/>
5118
- <fo:inline font-size="75%" role="SKIP">
5201
+ <xsl:variable name="ratio_">
5202
+ 0.75
5203
+ </xsl:variable>
5204
+ <xsl:variable name="ratio" select="number(normalize-space($ratio_))"/>
5205
+ <fo:inline font-size="{$ratio * 100}%" role="SKIP">
5119
5206
  <xsl:if test="string-length($text) &gt; 0">
5120
5207
  <xsl:variable name="smallCapsText">
5121
5208
  <xsl:call-template name="recursiveSmallCaps">
5122
5209
  <xsl:with-param name="text" select="$text"/>
5210
+ <xsl:with-param name="ratio" select="$ratio"/>
5123
5211
  </xsl:call-template>
5124
5212
  </xsl:variable>
5125
5213
  <!-- merge neighboring fo:inline -->
@@ -5156,12 +5244,13 @@
5156
5244
 
5157
5245
  <xsl:template name="recursiveSmallCaps">
5158
5246
  <xsl:param name="text"/>
5247
+ <xsl:param name="ratio"/>
5159
5248
  <xsl:variable name="char" select="substring($text,1,1)"/>
5160
5249
  <!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
5161
5250
  <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
5162
5251
  <xsl:choose>
5163
5252
  <xsl:when test="$char=$upperCase">
5164
- <fo:inline font-size="{100 div 0.75}%" role="SKIP">
5253
+ <fo:inline font-size="{100 div $ratio}%" role="SKIP">
5165
5254
  <xsl:value-of select="$upperCase"/>
5166
5255
  </fo:inline>
5167
5256
  </xsl:when>
@@ -5172,6 +5261,7 @@
5172
5261
  <xsl:if test="string-length($text) &gt; 1">
5173
5262
  <xsl:call-template name="recursiveSmallCaps">
5174
5263
  <xsl:with-param name="text" select="substring($text,2)"/>
5264
+ <xsl:with-param name="ratio" select="$ratio"/>
5175
5265
  </xsl:call-template>
5176
5266
  </xsl:if>
5177
5267
  </xsl:template>
@@ -5279,6 +5369,9 @@
5279
5369
  <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
5280
5370
  <style name="{$key}"><xsl:value-of select="$value"/></style>
5281
5371
  </xsl:if>
5372
+ <xsl:if test="$key = 'text-indent'">
5373
+ <style name="padding-left"><xsl:value-of select="$value"/></style>
5374
+ </xsl:if>
5282
5375
  </xsl:for-each>
5283
5376
  </xsl:variable>
5284
5377
  <xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
@@ -6151,7 +6244,13 @@
6151
6244
  <xsl:value-of select="$language_current_2"/>
6152
6245
  </xsl:when>
6153
6246
  <xsl:otherwise>
6154
- <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
6247
+ <xsl:variable name="language_current_3" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'])"/>
6248
+ <xsl:choose>
6249
+ <xsl:when test="$language_current_3 != ''">
6250
+ <xsl:value-of select="$language_current_3"/>
6251
+ </xsl:when>
6252
+ <xsl:otherwise>en</xsl:otherwise>
6253
+ </xsl:choose>
6155
6254
  </xsl:otherwise>
6156
6255
  </xsl:choose>
6157
6256
  </xsl:otherwise>
@@ -6681,6 +6780,11 @@
6681
6780
  </xsl:call-template>
6682
6781
  </xsl:template>
6683
6782
 
6783
+ <!-- command between two xref points to non-standard bibitem -->
6784
+ <xsl:template match="text()[. = ','][preceding-sibling::node()[1][local-name() = 'sup'][*[local-name() = 'xref'][@type = 'footnote']] and following-sibling::node()[1][local-name() = 'sup'][*[local-name() = 'xref'][@type = 'footnote']]]">
6785
+ <xsl:value-of select="."/>
6786
+ </xsl:template>
6787
+
6684
6788
  <!-- ====== -->
6685
6789
  <!-- formula -->
6686
6790
  <!-- ====== -->
@@ -7049,7 +7153,7 @@
7049
7153
  </xsl:when>
7050
7154
  <xsl:otherwise>
7051
7155
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7052
- <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7156
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and (../*[local-name() = 'name'] or parent::*[local-name() = 'figure'][@unnumbered = 'true']) and not(ancestor::*[local-name() = 'table'])">
7053
7157
 
7054
7158
  <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
7055
7159
  <xsl:attribute name="width">
@@ -7384,6 +7488,8 @@
7384
7488
  </xsl:attribute>
7385
7489
  </xsl:template>
7386
7490
 
7491
+ <xsl:variable name="regex_starts_with_digit">^[0-9].*</xsl:variable>
7492
+
7387
7493
  <xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
7388
7494
  <xsl:copy>
7389
7495
  <xsl:apply-templates select="@*" mode="svg_update"/>
@@ -7402,7 +7508,8 @@
7402
7508
 
7403
7509
  <xsl:attribute name="width">
7404
7510
  <xsl:choose>
7405
- <xsl:when test="$parent_image_width != '' and $parent_image_width != 'auto'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7511
+ <!-- width is non 'auto', 'text-width', 'full-page-width' or 'narrow' -->
7512
+ <xsl:when test="$parent_image_width != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_width), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7406
7513
  <xsl:when test="$width != ''">
7407
7514
  <xsl:value-of select="round($width)"/>
7408
7515
  </xsl:when>
@@ -7411,7 +7518,8 @@
7411
7518
  </xsl:attribute>
7412
7519
  <xsl:attribute name="height">
7413
7520
  <xsl:choose>
7414
- <xsl:when test="$parent_image_height != '' and $parent_image_height != 'auto'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7521
+ <!-- height non 'auto', 'text-width', 'full-page-width' or 'narrow' -->
7522
+ <xsl:when test="$parent_image_height != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_height), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7415
7523
  <xsl:when test="$height != ''">
7416
7524
  <xsl:value-of select="round($height)"/>
7417
7525
  </xsl:when>
@@ -7428,7 +7536,7 @@
7428
7536
  <xsl:variable name="parent_image_width" select="normalize-space(ancestor::*[2][local-name() = 'image']/@width)"/>
7429
7537
  <xsl:attribute name="width">
7430
7538
  <xsl:choose>
7431
- <xsl:when test="$parent_image_width != '' and $parent_image_width != 'auto'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7539
+ <xsl:when test="$parent_image_width != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_width), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7432
7540
  <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7433
7541
  </xsl:choose>
7434
7542
  </xsl:attribute>
@@ -7439,7 +7547,7 @@
7439
7547
  <xsl:variable name="parent_image_height" select="normalize-space(ancestor::*[2][local-name() = 'image']/@height)"/>
7440
7548
  <xsl:attribute name="height">
7441
7549
  <xsl:choose>
7442
- <xsl:when test="$parent_image_height != '' and $parent_image_height != 'auto'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7550
+ <xsl:when test="$parent_image_height != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_height), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7443
7551
  <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7444
7552
  </xsl:choose>
7445
7553
  </xsl:attribute>
@@ -8901,6 +9009,7 @@
8901
9009
  <xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']">
8902
9010
  <xsl:if test="normalize-space() != ''">
8903
9011
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
9012
+ <xsl:call-template name="refine_termexample-name-style"/>
8904
9013
  <xsl:apply-templates/>
8905
9014
  </fo:inline>
8906
9015
  </xsl:if>
@@ -9051,6 +9160,7 @@
9051
9160
  </xsl:when>
9052
9161
  <xsl:otherwise>
9053
9162
  <fo:inline xsl:use-attribute-sets="example-name-style">
9163
+ <xsl:call-template name="refine_example-name-style"/>
9054
9164
  <xsl:apply-templates/>:
9055
9165
  </fo:inline>
9056
9166
  </xsl:otherwise>
@@ -10302,6 +10412,7 @@
10302
10412
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
10303
10413
  <xsl:otherwise>
10304
10414
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
10415
+
10305
10416
  <fo:list-item-label end-indent="label-end()">
10306
10417
  <fo:block role="SKIP">
10307
10418
  <fo:inline role="SKIP">
@@ -854,17 +854,30 @@
854
854
  <xsl:param name="add_math_as_text">true</xsl:param> <!-- add math in text behind svg formula, to copy-paste formula from PDF as text -->
855
855
 
856
856
  <xsl:param name="table_if">false</xsl:param> <!-- generate extended table in IF for autolayout-algorithm -->
857
- <xsl:param name="table_widths"/> <!-- path to xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
857
+ <xsl:param name="table_widths"/> <!-- (debug: path to) xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
858
858
  <!-- Example: <tables>
859
- <table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
860
- <tbody>
861
- <tr>
862
- <td id="tab-symdu_1_1">
863
- <p_len>6</p_len>
864
- <p_len>100</p_len> for 2nd paragraph
865
- <word_len>6</word_len>
866
- <word_len>20</word_len>
867
- ...
859
+ <table page-width="509103" id="table1" width_max="223561" width_min="223560">
860
+ <column width_max="39354" width_min="39354"/>
861
+ <column width_max="75394" width_min="75394"/>
862
+ <column width_max="108813" width_min="108813"/>
863
+ <tbody>
864
+ <tr>
865
+ <td width_max="39354" width_min="39354">
866
+ <p_len>39354</p_len>
867
+ <word_len>39354</word_len>
868
+ </td>
869
+
870
+ OLD:
871
+ <tables>
872
+ <table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
873
+ <tbody>
874
+ <tr>
875
+ <td id="tab-symdu_1_1">
876
+ <p_len>6</p_len>
877
+ <p_len>100</p_len> for 2nd paragraph
878
+ <word_len>6</word_len>
879
+ <word_len>20</word_len>
880
+ ...
868
881
  -->
869
882
 
870
883
  <!-- for command line debug: <xsl:variable name="table_widths_from_if" select="document($table_widths)"/> -->
@@ -1083,6 +1096,10 @@
1083
1096
  <xsl:variable name="zero_width_space">​</xsl:variable>
1084
1097
  <xsl:variable name="hair_space"> </xsl:variable>
1085
1098
  <xsl:variable name="en_dash">–</xsl:variable>
1099
+ <xsl:variable name="em_dash">—</xsl:variable>
1100
+ <xsl:variable name="cr">&#13;</xsl:variable>
1101
+ <xsl:variable name="lf">
1102
+ </xsl:variable>
1086
1103
 
1087
1104
  <xsl:template name="getTitle">
1088
1105
  <xsl:param name="name"/>
@@ -1404,6 +1421,10 @@
1404
1421
 
1405
1422
  </xsl:attribute-set> <!-- example-name-style -->
1406
1423
 
1424
+ <xsl:template name="refine_example-name-style">
1425
+
1426
+ </xsl:template>
1427
+
1407
1428
  <xsl:attribute-set name="example-p-style">
1408
1429
 
1409
1430
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -1421,6 +1442,10 @@
1421
1442
 
1422
1443
  </xsl:attribute-set> <!-- termexample-name-style -->
1423
1444
 
1445
+ <xsl:template name="refine_termexample-name-style">
1446
+
1447
+ </xsl:template>
1448
+
1424
1449
  <!-- ========================== -->
1425
1450
  <!-- Table styles -->
1426
1451
  <!-- ========================== -->
@@ -1604,6 +1629,10 @@
1604
1629
 
1605
1630
  </xsl:attribute-set> <!-- table-fn-style -->
1606
1631
 
1632
+ <xsl:template name="refine_table-fn-style">
1633
+
1634
+ </xsl:template>
1635
+
1607
1636
  <xsl:attribute-set name="table-fn-number-style">
1608
1637
  <xsl:attribute name="font-size">80%</xsl:attribute>
1609
1638
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
@@ -1612,6 +1641,10 @@
1612
1641
 
1613
1642
  </xsl:attribute-set> <!-- table-fn-number-style -->
1614
1643
 
1644
+ <xsl:template name="refine_table-fn-number-style">
1645
+
1646
+ </xsl:template>
1647
+
1615
1648
  <xsl:attribute-set name="fn-container-body-style">
1616
1649
  <xsl:attribute name="text-indent">0</xsl:attribute>
1617
1650
  <xsl:attribute name="start-indent">0</xsl:attribute>
@@ -2734,6 +2767,20 @@
2734
2767
  </xsl:for-each>
2735
2768
  </xsl:template>
2736
2769
 
2770
+ <xsl:param name="table_only_with_id"/><!-- Example: table1, for table auto-layout algorithm -->
2771
+
2772
+ <xsl:template match="*[local-name()='table']" priority="2">
2773
+ <xsl:choose>
2774
+ <xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
2775
+ <xsl:call-template name="table"/>
2776
+ </xsl:when>
2777
+ <xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
2778
+ <xsl:otherwise>
2779
+ <xsl:call-template name="table"/>
2780
+ </xsl:otherwise>
2781
+ </xsl:choose>
2782
+ </xsl:template>
2783
+
2737
2784
  <xsl:template match="*[local-name()='table']" name="table">
2738
2785
 
2739
2786
  <xsl:variable name="table-preamble">
@@ -2743,9 +2790,11 @@
2743
2790
  <xsl:variable name="table">
2744
2791
 
2745
2792
  <xsl:variable name="simple-table">
2746
- <xsl:call-template name="getSimpleTable">
2747
- <xsl:with-param name="id" select="@id"/>
2748
- </xsl:call-template>
2793
+ <xsl:if test="$isGenerateTableIF = 'true' and $isApplyAutolayoutAlgorithm = 'true'">
2794
+ <xsl:call-template name="getSimpleTable">
2795
+ <xsl:with-param name="id" select="@id"/>
2796
+ </xsl:call-template>
2797
+ </xsl:if>
2749
2798
  </xsl:variable>
2750
2799
  <!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
2751
2800
 
@@ -2841,9 +2890,9 @@
2841
2890
  </xsl:attribute>
2842
2891
  </xsl:for-each>
2843
2892
 
2844
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2893
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'][not(@type = 'units')] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2845
2894
  <xsl:if test="$isNoteOrFnExist = 'true'">
2846
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2895
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
2847
2896
  </xsl:if>
2848
2897
 
2849
2898
  <xsl:choose>
@@ -2928,6 +2977,7 @@
2928
2977
  <!-- centered table when table name is centered (see table-name-style) -->
2929
2978
 
2930
2979
  <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
2980
+
2931
2981
  <fo:table-column column-width="proportional-column-width(1)"/>
2932
2982
  <fo:table-column column-width="{@width}"/>
2933
2983
  <fo:table-column column-width="proportional-column-width(1)"/>
@@ -2995,9 +3045,28 @@
2995
3045
 
2996
3046
  </fo:block>
2997
3047
 
3048
+ <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
3049
+ <xsl:if test="$continued = 'true'">
3050
+ <fo:block text-align="right">
3051
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
3052
+ </fo:block>
3053
+ </xsl:if>
3054
+ <!-- </xsl:if> -->
3055
+
2998
3056
  </xsl:if>
2999
3057
  </xsl:template> <!-- table/name -->
3000
3058
 
3059
+ <!-- workaround solution for https://github.com/metanorma/metanorma-iso/issues/1151#issuecomment-2033087938 -->
3060
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'note'][@type = 'units']/*[local-name() = 'p']/text()" priority="4">
3061
+ <xsl:choose>
3062
+ <xsl:when test="preceding-sibling::*[local-name() = 'br']">
3063
+ <!-- remove CR or LF at start -->
3064
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'^(&#13;&#10;|&#13;|&#10;)', '')"/>
3065
+ </xsl:when>
3066
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
3067
+ </xsl:choose>
3068
+ </xsl:template>
3069
+
3001
3070
  <!-- SOURCE: ... -->
3002
3071
  <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
3003
3072
  <xsl:call-template name="termsource"/>
@@ -3408,7 +3477,7 @@
3408
3477
  <xsl:param name="colwidths"/>
3409
3478
  <xsl:param name="colgroup"/>
3410
3479
 
3411
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
3480
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
3412
3481
 
3413
3482
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3414
3483
 
@@ -3480,7 +3549,7 @@
3480
3549
 
3481
3550
  <xsl:apply-templates select="../*[local-name()='p']"/>
3482
3551
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3483
- <xsl:apply-templates select="../*[local-name()='note']"/>
3552
+ <xsl:apply-templates select="../*[local-name()='note'][not(@type = 'units')]"/>
3484
3553
  <xsl:apply-templates select="../*[local-name()='example']"/>
3485
3554
  <xsl:apply-templates select="../*[local-name()='source']"/>
3486
3555
 
@@ -3490,7 +3559,7 @@
3490
3559
 
3491
3560
  <!-- horizontal row separator -->
3492
3561
  <xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
3493
- <xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
3562
+ <xsl:if test="(../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
3494
3563
  <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
3495
3564
 
3496
3565
  <xsl:call-template name="setBordersTableArray"/>
@@ -3969,8 +4038,9 @@
3969
4038
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
3970
4039
 
3971
4040
  <fo:block xsl:use-attribute-sets="table-fn-style">
3972
-
4041
+ <xsl:call-template name="refine_table-fn-style"/>
3973
4042
  <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
4043
+ <xsl:call-template name="refine_table-fn-number-style"/>
3974
4044
 
3975
4045
  <xsl:value-of select="@reference"/>
3976
4046
 
@@ -4154,7 +4224,20 @@
4154
4224
  <!-- Definition List -->
4155
4225
  <!-- ===================== -->
4156
4226
 
4157
- <xsl:template match="*[local-name()='dl']">
4227
+ <!-- for table auto-layout algorithm -->
4228
+ <xsl:template match="*[local-name()='dl']" priority="2">
4229
+ <xsl:choose>
4230
+ <xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
4231
+ <xsl:call-template name="dl"/>
4232
+ </xsl:when>
4233
+ <xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
4234
+ <xsl:otherwise>
4235
+ <xsl:call-template name="dl"/>
4236
+ </xsl:otherwise>
4237
+ </xsl:choose>
4238
+ </xsl:template>
4239
+
4240
+ <xsl:template match="*[local-name()='dl']" name="dl">
4158
4241
  <xsl:variable name="isAdded" select="@added"/>
4159
4242
  <xsl:variable name="isDeleted" select="@deleted"/>
4160
4243
  <!-- <dl><xsl:copy-of select="."/></dl> -->
@@ -5115,11 +5198,16 @@
5115
5198
  <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
5116
5199
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
5117
5200
  <xsl:variable name="text" select="."/>
5118
- <fo:inline font-size="75%" role="SKIP">
5201
+ <xsl:variable name="ratio_">
5202
+ 0.75
5203
+ </xsl:variable>
5204
+ <xsl:variable name="ratio" select="number(normalize-space($ratio_))"/>
5205
+ <fo:inline font-size="{$ratio * 100}%" role="SKIP">
5119
5206
  <xsl:if test="string-length($text) &gt; 0">
5120
5207
  <xsl:variable name="smallCapsText">
5121
5208
  <xsl:call-template name="recursiveSmallCaps">
5122
5209
  <xsl:with-param name="text" select="$text"/>
5210
+ <xsl:with-param name="ratio" select="$ratio"/>
5123
5211
  </xsl:call-template>
5124
5212
  </xsl:variable>
5125
5213
  <!-- merge neighboring fo:inline -->
@@ -5156,12 +5244,13 @@
5156
5244
 
5157
5245
  <xsl:template name="recursiveSmallCaps">
5158
5246
  <xsl:param name="text"/>
5247
+ <xsl:param name="ratio"/>
5159
5248
  <xsl:variable name="char" select="substring($text,1,1)"/>
5160
5249
  <!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
5161
5250
  <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
5162
5251
  <xsl:choose>
5163
5252
  <xsl:when test="$char=$upperCase">
5164
- <fo:inline font-size="{100 div 0.75}%" role="SKIP">
5253
+ <fo:inline font-size="{100 div $ratio}%" role="SKIP">
5165
5254
  <xsl:value-of select="$upperCase"/>
5166
5255
  </fo:inline>
5167
5256
  </xsl:when>
@@ -5172,6 +5261,7 @@
5172
5261
  <xsl:if test="string-length($text) &gt; 1">
5173
5262
  <xsl:call-template name="recursiveSmallCaps">
5174
5263
  <xsl:with-param name="text" select="substring($text,2)"/>
5264
+ <xsl:with-param name="ratio" select="$ratio"/>
5175
5265
  </xsl:call-template>
5176
5266
  </xsl:if>
5177
5267
  </xsl:template>
@@ -5279,6 +5369,9 @@
5279
5369
  <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
5280
5370
  <style name="{$key}"><xsl:value-of select="$value"/></style>
5281
5371
  </xsl:if>
5372
+ <xsl:if test="$key = 'text-indent'">
5373
+ <style name="padding-left"><xsl:value-of select="$value"/></style>
5374
+ </xsl:if>
5282
5375
  </xsl:for-each>
5283
5376
  </xsl:variable>
5284
5377
  <xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
@@ -6151,7 +6244,13 @@
6151
6244
  <xsl:value-of select="$language_current_2"/>
6152
6245
  </xsl:when>
6153
6246
  <xsl:otherwise>
6154
- <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
6247
+ <xsl:variable name="language_current_3" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'])"/>
6248
+ <xsl:choose>
6249
+ <xsl:when test="$language_current_3 != ''">
6250
+ <xsl:value-of select="$language_current_3"/>
6251
+ </xsl:when>
6252
+ <xsl:otherwise>en</xsl:otherwise>
6253
+ </xsl:choose>
6155
6254
  </xsl:otherwise>
6156
6255
  </xsl:choose>
6157
6256
  </xsl:otherwise>
@@ -6681,6 +6780,11 @@
6681
6780
  </xsl:call-template>
6682
6781
  </xsl:template>
6683
6782
 
6783
+ <!-- command between two xref points to non-standard bibitem -->
6784
+ <xsl:template match="text()[. = ','][preceding-sibling::node()[1][local-name() = 'sup'][*[local-name() = 'xref'][@type = 'footnote']] and following-sibling::node()[1][local-name() = 'sup'][*[local-name() = 'xref'][@type = 'footnote']]]">
6785
+ <xsl:value-of select="."/>
6786
+ </xsl:template>
6787
+
6684
6788
  <!-- ====== -->
6685
6789
  <!-- formula -->
6686
6790
  <!-- ====== -->
@@ -7049,7 +7153,7 @@
7049
7153
  </xsl:when>
7050
7154
  <xsl:otherwise>
7051
7155
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7052
- <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7156
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and (../*[local-name() = 'name'] or parent::*[local-name() = 'figure'][@unnumbered = 'true']) and not(ancestor::*[local-name() = 'table'])">
7053
7157
 
7054
7158
  <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
7055
7159
  <xsl:attribute name="width">
@@ -7384,6 +7488,8 @@
7384
7488
  </xsl:attribute>
7385
7489
  </xsl:template>
7386
7490
 
7491
+ <xsl:variable name="regex_starts_with_digit">^[0-9].*</xsl:variable>
7492
+
7387
7493
  <xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
7388
7494
  <xsl:copy>
7389
7495
  <xsl:apply-templates select="@*" mode="svg_update"/>
@@ -7402,7 +7508,8 @@
7402
7508
 
7403
7509
  <xsl:attribute name="width">
7404
7510
  <xsl:choose>
7405
- <xsl:when test="$parent_image_width != '' and $parent_image_width != 'auto'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7511
+ <!-- width is non 'auto', 'text-width', 'full-page-width' or 'narrow' -->
7512
+ <xsl:when test="$parent_image_width != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_width), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7406
7513
  <xsl:when test="$width != ''">
7407
7514
  <xsl:value-of select="round($width)"/>
7408
7515
  </xsl:when>
@@ -7411,7 +7518,8 @@
7411
7518
  </xsl:attribute>
7412
7519
  <xsl:attribute name="height">
7413
7520
  <xsl:choose>
7414
- <xsl:when test="$parent_image_height != '' and $parent_image_height != 'auto'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7521
+ <!-- height non 'auto', 'text-width', 'full-page-width' or 'narrow' -->
7522
+ <xsl:when test="$parent_image_height != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_height), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7415
7523
  <xsl:when test="$height != ''">
7416
7524
  <xsl:value-of select="round($height)"/>
7417
7525
  </xsl:when>
@@ -7428,7 +7536,7 @@
7428
7536
  <xsl:variable name="parent_image_width" select="normalize-space(ancestor::*[2][local-name() = 'image']/@width)"/>
7429
7537
  <xsl:attribute name="width">
7430
7538
  <xsl:choose>
7431
- <xsl:when test="$parent_image_width != '' and $parent_image_width != 'auto'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7539
+ <xsl:when test="$parent_image_width != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_width), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7432
7540
  <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7433
7541
  </xsl:choose>
7434
7542
  </xsl:attribute>
@@ -7439,7 +7547,7 @@
7439
7547
  <xsl:variable name="parent_image_height" select="normalize-space(ancestor::*[2][local-name() = 'image']/@height)"/>
7440
7548
  <xsl:attribute name="height">
7441
7549
  <xsl:choose>
7442
- <xsl:when test="$parent_image_height != '' and $parent_image_height != 'auto'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7550
+ <xsl:when test="$parent_image_height != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_height), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7443
7551
  <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7444
7552
  </xsl:choose>
7445
7553
  </xsl:attribute>
@@ -8901,6 +9009,7 @@
8901
9009
  <xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']">
8902
9010
  <xsl:if test="normalize-space() != ''">
8903
9011
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
9012
+ <xsl:call-template name="refine_termexample-name-style"/>
8904
9013
  <xsl:apply-templates/>
8905
9014
  </fo:inline>
8906
9015
  </xsl:if>
@@ -9051,6 +9160,7 @@
9051
9160
  </xsl:when>
9052
9161
  <xsl:otherwise>
9053
9162
  <fo:inline xsl:use-attribute-sets="example-name-style">
9163
+ <xsl:call-template name="refine_example-name-style"/>
9054
9164
  <xsl:apply-templates/>:
9055
9165
  </fo:inline>
9056
9166
  </xsl:otherwise>
@@ -10302,6 +10412,7 @@
10302
10412
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
10303
10413
  <xsl:otherwise>
10304
10414
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
10415
+
10305
10416
  <fo:list-item-label end-indent="label-end()">
10306
10417
  <fo:block role="SKIP">
10307
10418
  <fo:inline role="SKIP">
@@ -20,20 +20,6 @@ module IsoDoc
20
20
  section_break(body)
21
21
  end
22
22
 
23
- # def make_body2(body, docxml)
24
- # body.div **{ class: "WordSection2" } do |div2|
25
- # boilerplate docxml, div2
26
- # preface_block docxml, div2
27
- # abstract docxml, div2
28
- # foreword docxml, div2
29
- # introduction docxml, div2
30
- # preface docxml, div2
31
- # acknowledgements docxml, div2
32
- # div2.p { |p| p << "&nbsp;" } # placeholder
33
- # end
34
- # section_break(body)
35
- # end
36
-
37
23
  def authority_cleanup(docxml)
38
24
  super
39
25
  docxml.xpath("//div[@class = 'boilerplate-feedback']/p").each do |p|
@@ -208,7 +208,9 @@
208
208
  </define>
209
209
  <define name="roledescription">
210
210
  <element name="description">
211
- <ref name="FormattedString"/>
211
+ <oneOrMore>
212
+ <ref name="TextElement"/>
213
+ </oneOrMore>
212
214
  </element>
213
215
  </define>
214
216
  <define name="person">
@@ -333,7 +335,9 @@
333
335
  </define>
334
336
  <define name="affiliationdescription">
335
337
  <element name="description">
336
- <ref name="FormattedString"/>
338
+ <oneOrMore>
339
+ <ref name="TextElement"/>
340
+ </oneOrMore>
337
341
  </element>
338
342
  </define>
339
343
  <define name="organization">
@@ -897,7 +901,9 @@
897
901
  </define>
898
902
  <define name="formattedref">
899
903
  <element name="formattedref">
900
- <ref name="FormattedString"/>
904
+ <oneOrMore>
905
+ <ref name="TextElement"/>
906
+ </oneOrMore>
901
907
  </element>
902
908
  </define>
903
909
  <define name="license">
@@ -942,7 +948,9 @@
942
948
  <optional>
943
949
  <attribute name="type"/>
944
950
  </optional>
945
- <ref name="FormattedString"/>
951
+ <zeroOrMore>
952
+ <ref name="TextElement"/>
953
+ </zeroOrMore>
946
954
  </define>
947
955
  <!-- TitleType = ( "alternative" | "original" | "unofficial" | "subtitle" | "main" ) -->
948
956
  <define name="TypedUri">
@@ -1042,7 +1050,9 @@
1042
1050
  <optional>
1043
1051
  <attribute name="script"/>
1044
1052
  </optional>
1045
- <text/>
1053
+ <oneOrMore>
1054
+ <ref name="TextElement"/>
1055
+ </oneOrMore>
1046
1056
  </element>
1047
1057
  </define>
1048
1058
  <define name="docnumber">
@@ -1267,12 +1277,16 @@
1267
1277
  <optional>
1268
1278
  <attribute name="type"/>
1269
1279
  </optional>
1270
- <ref name="FormattedString"/>
1280
+ <oneOrMore>
1281
+ <ref name="TextElement"/>
1282
+ </oneOrMore>
1271
1283
  </element>
1272
1284
  </define>
1273
1285
  <define name="bibabstract">
1274
1286
  <element name="abstract">
1275
- <ref name="FormattedString"/>
1287
+ <oneOrMore>
1288
+ <ref name="TextElement"/>
1289
+ </oneOrMore>
1276
1290
  </element>
1277
1291
  </define>
1278
1292
  <define name="copyright">
@@ -1377,7 +1391,9 @@
1377
1391
  </attribute>
1378
1392
  <optional>
1379
1393
  <element name="description">
1380
- <ref name="FormattedString"/>
1394
+ <oneOrMore>
1395
+ <ref name="TextElement"/>
1396
+ </oneOrMore>
1381
1397
  </element>
1382
1398
  </optional>
1383
1399
  <element name="bibitem">
@@ -156,44 +156,7 @@
156
156
  </define>
157
157
  <define name="xref">
158
158
  <element name="xref">
159
- <attribute name="target">
160
- <data type="string">
161
- <param name="pattern">\i\c*|\c+#\c+</param>
162
- </data>
163
- </attribute>
164
- <optional>
165
- <attribute name="to">
166
- <data type="string">
167
- <param name="pattern">\i\c*|\c+#\c+</param>
168
- </data>
169
- </attribute>
170
- </optional>
171
- <optional>
172
- <attribute name="type">
173
- <ref name="ReferenceFormat"/>
174
- </attribute>
175
- </optional>
176
- <optional>
177
- <attribute name="alt"/>
178
- </optional>
179
- <optional>
180
- <attribute name="case">
181
- <choice>
182
- <value>capital</value>
183
- <value>lowercase</value>
184
- </choice>
185
- </attribute>
186
- </optional>
187
- <optional>
188
- <attribute name="droploc">
189
- <data type="boolean"/>
190
- </attribute>
191
- </optional>
192
- <optional>
193
- <attribute name="style">
194
- <ref name="XrefStyleType"/>
195
- </attribute>
196
- </optional>
159
+ <ref name="XrefAttributes"/>
197
160
  <ref name="XrefBody"/>
198
161
  </element>
199
162
  </define>
@@ -407,23 +370,7 @@
407
370
  </define>
408
371
  <define name="figure">
409
372
  <element name="figure">
410
- <attribute name="id">
411
- <data type="ID"/>
412
- </attribute>
413
- <optional>
414
- <attribute name="unnumbered">
415
- <data type="boolean"/>
416
- </attribute>
417
- </optional>
418
- <optional>
419
- <attribute name="number"/>
420
- </optional>
421
- <optional>
422
- <attribute name="subsequence"/>
423
- </optional>
424
- <optional>
425
- <attribute name="class"/>
426
- </optional>
373
+ <ref name="FigureAttributes"/>
427
374
  <ref name="BlockAttributes"/>
428
375
  <optional>
429
376
  <ref name="tname"/>
@@ -2450,6 +2397,49 @@
2450
2397
  </zeroOrMore>
2451
2398
  </element>
2452
2399
  </define>
2400
+ <define name="XrefAttributes">
2401
+ <attribute name="target">
2402
+ <data type="string">
2403
+ <param name="pattern">\i\c*|\c+#\c+</param>
2404
+ </data>
2405
+ </attribute>
2406
+ <optional>
2407
+ <attribute name="to">
2408
+ <data type="string">
2409
+ <param name="pattern">\i\c*|\c+#\c+</param>
2410
+ </data>
2411
+ </attribute>
2412
+ </optional>
2413
+ <optional>
2414
+ <attribute name="type">
2415
+ <ref name="ReferenceFormat"/>
2416
+ </attribute>
2417
+ </optional>
2418
+ <optional>
2419
+ <attribute name="alt"/>
2420
+ </optional>
2421
+ <optional>
2422
+ <attribute name="case">
2423
+ <choice>
2424
+ <value>capital</value>
2425
+ <value>lowercase</value>
2426
+ </choice>
2427
+ </attribute>
2428
+ </optional>
2429
+ <optional>
2430
+ <attribute name="droploc">
2431
+ <data type="boolean"/>
2432
+ </attribute>
2433
+ </optional>
2434
+ <optional>
2435
+ <attribute name="style">
2436
+ <ref name="XrefStyleType"/>
2437
+ </attribute>
2438
+ </optional>
2439
+ <optional>
2440
+ <attribute name="label"/>
2441
+ </optional>
2442
+ </define>
2453
2443
  <define name="XrefBody">
2454
2444
  <zeroOrMore>
2455
2445
  <ref name="XrefTarget"/>
@@ -2528,6 +2518,28 @@
2528
2518
  <attribute name="columns"/>
2529
2519
  </optional>
2530
2520
  </define>
2521
+ <define name="FigureAttributes">
2522
+ <attribute name="id">
2523
+ <data type="ID"/>
2524
+ </attribute>
2525
+ <optional>
2526
+ <attribute name="unnumbered">
2527
+ <data type="boolean"/>
2528
+ </attribute>
2529
+ </optional>
2530
+ <optional>
2531
+ <attribute name="number"/>
2532
+ </optional>
2533
+ <optional>
2534
+ <attribute name="subsequence"/>
2535
+ </optional>
2536
+ <optional>
2537
+ <attribute name="class"/>
2538
+ </optional>
2539
+ <optional>
2540
+ <attribute name="width"/>
2541
+ </optional>
2542
+ </define>
2531
2543
  <start>
2532
2544
  <ref name="standard-document"/>
2533
2545
  </start>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.9.4".freeze
3
+ VERSION = "0.9.6".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-10 00:00:00.000000000 Z
11
+ date: 2024-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic