metanorma-iho 1.2.2 → 1.2.3

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: 2df05b7790e02fb4929bd6ce176e09c0ee52f96b7dc7ddc9d3846f0b38c2f2b5
4
- data.tar.gz: e4cb99c1d3318dfa11ce21bdd1d90708cda57707ca11c83d0f3e15449161aaf9
3
+ metadata.gz: f534b702d06681bb74134be4cdfe8697d59fba10855b894821d8fc05385619b0
4
+ data.tar.gz: 64d0ec45eff2384ce928c31a9db5d184b18a0db98b03862eb228fa8fdf1d8683
5
5
  SHA512:
6
- metadata.gz: 9850ce72a8bd8c9b6e20903cce0362966a06f0122410d80eee03017b1bda19cc72c0c5962506d8ca1790e0ec797c7adeb763e7d08b5c0ed20ccf78d6f5117e7b
7
- data.tar.gz: 169911f45d356bd0f03148cc295a01a525daa19efe41f86475f09a01a639a6f9b682dc3afa215a03155960c2d1f249de2f7d8ea72e845c89ff549f277664ab3f
6
+ metadata.gz: 8089334d951cb6608e270c2c9920b6d5b1d2d413469da852d428ca2d1f2e7d06cc4ca0d87ddfc9331ffc6fc1eab3ee4f29640c3a4efb43eb0ce470367e4a9963
7
+ data.tar.gz: 786458cb370e281b7bbf39117c0d0424775e816e0f0bb610a1d93362b04970c3f8d90d1654bbacc7f3bc445ac2af80b64a9e37e549a8539b13dcf422728b71dd
@@ -416,28 +416,11 @@
416
416
  <fo:block-container font-size="0"> <!-- height="168mm" width="115mm" -->
417
417
  <fo:block>
418
418
  <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'coverpage-image'][1]/mn:value/mn:image[1]">
419
- <xsl:choose>
420
- <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
421
- <fo:instream-foreign-object fox:alt-text="Image Front">
422
- <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
423
- <xsl:call-template name="getSVG"/>
424
- </fo:instream-foreign-object>
425
- </xsl:when>
426
- <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
427
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
428
- </xsl:when>
429
- <xsl:otherwise> <!-- bitmap image -->
430
- <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
431
- <xsl:if test="$coverimage_src != ''">
432
- <xsl:variable name="coverpage">
433
- <xsl:call-template name="getImageURL">
434
- <xsl:with-param name="src" select="$coverimage_src"/>
435
- </xsl:call-template>
436
- </xsl:variable>
437
- <fo:external-graphic src="{$coverpage}" width="155.5mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
438
- </xsl:if>
439
- </xsl:otherwise>
440
- </xsl:choose>
419
+
420
+ <xsl:call-template name="insertPageImage">
421
+ <xsl:with-param name="bitmap_width">155.5</xsl:with-param>
422
+ </xsl:call-template>
423
+
441
424
  </xsl:for-each>
442
425
  </fo:block>
443
426
  </fo:block-container>
@@ -2761,13 +2744,23 @@
2761
2744
  <xsl:attribute-set name="copyright-statement-style">
2762
2745
  </xsl:attribute-set> <!-- copyright-statement-style -->
2763
2746
 
2747
+ <xsl:template name="refine_copyright-statement-style">
2748
+ </xsl:template>
2749
+
2764
2750
  <xsl:attribute-set name="copyright-statement-title-style">
2765
2751
  </xsl:attribute-set> <!-- copyright-statement-title-style -->
2766
2752
 
2753
+ <xsl:template name="refine_copyright-statement-title-style">
2754
+ </xsl:template>
2755
+
2767
2756
  <xsl:attribute-set name="copyright-statement-p-style">
2768
2757
  </xsl:attribute-set> <!-- copyright-statement-p-style -->
2769
2758
 
2770
- <xsl:attribute-set name="license-statement-style">
2759
+ <xsl:template name="refine_copyright-statement-p-style">
2760
+
2761
+ </xsl:template>
2762
+
2763
+ <xsl:attribute-set name="license-statement-style">
2771
2764
  </xsl:attribute-set> <!-- license-statement-style -->
2772
2765
 
2773
2766
  <xsl:attribute-set name="license-statement-title-style">
