metanorma-ogc 2.5.4 → 2.5.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -660,17 +660,30 @@
660
660
  <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 -->
661
661
 
662
662
  <xsl:param name="table_if">false</xsl:param> <!-- generate extended table in IF for autolayout-algorithm -->
663
- <xsl:param name="table_widths"/> <!-- path to xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
663
+ <xsl:param name="table_widths"/> <!-- (debug: path to) xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
664
664
  <!-- Example: <tables>
665
- <table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
666
- <tbody>
667
- <tr>
668
- <td id="tab-symdu_1_1">
669
- <p_len>6</p_len>
670
- <p_len>100</p_len> for 2nd paragraph
671
- <word_len>6</word_len>
672
- <word_len>20</word_len>
673
- ...
665
+ <table page-width="509103" id="table1" width_max="223561" width_min="223560">
666
+ <column width_max="39354" width_min="39354"/>
667
+ <column width_max="75394" width_min="75394"/>
668
+ <column width_max="108813" width_min="108813"/>
669
+ <tbody>
670
+ <tr>
671
+ <td width_max="39354" width_min="39354">
672
+ <p_len>39354</p_len>
673
+ <word_len>39354</word_len>
674
+ </td>
675
+
676
+ OLD:
677
+ <tables>
678
+ <table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
679
+ <tbody>
680
+ <tr>
681
+ <td id="tab-symdu_1_1">
682
+ <p_len>6</p_len>
683
+ <p_len>100</p_len> for 2nd paragraph
684
+ <word_len>6</word_len>
685
+ <word_len>20</word_len>
686
+ ...
674
687
  -->
675
688
 
676
689
  <!-- for command line debug: <xsl:variable name="table_widths_from_if" select="document($table_widths)"/> -->
@@ -889,6 +902,10 @@
889
902
  <xsl:variable name="zero_width_space">​</xsl:variable>
890
903
  <xsl:variable name="hair_space"> </xsl:variable>
891
904
  <xsl:variable name="en_dash">–</xsl:variable>
905
+ <xsl:variable name="em_dash">—</xsl:variable>
906
+ <xsl:variable name="cr">&#13;</xsl:variable>
907
+ <xsl:variable name="lf">
908
+ </xsl:variable>
892
909
 
893
910
  <xsl:template name="getTitle">
894
911
  <xsl:param name="name"/>
@@ -1267,6 +1284,10 @@
1267
1284
 
1268
1285
  </xsl:attribute-set> <!-- example-name-style -->
1269
1286
 
1287
+ <xsl:template name="refine_example-name-style">
1288
+
1289
+ </xsl:template>
1290
+
1270
1291
  <xsl:attribute-set name="example-p-style">
1271
1292
 
1272
1293
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
@@ -1283,6 +1304,10 @@
1283
1304
 
1284
1305
  </xsl:attribute-set> <!-- termexample-name-style -->
1285
1306
 
1307
+ <xsl:template name="refine_termexample-name-style">
1308
+
1309
+ </xsl:template>
1310
+
1286
1311
  <!-- ========================== -->
1287
1312
  <!-- Table styles -->
1288
1313
  <!-- ========================== -->
@@ -1453,6 +1478,10 @@
1453
1478
 
1454
1479
  </xsl:attribute-set> <!-- table-fn-style -->
1455
1480
 
1481
+ <xsl:template name="refine_table-fn-style">
1482
+
1483
+ </xsl:template>
1484
+
1456
1485
  <xsl:attribute-set name="table-fn-number-style">
1457
1486
  <xsl:attribute name="font-size">80%</xsl:attribute>
1458
1487
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
@@ -1461,6 +1490,10 @@
1461
1490
 
1462
1491
  </xsl:attribute-set> <!-- table-fn-number-style -->
1463
1492
 
1493
+ <xsl:template name="refine_table-fn-number-style">
1494
+
1495
+ </xsl:template>
1496
+
1464
1497
  <xsl:attribute-set name="fn-container-body-style">
1465
1498
  <xsl:attribute name="text-indent">0</xsl:attribute>
1466
1499
  <xsl:attribute name="start-indent">0</xsl:attribute>
@@ -2646,6 +2679,20 @@
2646
2679
  </xsl:for-each>
2647
2680
  </xsl:template>
2648
2681
 
2682
+ <xsl:param name="table_only_with_id"/><!-- Example: table1, for table auto-layout algorithm -->
2683
+
2684
+ <xsl:template match="*[local-name()='table']" priority="2">
2685
+ <xsl:choose>
2686
+ <xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
2687
+ <xsl:call-template name="table"/>
2688
+ </xsl:when>
2689
+ <xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
2690
+ <xsl:otherwise>
2691
+ <xsl:call-template name="table"/>
2692
+ </xsl:otherwise>
2693
+ </xsl:choose>
2694
+ </xsl:template>
2695
+
2649
2696
  <xsl:template match="*[local-name()='table']" name="table">