@@ -2777,6 +2770,10 @@
2777
2770
  <xsl:attribute-set name="license-statement-p-style">
2778
2771
  </xsl:attribute-set> <!-- license-statement-p-style -->
2779
2772
 
2773
+ <xsl:template name="refine_license-statement-p-style">
2774
+
2775
+ </xsl:template>
2776
+
2780
2777
  <xsl:attribute-set name="legal-statement-style">
2781
2778
  </xsl:attribute-set> <!-- legal-statement-style -->
2782
2779
 
@@ -2804,6 +2801,8 @@
2804
2801
  <!-- ================================= -->
2805
2802
  <xsl:template match="mn:copyright-statement">
2806
2803
  <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
2804
+ <xsl:call-template name="refine_copyright-statement-style"/>
2805
+
2807
2806
  <xsl:apply-templates/>
2808
2807
  </fo:block>
2809
2808
  </xsl:template> <!-- copyright-statement -->
@@ -3902,7 +3901,7 @@
3902
3901
  </xsl:otherwise>
3903
3902
  </xsl:choose>
3904
3903
  </xsl:variable>
3905
- <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift'">
3904
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift' or $key = 'line-height' ">
3906
3905
  <style name="{$key}"><xsl:value-of select="$value"/></style>
3907
3906
  </xsl:if>
3908
3907
  <xsl:if test="$key = 'text-indent'">
@@ -11439,13 +11438,31 @@
11439
11438
  <!-- skip here, see the template 'fmt-review-start' -->
11440
11439
  </xsl:when>
11441
11440
  <xsl:otherwise>
11442
- <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
11443
- <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
11444
- <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
11445
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
11441
+ <xsl:choose>
11442
+ <xsl:when test="parent::mn:example or parent::mn:termexample or parent::mn:note or parent::mn:termnote">
11443
+ <fo:block font-size="1pt" line-height="0.1">
11444
+ <xsl:call-template name="fo_inline_bookmark">
11445
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
11446
+ </xsl:call-template>
11447
+ </fo:block>
11448
+ </xsl:when>
11449
+ <xsl:otherwise>
11450
+ <xsl:call-template name="fo_inline_bookmark">
11451
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
11452
+ </xsl:call-template>
11453
+ </xsl:otherwise>
11454
+ </xsl:choose>
11446
11455
  </xsl:otherwise>
11447
11456
  </xsl:choose>
11448
11457
  </xsl:template>
11458
+
11459
+ <xsl:template name="fo_inline_bookmark">
11460
+ <xsl:param name="bookmark_id"/>
11461
+ <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
11462
+ <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
11463
+ <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
11464
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
11465
+ </xsl:template>
11449
11466
  <!-- =================== -->
11450
11467
  <!-- End of Index processing -->
11451
11468
  <!-- =================== -->
@@ -13345,11 +13362,35 @@
13345
13362
 
13346
13363
  <xsl:template match="mn:svgmap"/>
13347
13364
 
13365
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
13366
+
13348
13367
  <!-- for correct rendering combining chars, added in mode="update_xml_step2" -->
13349
13368
  <xsl:template match="*[local-name() = 'lang_none']">
13350
13369
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
13351
13370
  </xsl:template>
13352
13371
 
13372
+ <xsl:template name="addTagElementT">
13373
+ <xsl:variable name="title_">
13374
+ <xsl:apply-templates select="mn:fmt-title"/>
13375
+ </xsl:variable>
13376
+ <xsl:variable name="title__">
13377
+ <xsl:for-each select="xalan:nodeset($title_)/*/node()">
13378
+ <xsl:choose>
13379
+ <xsl:when test="self::text()"><xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text></xsl:when>
13380
+ <xsl:otherwise><xsl:text> </xsl:text><xsl:copy-of select="."/><xsl:text> </xsl:text></xsl:otherwise>
13381
+ </xsl:choose>
13382
+ </xsl:for-each>
13383
+ </xsl:variable>
13384
+ <xsl:variable name="title" select="normalize-space($title__)"/>
13385
+ <xsl:if test="$title != ''">
13386
+ <xsl:attribute name="fox:title">
13387
+ <xsl:if test="ancestor::mn:sections">
13388
+ <xsl:text>Section </xsl:text>
13389
+ </xsl:if>
13390
+ <xsl:value-of select="$title"/></xsl:attribute>
13391
+ </xsl:if>
13392
+ </xsl:template>
13393
+
13353
13394
  <xsl:template name="replaceChar">
13354
13395
  <xsl:param name="text"/>
13355
13396
  <xsl:param name="replace"/>
@@ -14116,6 +14157,13 @@
14116
14157
  <xsl:with-param name="default" select="$text_align_default"/>
14117
14158
  </xsl:call-template>
14118
14159
  <xsl:call-template name="setKeepAttributes"/>
14160
+ <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
14161
+ <xsl:variable name="styles">
14162
+ <xsl:apply-templates select="*[1]"/>
14163
+ </xsl:variable>
14164
+ <!-- move attribute line-height from inline to block -->
14165
+ <xsl:attribute name="line-height"><xsl:value-of select="xalan:nodeset($styles)//*/@line-height"/></xsl:attribute>
14166
+ </xsl:if>
14119
14167
  </xsl:template>
14120
14168
 
14121
14169
  <xsl:template name="setKeepAttributes">
@@ -14141,34 +14189,41 @@
14141
14189
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
14142
14190
  <fo:block>
14143
14191
  <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image[$num]">
14144
- <xsl:choose>
14145
- <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
14146
- <fo:instream-foreign-object fox:alt-text="Image Front">
14147
- <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
14148
- <xsl:call-template name="getSVG"/>
14149
- </fo:instream-foreign-object>
14150
- </xsl:when>
14151
- <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
14152
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
14153
- </xsl:when>
14154
- <xsl:otherwise> <!-- bitmap image -->
14155
- <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
14156
- <xsl:if test="$coverimage_src != ''">
14157
- <xsl:variable name="coverpage">
14158
- <xsl:call-template name="getImageURL">
14159
- <xsl:with-param name="src" select="$coverimage_src"/>
14160
- </xsl:call-template>
14161
- </xsl:variable>
14162
- <!-- <xsl:variable name="coverpage" select="concat('url(file:',$basepath, 'coverpage1.png', ')')"/> --> <!-- for DEBUG -->
14163
- <fo:external-graphic src="{$coverpage}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
14164
- </xsl:if>
14165
- </xsl:otherwise>
14166
- </xsl:choose>
14192
+
14193
+ <xsl:call-template name="insertPageImage"/>
14194
+
14167
14195
  </xsl:for-each>
14168
14196
  </fo:block>
14169
14197
  </fo:block-container>
14170
14198
  </xsl:template>
14171
14199
 
14200
+ <xsl:template name="insertPageImage">
14201
+ <xsl:param name="svg_content_height" select="$pageHeight"/>
14202
+ <xsl:param name="bitmap_width" select="$pageWidth"/>
14203
+ <xsl:choose>
14204
+ <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
14205
+ <fo:instream-foreign-object fox:alt-text="Image Front">
14206
+ <xsl:attribute name="content-height"><xsl:value-of select="$svg_content_height"/>mm</xsl:attribute>
14207
+ <xsl:call-template name="getSVG"/>
14208
+ </fo:instream-foreign-object>
14209
+ </xsl:when>
14210
+ <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
14211
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
14212
+ </xsl:when>
14213
+ <xsl:otherwise> <!-- bitmap image -->
14214
+ <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
14215
+ <xsl:if test="$coverimage_src != ''">
14216
+ <xsl:variable name="coverpage">
14217
+ <xsl:call-template name="getImageURL">
14218
+ <xsl:with-param name="src" select="$coverimage_src"/>
14219
+ </xsl:call-template>
14220
+ </xsl:variable>
14221
+ <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
14222
+ </xsl:if>
14223
+ </xsl:otherwise>
14224
+ </xsl:choose>
14225
+ </xsl:template>
14226
+
14172
14227
  <xsl:template name="getImageURL">
14173
14228
  <xsl:param name="src"/>
14174
14229
  <xsl:choose>
@@ -14596,6 +14651,14 @@
14596
14651
  </xsl:attribute>
14597
14652
  </xsl:template>
14598
14653
 