2650
2697
 
2651
2698
  <xsl:variable name="table-preamble">
@@ -2655,9 +2702,11 @@
2655
2702
  <xsl:variable name="table">
2656
2703
 
2657
2704
  <xsl:variable name="simple-table">
2658
- <xsl:call-template name="getSimpleTable">
2659
- <xsl:with-param name="id" select="@id"/>
2660
- </xsl:call-template>
2705
+ <xsl:if test="$isGenerateTableIF = 'true' and $isApplyAutolayoutAlgorithm = 'true'">
2706
+ <xsl:call-template name="getSimpleTable">
2707
+ <xsl:with-param name="id" select="@id"/>
2708
+ </xsl:call-template>
2709
+ </xsl:if>
2661
2710
  </xsl:variable>
2662
2711
  <!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
2663
2712
 
@@ -2757,9 +2806,9 @@
2757
2806
  </xsl:attribute>
2758
2807
  </xsl:for-each>
2759
2808
 
2760
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2809
+ <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']"/>
2761
2810
  <xsl:if test="$isNoteOrFnExist = 'true'">
2762
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2811
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
2763
2812
  </xsl:if>
2764
2813
 
2765
2814
  <xsl:choose>
@@ -2910,9 +2959,28 @@
2910
2959
 
2911
2960
  </fo:block>
2912
2961
 
2962
+ <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
2963
+ <xsl:if test="$continued = 'true'">
2964
+ <fo:block text-align="right">
2965
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
2966
+ </fo:block>
2967
+ </xsl:if>
2968
+ <!-- </xsl:if> -->
2969
+
2913
2970
  </xsl:if>
2914
2971
  </xsl:template> <!-- table/name -->
2915
2972
 