14654
+ <xsl:template name="getCharByCodePoint">
14655
+ <xsl:param name="codepoint"/>
14656
+ <xsl:param name="radix">16</xsl:param>
14657
+ <xsl:variable name="codepointInt" select="java:java.lang.Integer.parseInt($codepoint,$radix)"/>
14658
+ <xsl:variable name="chars" select="java:java.lang.Character.toChars($codepointInt)"/>
14659
+ <xsl:value-of select="java:java.lang.String.new($chars)"/>
14660
+ </xsl:template>
14661
+
14599
14662
  <xsl:template name="substring-after-last">
14600
14663
  <xsl:param name="value"/>
14601
14664
  <xsl:param name="delimiter"/>
@@ -416,28 +416,11 @@
416
416
  <fo:block-container font-size="0"> <!-- height="168mm" width="115mm" -->
417
417
  <fo:block>
418
418
  <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'coverpage-image'][1]/mn:value/mn:image[1]">
419
- <xsl:choose>
420
- <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
421
- <fo:instream-foreign-object fox:alt-text="Image Front">
422
- <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
423
- <xsl:call-template name="getSVG"/>
424
- </fo:instream-foreign-object>
425
- </xsl:when>
426
- <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
427
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
428
- </xsl:when>
429
- <xsl:otherwise> <!-- bitmap image -->
430
- <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
431
- <xsl:if test="$coverimage_src != ''">
432
- <xsl:variable name="coverpage">
433
- <xsl:call-template name="getImageURL">
434
- <xsl:with-param name="src" select="$coverimage_src"/>
435
- </xsl:call-template>
436
- </xsl:variable>
437
- <fo:external-graphic src="{$coverpage}" width="155.5mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
438
- </xsl:if>
439
- </xsl:otherwise>
440
- </xsl:choose>
419
+
420
+ <xsl:call-template name="insertPageImage">
421
+ <xsl:with-param name="bitmap_width">155.5</xsl:with-param>
422
+ </xsl:call-template>
423
+
441
424
  </xsl:for-each>
442
425
  </fo:block>
443
426
  </fo:block-container>
@@ -2761,13 +2744,23 @@
2761
2744
  <xsl:attribute-set name="copyright-statement-style">
2762
2745
  </xsl:attribute-set> <!-- copyright-statement-style -->
2763
2746
 
2747
+ <xsl:template name="refine_copyright-statement-style">
2748
+ </xsl:template>
2749
+
2764
2750
  <xsl:attribute-set name="copyright-statement-title-style">
2765
2751
  </xsl:attribute-set> <!-- copyright-statement-title-style -->
2766
2752
 
2753
+ <xsl:template name="refine_copyright-statement-title-style">
2754
+ </xsl:template>
2755
+
2767
2756
  <xsl:attribute-set name="copyright-statement-p-style">
2768
2757
  </xsl:attribute-set> <!-- copyright-statement-p-style -->
2769
2758
 
2770
- <xsl:attribute-set name="license-statement-style">
2759
+ <xsl:template name="refine_copyright-statement-p-style">
2760
+
2761
+ </xsl:template>
2762
+
2763
+ <xsl:attribute-set name="license-statement-style">
2771
2764
  </xsl:attribute-set> <!-- license-statement-style -->
2772
2765
 
2773
2766
  <xsl:attribute-set name="license-statement-title-style">
@@ -2777,6 +2770,10 @@
2777
2770
  <xsl:attribute-set name="license-statement-p-style">
2778
2771
  </xsl:attribute-set> <!-- license-statement-p-style -->
2779
2772
 
2773
+ <xsl:template name="refine_license-statement-p-style">
2774
+
2775
+ </xsl:template>
2776
+
2780
2777
  <xsl:attribute-set name="legal-statement-style">
2781
2778
  </xsl:attribute-set> <!-- legal-statement-style -->
2782
2779
 
@@ -2804,6 +2801,8 @@
2804
2801
  <!-- ================================= -->
2805
2802
  <xsl:template match="mn:copyright-statement">
2806
2803
  <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
2804
+ <xsl:call-template name="refine_copyright-statement-style"/>
2805
+
2807
2806
  <xsl:apply-templates/>
2808
2807
  </fo:block>
2809
2808
  </xsl:template> <!-- copyright-statement -->
@@ -3902,7 +3901,7 @@
3902
3901
  </xsl:otherwise>
3903
3902
  </xsl:choose>
3904
3903
  </xsl:variable>
3905
- <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift'">
3904
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift' or $key = 'line-height' ">
3906
3905
  <style name="{$key}"><xsl:value-of select="$value"/></style>
3907
3906
  </xsl:if>
3908
3907
  <xsl:if test="$key = 'text-indent'">
@@ -11439,13 +11438,31 @@
11439
11438
  <!-- skip here, see the template 'fmt-review-start' -->
11440
11439
  </xsl:when>
11441
11440
  <xsl:otherwise>
11442
- <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
11443
- <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
11444
- <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
11445
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
11441
+ <xsl:choose>
11442
+ <xsl:when test="parent::mn:example or parent::mn:termexample or parent::mn:note or parent::mn:termnote">
11443
+ <fo:block font-size="1pt" line-height="0.1">
11444
+ <xsl:call-template name="fo_inline_bookmark">
11445
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
11446
+ </xsl:call-template>
11447
+ </fo:block>
11448
+ </xsl:when>
11449
+ <xsl:otherwise>
11450
+ <xsl:call-template name="fo_inline_bookmark">
11451
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
11452
+ </xsl:call-template>
11453
+ </xsl:otherwise>
11454
+ </xsl:choose>
11446
11455
  </xsl:otherwise>
11447
11456
  </xsl:choose>
11448
11457
  </xsl:template>
11458
+
11459
+ <xsl:template name="fo_inline_bookmark">
11460
+ <xsl:param name="bookmark_id"/>
11461
+ <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
11462
+ <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
11463
+ <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
11464
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
11465
+ </xsl:template>
11449
11466
  <!-- =================== -->
11450
11467
  <!-- End of Index processing -->
11451
11468
  <!-- =================== -->
@@ -13345,11 +13362,35 @@
13345
13362
 
13346
13363
  <xsl:template match="mn:svgmap"/>
13347
13364
 
13365
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
13366
+
13348
13367
  <!-- for correct rendering combining chars, added in mode="update_xml_step2" -->
13349
13368
  <xsl:template match="*[local-name() = 'lang_none']">
13350
13369
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
13351
13370
  </xsl:template>
13352
13371
 
13372
+ <xsl:template name="addTagElementT">
13373
+ <xsl:variable name="title_">
13374
+ <xsl:apply-templates select="mn:fmt-title"/>
13375
+ </xsl:variable>
13376
+ <xsl:variable name="title__">
13377
+ <xsl:for-each select="xalan:nodeset($title_)/*/node()">
13378
+ <xsl:choose>
13379
+ <xsl:when test="self::text()"><xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text></xsl:when>
13380
+ <xsl:otherwise><xsl:text> </xsl:text><xsl:copy-of select="."/><xsl:text> </xsl:text></xsl:otherwise>
13381
+ </xsl:choose>
13382
+ </xsl:for-each>
13383
+ </xsl:variable>
13384
+ <xsl:variable name="title" select="normalize-space($title__)"/>
13385
+ <xsl:if test="$title != ''">
13386
+ <xsl:attribute name="fox:title">
13387
+ <xsl:if test="ancestor::mn:sections">
13388
+ <xsl:text>Section </xsl:text>
13389
+ </xsl:if>
13390
+ <xsl:value-of select="$title"/></xsl:attribute>
13391
+ </xsl:if>
13392
+ </xsl:template>
13393
+
13353
13394
  <xsl:template name="replaceChar">
13354
13395
  <xsl:param name="text"/>
13355
13396
  <xsl:param name="replace"/>
@@ -14116,6 +14157,13 @@
14116
14157
  <xsl:with-param name="default" select="$text_align_default"/>
14117
14158
  </xsl:call-template>
14118
14159
  <xsl:call-template name="setKeepAttributes"/>
14160
+ <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
14161
+ <xsl:variable name="styles">
14162
+ <xsl:apply-templates select="*[1]"/>
14163
+ </xsl:variable>
14164
+ <!-- move attribute line-height from inline to block -->
14165
+ <xsl:attribute name="line-height"><xsl:value-of select="xalan:nodeset($styles)//*/@line-height"/></xsl:attribute>
14166
+ </xsl:if>
14119
14167
  </xsl:template>
14120
14168
 
14121
14169
  <xsl:template name="setKeepAttributes">