2973
+ <!-- workaround solution for https://github.com/metanorma/metanorma-iso/issues/1151#issuecomment-2033087938 -->
2974
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'note'][@type = 'units']/*[local-name() = 'p']/text()" priority="4">
2975
+ <xsl:choose>
2976
+ <xsl:when test="preceding-sibling::*[local-name() = 'br']">
2977
+ <!-- remove CR or LF at start -->
2978
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'^(&#13;&#10;|&#13;|&#10;)', '')"/>
2979
+ </xsl:when>
2980
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
2981
+ </xsl:choose>
2982
+ </xsl:template>
2983
+
2916
2984
  <!-- SOURCE: ... -->
2917
2985
  <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
2918
2986
  <xsl:call-template name="termsource"/>
@@ -3323,7 +3391,7 @@
3323
3391
  <xsl:param name="colwidths"/>
3324
3392
  <xsl:param name="colgroup"/>
3325
3393
 
3326
- <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']"/>
3394
+ <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']"/>
3327
3395
 
3328
3396
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3329
3397
 
@@ -3395,7 +3463,7 @@
3395
3463
 
3396
3464
  <xsl:apply-templates select="../*[local-name()='p']"/>
3397
3465
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3398
- <xsl:apply-templates select="../*[local-name()='note']"/>
3466
+ <xsl:apply-templates select="../*[local-name()='note'][not(@type = 'units')]"/>
3399
3467
  <xsl:apply-templates select="../*[local-name()='example']"/>
3400
3468
  <xsl:apply-templates select="../*[local-name()='source']"/>
3401
3469
 
@@ -3405,7 +3473,7 @@
3405
3473
 
3406
3474
  <!-- horizontal row separator -->
3407
3475
  <xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
3408
- <xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
3476
+ <xsl:if test="(../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
3409
3477
  <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
3410
3478
 
3411
3479
  <xsl:call-template name="setBordersTableArray"/>
@@ -3884,8 +3952,9 @@
3884
3952
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
3885
3953
 
3886
3954
  <fo:block xsl:use-attribute-sets="table-fn-style">
3887
-
3955
+ <xsl:call-template name="refine_table-fn-style"/>
3888
3956
  <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
3957
+ <xsl:call-template name="refine_table-fn-number-style"/>
3889
3958
 
3890
3959
  <xsl:value-of select="@reference"/>
3891
3960
 
@@ -4080,7 +4149,20 @@
4080
4149
  <!-- Definition List -->
4081
4150
  <!-- ===================== -->
4082
4151
 
4083
- <xsl:template match="*[local-name()='dl']">
4152
+ <!-- for table auto-layout algorithm -->
4153
+ <xsl:template match="*[local-name()='dl']" priority="2">
4154
+ <xsl:choose>
4155
+ <xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
4156
+ <xsl:call-template name="dl"/>
4157
+ </xsl:when>
4158
+ <xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
4159
+ <xsl:otherwise>
4160
+ <xsl:call-template name="dl"/>
4161
+ </xsl:otherwise>
4162
+ </xsl:choose>
4163
+ </xsl:template>
4164
+
4165
+ <xsl:template match="*[local-name()='dl']" name="dl">
4084
4166
  <xsl:variable name="isAdded" select="@added"/>
4085
4167
  <xsl:variable name="isDeleted" select="@deleted"/>
4086
4168
  <!-- <dl><xsl:copy-of select="."/></dl> -->
@@ -5039,11 +5121,16 @@
5039
5121
  <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
5040
5122
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
5041
5123
  <xsl:variable name="text" select="."/>
5042
- <fo:inline font-size="75%" role="SKIP">
5124
+ <xsl:variable name="ratio_">
5125
+ 0.75
5126
+ </xsl:variable>
5127
+ <xsl:variable name="ratio" select="number(normalize-space($ratio_))"/>
5128
+ <fo:inline font-size="{$ratio * 100}%" role="SKIP">
5043
5129
  <xsl:if test="string-length($text) &gt; 0">
5044
5130
  <xsl:variable name="smallCapsText">
5045
5131
  <xsl:call-template name="recursiveSmallCaps">
5046
5132
  <xsl:with-param name="text" select="$text"/>
5133
+ <xsl:with-param name="ratio" select="$ratio"/>
5047
5134
  </xsl:call-template>
5048
5135
  </xsl:variable>
5049
5136
  <!-- merge neighboring fo:inline -->
@@ -5080,12 +5167,13 @@
5080
5167
 
5081
5168
  <xsl:template name="recursiveSmallCaps">
5082
5169
  <xsl:param name="text"/>
5170
+ <xsl:param name="ratio"/>
5083
5171
  <xsl:variable name="char" select="substring($text,1,1)"/>
5084
5172
  <!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
5085
5173
  <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
5086
5174
  <xsl:choose>
5087
5175
  <xsl:when test="$char=$upperCase">
5088
- <fo:inline font-size="{100 div 0.75}%" role="SKIP">
5176
+ <fo:inline font-size="{100 div $ratio}%" role="SKIP">
5089
5177
  <xsl:value-of select="$upperCase"/>
5090
5178
  </fo:inline>
5091
5179
  </xsl:when>
@@ -5096,6 +5184,7 @@
5096
5184
  <xsl:if test="string-length($text) &gt; 1">
5097
5185
  <xsl:call-template name="recursiveSmallCaps">
5098
5186
  <xsl:with-param name="text" select="substring($text,2)"/>
5187
+ <xsl:with-param name="ratio" select="$ratio"/>
5099
5188
  </xsl:call-template>
5100
5189
  </xsl:if>
5101
5190
  </xsl:template>
@@ -5132,6 +5221,9 @@
5132
5221
  <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
5133
5222
  <style name="{$key}"><xsl:value-of select="$value"/></style>
5134
5223
  </xsl:if>
5224
+ <xsl:if test="$key = 'text-indent'">
5225
+ <style name="padding-left"><xsl:value-of select="$value"/></style>
5226
+ </xsl:if>
5135
5227
  </xsl:for-each>
5136
5228
  </xsl:variable>
5137
5229
  <xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
@@ -6004,7 +6096,13 @@
6004
6096
  <xsl:value-of select="$language_current_2"/>
6005
6097
  </xsl:when>
6006
6098
  <xsl:otherwise>
6007
- <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
6099
+ <xsl:variable name="language_current_3" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'])"/>
6100
+ <xsl:choose>
6101
+ <xsl:when test="$language_current_3 != ''">
6102
+ <xsl:value-of select="$language_current_3"/>
6103
+ </xsl:when>
6104
+ <xsl:otherwise>en</xsl:otherwise>
6105
+ </xsl:choose>
6008
6106
  </xsl:otherwise>
6009
6107
  </xsl:choose>
6010
6108
  </xsl:otherwise>
@@ -6534,6 +6632,11 @@
6534
6632
  </xsl:call-template>
6535
6633
  </xsl:template>
6536
6634
 
6635
+ <!-- command between two xref points to non-standard bibitem -->
6636
+ <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']]]">
6637
+ <xsl:value-of select="."/>
6638
+ </xsl:template>
6639
+
6537
6640
  <!-- ====== -->
6538
6641
  <!-- formula -->
6539
6642
  <!-- ====== -->
@@ -6902,7 +7005,7 @@
6902
7005
  </xsl:when>
6903
7006
  <xsl:otherwise>
6904
7007
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6905
- <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7008
+ <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'])">
6906
7009
 
6907
7010
  <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
6908
7011
  <xsl:attribute name="width">
@@ -7237,6 +7340,8 @@
7237
7340
  </xsl:attribute>
7238
7341
  </xsl:template>
7239
7342
 
7343
+ <xsl:variable name="regex_starts_with_digit">^[0-9].*</xsl:variable>
7344
+
7240
7345
  <xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
7241
7346
  <xsl:copy>
7242
7347
  <xsl:apply-templates select="@*" mode="svg_update"/>
@@ -7255,7 +7360,8 @@
7255
7360
 
7256
7361
  <xsl:attribute name="width">
7257
7362
  <xsl:choose>
7258
- <xsl:when test="$parent_image_width != '' and $parent_image_width != 'auto'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7363
+ <!-- width is non 'auto', 'text-width', 'full-page-width' or 'narrow' -->
7364
+ <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>
7259
7365
  <xsl:when test="$width != ''">
7260
7366
  <xsl:value-of select="round($width)"/>
7261
7367
  </xsl:when>
@@ -7264,7 +7370,8 @@
7264
7370
  </xsl:attribute>
7265
7371
  <xsl:attribute name="height">
7266
7372
  <xsl:choose>
7267
- <xsl:when test="$parent_image_height != '' and $parent_image_height != 'auto'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7373
+ <!-- height non 'auto', 'text-width', 'full-page-width' or 'narrow' -->
7374
+ <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>
7268
7375
  <xsl:when test="$height != ''">
7269
7376
  <xsl:value-of select="round($height)"/>
7270
7377
  </xsl:when>
@@ -7281,7 +7388,7 @@
7281
7388
  <xsl:variable name="parent_image_width" select="normalize-space(ancestor::*[2][local-name() = 'image']/@width)"/>
7282
7389
  <xsl:attribute name="width">
7283
7390
  <xsl:choose>
7284
- <xsl:when test="$parent_image_width != '' and $parent_image_width != 'auto'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7391
+ <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>
7285
7392
  <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7286
7393
  </xsl:choose>
7287
7394
  </xsl:attribute>
@@ -7292,7 +7399,7 @@
7292
7399
  <xsl:variable name="parent_image_height" select="normalize-space(ancestor::*[2][local-name() = 'image']/@height)"/>
7293
7400
  <xsl:attribute name="height">
7294
7401
  <xsl:choose>
7295
- <xsl:when test="$parent_image_height != '' and $parent_image_height != 'auto'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7402
+ <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>
7296
7403
  <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7297
7404
  </xsl:choose>
7298
7405
  </xsl:attribute>
@@ -8775,6 +8882,7 @@
8775
8882
  <xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']">
8776
8883
  <xsl:if test="normalize-space() != ''">
8777
8884
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
8885
+ <xsl:call-template name="refine_termexample-name-style"/>
8778
8886
  <xsl:apply-templates/>
8779
8887
  </fo:inline>
8780
8888
  </xsl:if>
@@ -8925,6 +9033,7 @@
8925
9033
  </xsl:when>
8926
9034
  <xsl:otherwise>
8927
9035
  <fo:inline xsl:use-attribute-sets="example-name-style">
9036
+ <xsl:call-template name="refine_example-name-style"/>
8928
9037
  <xsl:apply-templates/>
8929
9038
  </fo:inline>
8930
9039
  </xsl:otherwise>
@@ -10140,6 +10249,7 @@
10140
10249
  <xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
10141
10250
 
10142
10251
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
10252
+
10143
10253
  <xsl:call-template name="processBibitem"/>
10144
10254
  </fo:block>
10145
10255
 
@@ -10181,6 +10291,7 @@
10181
10291
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
10182
10292
  <xsl:otherwise>
10183
10293
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
10294
+
10184
10295
  <fo:list-item-label end-indent="label-end()">
10185
10296
  <fo:block role="SKIP">
10186
10297
  <fo:inline role="SKIP">
@@ -139,9 +139,6 @@ module IsoDoc
139
139
  end
140
140
 
141
141
  def toWord(result, filename, dir, header)
142
- result = from_xhtml(word_cleanup(to_xhtml(result)))
143
- .gsub("-DOUBLE_HYPHEN_ESCAPE-", "--")
144
- @wordstylesheet = wordstylesheet_update
145
142
  Html2Doc.new(
146
143
  filename: filename, imagedir: @localdir,
147
144
  stylesheet: @wordstylesheet&.path,
@@ -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">
@@ -126,7 +126,7 @@ module Metanorma
126
126
  xml.docidentifier externalurl(node), type: "ogc-external"
127
127
  docnumber = node.attr("docnumber") || node.attr("docreference")
128
128
  id = node.attr("docidentifier") || docnumber
129
- xml.docidentifier id, type: "ogc-internal"
129
+ xml.docidentifier id, type: "ogc-internal", primary: "true"
130
130
  end
131
131
 
132
132
  def externalurl(node)
@@ -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 Ogc
3
- VERSION = "2.5.4".freeze
3
+ VERSION = "2.5.6".freeze
4
4
  end
5
5
  end