@@ -14141,34 +14189,41 @@
14141
14189
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
14142
14190
  <fo:block>
14143
14191
  <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image[$num]">
14144
- <xsl:choose>
14145
- <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
14146
- <fo:instream-foreign-object fox:alt-text="Image Front">
14147
- <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
14148
- <xsl:call-template name="getSVG"/>
14149
- </fo:instream-foreign-object>
14150
- </xsl:when>
14151
- <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
14152
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
14153
- </xsl:when>
14154
- <xsl:otherwise> <!-- bitmap image -->
14155
- <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
14156
- <xsl:if test="$coverimage_src != ''">
14157
- <xsl:variable name="coverpage">
14158
- <xsl:call-template name="getImageURL">
14159
- <xsl:with-param name="src" select="$coverimage_src"/>
14160
- </xsl:call-template>
14161
- </xsl:variable>
14162
- <!-- <xsl:variable name="coverpage" select="concat('url(file:',$basepath, 'coverpage1.png', ')')"/> --> <!-- for DEBUG -->
14163
- <fo:external-graphic src="{$coverpage}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
14164
- </xsl:if>
14165
- </xsl:otherwise>
14166
- </xsl:choose>
14192
+
14193
+ <xsl:call-template name="insertPageImage"/>
14194
+
14167
14195
  </xsl:for-each>
14168
14196
  </fo:block>
14169
14197
  </fo:block-container>
14170
14198
  </xsl:template>
14171
14199
 
14200
+ <xsl:template name="insertPageImage">
14201
+ <xsl:param name="svg_content_height" select="$pageHeight"/>
14202
+ <xsl:param name="bitmap_width" select="$pageWidth"/>
14203
+ <xsl:choose>
14204
+ <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
14205
+ <fo:instream-foreign-object fox:alt-text="Image Front">
14206
+ <xsl:attribute name="content-height"><xsl:value-of select="$svg_content_height"/>mm</xsl:attribute>
14207
+ <xsl:call-template name="getSVG"/>
14208
+ </fo:instream-foreign-object>
14209
+ </xsl:when>
14210
+ <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
14211
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
14212
+ </xsl:when>
14213
+ <xsl:otherwise> <!-- bitmap image -->
14214
+ <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
14215
+ <xsl:if test="$coverimage_src != ''">
14216
+ <xsl:variable name="coverpage">
14217
+ <xsl:call-template name="getImageURL">
14218
+ <xsl:with-param name="src" select="$coverimage_src"/>
14219
+ </xsl:call-template>
14220
+ </xsl:variable>
14221
+ <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
14222
+ </xsl:if>
14223
+ </xsl:otherwise>
14224
+ </xsl:choose>
14225
+ </xsl:template>
14226
+
14172
14227
  <xsl:template name="getImageURL">
14173
14228
  <xsl:param name="src"/>
14174
14229
  <xsl:choose>
@@ -14596,6 +14651,14 @@
14596
14651
  </xsl:attribute>
14597
14652
  </xsl:template>
14598
14653
 
14654
+ <xsl:template name="getCharByCodePoint">
14655
+ <xsl:param name="codepoint"/>
14656
+ <xsl:param name="radix">16</xsl:param>
14657
+ <xsl:variable name="codepointInt" select="java:java.lang.Integer.parseInt($codepoint,$radix)"/>
14658
+ <xsl:variable name="chars" select="java:java.lang.Character.toChars($codepointInt)"/>
14659
+ <xsl:value-of select="java:java.lang.String.new($chars)"/>
14660
+ </xsl:template>
14661
+
14599
14662
  <xsl:template name="substring-after-last">
14600
14663
  <xsl:param name="value"/>
14601
14664
  <xsl:param name="delimiter"/>
@@ -76,12 +76,6 @@ from other documents in the same doctype</a:documentation>
76
76
  <ref name="flavor">
77
77
  <a:documentation>Flavour of Metanorma used to process this document</a:documentation>
78
78
  </ref>
79
- <optional>
80
- <ref name="editorialgroup">
81
- <a:documentation>Groups associated with the production of the standards document, typically within
82
- a standards definition organization</a:documentation>
83
- </ref>
84
- </optional>
85
79
  <zeroOrMore>
86
80
  <ref name="ics">
87
81
  <a:documentation>Classification of the document contents taken from the International Classification of Standards</a:documentation>
@@ -130,49 +124,6 @@ a standards definition organization</a:documentation>
130
124
  However we prefer not to hardcode it, given ongoing extension.</a:documentation>
131
125
  <text/>
132
126
  </define>
133
- <define name="editorialgroup">
134
- <a:documentation>A group associated with the production of the standards document, typically within
135
- a standards definition organization</a:documentation>
136
- <element name="editorialgroup">
137
- <oneOrMore>
138
- <ref name="technical-committee">
139
- <a:documentation>A technical committee associated with the production of the standards document</a:documentation>
140
- </ref>
141
- </oneOrMore>
142
- </element>
143
- </define>
144
- <define name="technical-committee">
145
- <a:documentation>Technical committee associated with the production of a standards document</a:documentation>
146
- <element name="technical-committee">
147
- <ref name="IsoWorkgroup"/>
148
- </element>
149
- </define>
150
- <define name="IsoWorkgroup">
151
- <optional>
152
- <attribute name="number">
153
- <a:documentation>Numeric identifier of the technical committee</a:documentation>
154
- </attribute>
155
- </optional>
156
- <optional>
157
- <attribute name="type">
158
- <a:documentation>Type of the technical committee, used in identifying the technical committee</a:documentation>
159
- </attribute>
160
- </optional>
161
- <optional>
162
- <attribute name="identifier">
163
- <a:documentation>Non-numeric, complete identifier of the technical committee</a:documentation>
164
- </attribute>
165
- </optional>
166
- <optional>
167
- <attribute name="prefix">
168
- <a:documentation>Disambiguating prefix added to number to form the identifier of the technical committee,
169
- typically indicating its type</a:documentation>
170
- </attribute>
171
- </optional>
172
- <text>
173
- <a:documentation>Name of the technical committee</a:documentation>
174
- </text>
175
- </define>
176
127
  <define name="ics">
177
128
  <a:documentation>Classification taken from the International Classification of Standards.
178
129
  ICS is defined by ISO here -- https://www.iso.org/publication/PUB100033.html</a:documentation>
@@ -242,6 +242,8 @@ Detailed in https://www.relaton.org/model/creator/</a:documentation>
242
242
  </choice>
243
243
  </define>
244
244
  <define name="roledescription">
245
+ <a:documentation>A more detailed description of the role of the contributor
246
+ Some descriptions are reserved words; in particular, the editorial committee of a standard has the role description "committee"</a:documentation>
245
247
  <element name="description">
246
248
  <ref name="LocalizedMarkedUpString"/>
247
249
  </element>
@@ -443,7 +445,10 @@ real names (if the person is named with a pseudonym or user name); previous lega
443
445
  </oneOrMore>
444
446
  <zeroOrMore>
445
447
  <ref name="subdivision">
446
- <a:documentation>The subdivision of the organization directly involved with the production of the bibliographic item</a:documentation>
448
+ <a:documentation>The subdivision of the organization directly involved with the production of the bibliographic item.
449
+ Multiple subdivisions can be specified for an organization, with no implication of hierarchical
450
+ relation between them
451
+ Editorial and advisory groups are represented as consecutive subdivisions of the SDO</a:documentation>
447
452
  </ref>
448
453
  </zeroOrMore>
449
454
  <optional>
@@ -485,6 +490,11 @@ real names (if the person is named with a pseudonym or user name); previous lega
485
490
  <a:documentation>The type of subdivision</a:documentation>
486
491
  </attribute>
487
492
  </optional>
493
+ <optional>
494
+ <attribute name="subtype">
495
+ <a:documentation>The subtype of subdivision; e.g. different types of technical committee</a:documentation>
496
+ </attribute>
497
+ </optional>
488
498
  <ref name="OrganizationType">
489
499
  <a:documentation>The subdivision, modelled recursively as an organization</a:documentation>
490
500
  </ref>
@@ -18,6 +18,10 @@ module Metanorma
18
18
  end
19
19
 
20
20
  def metadata_ext(node, ext)
21
+ unless node.attr("workgroup")
22
+ @log.add("AsciiDoc Input", nil,
23
+ "Missing workgroup attribute for document")
24
+ end
21
25
  super
22
26
  metadata_commentperiod(node, ext)
23
27
  end
@@ -31,38 +35,6 @@ module Metanorma
31
35
  end
32
36
  end
33
37
 
34
- def metadata_committee(node, xml)
35
- unless node.attr("workgroup")
36
- @log.add("AsciiDoc Input", nil,
37
- "Missing workgroup attribute for document")
38
- return
39
- end
40
- metadata_committee1(node, xml)
41
- end
42
-
43
- def metadata_committee1(node, xml)
44
- xml.editorialgroup do |a|
45
- a.committee do |n|
46
- n.abbreviation node.attr("committee").upcase
47
- end
48
- a.workgroup do |n|
49
- n.abbreviation node.attr("workgroup").upcase
50
- end
51
- end
52
- i = 2
53
- while node.attr("workgroup_#{i}")
54
- xml.editorialgroup do |a|
55
- a.committee do |n|
56
- n.abbreviation node.attr("committee_#{i}").upcase
57
- end
58
- a.workgroup do |n|
59
- n.abbreviation node.attr("workgroup_#{i}").upcase
60
- end
61
- end
62
- i += 1
63
- end
64
- end
65
-
66
38
  def metadata_version(node, xml)
67
39
  if node.attr("edition-major")
68
40
  ed = node.attr("edition-major")
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!-- VERSION v2.1.0 -->
3
+ <!-- VERSION v2.1.1 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -2233,6 +2233,11 @@ used in document amendments</a:documentation>
2233
2233
  <ref name="RequiredId"/>
2234
2234
  <ref name="NumberingAttributes"/>
2235
2235
  <ref name="BlockAttributes"/>
2236
+ <optional>
2237
+ <attribute name="type">
2238
+ <a:documentation>Semantic classification of note</a:documentation>
2239
+ </attribute>
2240
+ </optional>
2236
2241
  <oneOrMore>
2237
2242
  <choice>
2238
2243
  <a:documentation>Content of the term note</a:documentation>
@@ -16,17 +16,6 @@
16
16
  <value>regulation</value>
17
17
  </choice>
18
18
  </define>
19
- <define name="editorialgroup">
20
- <element name="editorialgroup">
21
- <oneOrMore>
22
- <choice>
23
- <ref name="committee"/>
24
- <ref name="workgroup"/>
25
- <ref name="commission"/>
26
- </choice>
27
- </oneOrMore>
28
- </element>
29
- </define>
30
19
  <define name="structuredidentifier">
31
20
  <element name="structuredidentifier">
32
21
  <element name="docnumber">
@@ -62,38 +51,6 @@
62
51
  </ref>
63
52
  </optional>
64
53
  </define>
65
- <define name="committee">
66
- <element name="committee">
67
- <ref name="IHO_Group"/>
68
- </element>
69
- </define>
70
- <define name="workgroup">
71
- <element name="workgroup">
72
- <ref name="IHO_Group"/>
73
- </element>
74
- </define>
75
- <define name="commission">
76
- <element name="commission">
77
- <ref name="IHO_Group"/>
78
- </element>
79
- </define>
80
- <define name="IHO_Group">
81
- <optional>
82
- <element name="name">
83
- <text/>
84
- </element>
85
- </optional>
86
- <element name="abbreviation">
87
- <text/>
88
- </element>
89
- <optional>
90
- <choice>
91
- <ref name="committee"/>
92
- <ref name="workgroup"/>
93
- <ref name="commission"/>
94
- </choice>
95
- </optional>
96
- </define>
97
54
  <define name="commentperiod">
98
55
  <a:documentation>The period during which comments may be submitted to the document draft</a:documentation>
99
56
  <element name="commentperiod">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iho
3
- VERSION = "1.2.2".freeze
3
+ VERSION = "1.2.3".freeze
4
4
  end
5
5
  end
data/metanorma.yml CHANGED
@@ -46,6 +46,10 @@ stage_abbreviations:
46
46
  draft-implementation:
47
47
  in-force:
48
48
  retired:
49
+ committee_types:
50
+ - committee
51
+ - workgroup
52
+ - commission
49
53
  doctypes:
50
54
  - standard
51
55
  - specification
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: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-08-04 00:00:00.000000000 Z
11
+ date: 2025-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic