metanorma-ieee 1.0.8 → 1.0.9

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: b91dce824389198d4a39f1890590c4df0d2c99796e02c2458798d075065e5585
4
- data.tar.gz: 10a4a1957e51f3a2137f2864d3735720dbb111f9e11f51b891ad8d5111a90cb2
3
+ metadata.gz: 339168811c63f630d027737c234fd6e17d8b9a43f81ee16a1a35558d189afef5
4
+ data.tar.gz: '09beb8778d4cfdcae8613bccfac21fc3fd13ec5ec5812e06f63d002f42ff245e'
5
5
  SHA512:
6
- metadata.gz: b41c5e257a7dc4edbb8f63f9bef7bb1dd24d071b62de09129c15738d6c57db4ad718e1f0c055a558c63c6d915e63b17f5cdbd777ae41cb45afc8ccae729ed211
7
- data.tar.gz: 6d4c2f3f265ae01edfc1ecd2c16e28777467af569bacc769385a7d4f9291735c40150d8af9f201696ae80c89feb8b2d1eefc180915ead8f4b07bd0e9d16f297c
6
+ metadata.gz: 1b2b3df533221c7f236a91a06aee9c09fea3763f3e3a2f1b1d5c2ab870b40a24fd87d75eae9e65e12cdfabb465c60da0998ba900d8ef9bcb8e05cb4b417ad528
7
+ data.tar.gz: 8355ed38f26005fc218a0da14df0450efa0c7d326af6d7235bfe5971ca9f6549f114327857a7b9677d8e9cb79fd00bbc7a78e9c15b2325887b888268fe6f178f
@@ -4389,11 +4389,17 @@
4389
4389
  <!-- ========================== -->
4390
4390
  <!-- Definition's list styles -->
4391
4391
  <!-- ========================== -->
4392
+
4393
+ <xsl:attribute-set name="dl-block-style">
4394
+
4395
+ </xsl:attribute-set>
4396
+
4392
4397
  <xsl:attribute-set name="dt-row-style">
4393
4398
 
4394
4399
  </xsl:attribute-set>
4395
4400
 
4396
4401
  <xsl:attribute-set name="dt-cell-style">
4402
+
4397
4403
  </xsl:attribute-set>
4398
4404
 
4399
4405
  <xsl:attribute-set name="dt-block-style">
@@ -4415,6 +4421,7 @@
4415
4421
 
4416
4422
  <xsl:attribute-set name="dd-cell-style">
4417
4423
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
4424
+
4418
4425
  </xsl:attribute-set>
4419
4426
 
4420
4427
  <!-- ========================== -->
@@ -4541,6 +4548,10 @@
4541
4548
 
4542
4549
  </xsl:attribute-set>
4543
4550
 
4551
+ <xsl:attribute-set name="figure-source-style">
4552
+
4553
+ </xsl:attribute-set>
4554
+
4544
4555
  <!-- Formula's styles -->
4545
4556
  <xsl:attribute-set name="formula-style">
4546
4557
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -5074,7 +5085,7 @@
5074
5085
 
5075
5086
  <xsl:template name="processTables_Contents">
5076
5087
  <tables>
5077
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
5088
+ <xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
5078
5089
  <table id="{@id}" alt-text="{*[local-name() = 'name']}">
5079
5090
  <xsl:copy-of select="*[local-name() = 'name']"/>
5080
5091
  </table>
@@ -5439,7 +5450,7 @@
5439
5450
  </xsl:attribute>
5440
5451
  </xsl:for-each>
5441
5452
 
5442
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
5453
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
5443
5454
  <xsl:if test="$isNoteOrFnExist = 'true'">
5444
5455
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
5445
5456
  </xsl:if>
@@ -5483,7 +5494,7 @@
5483
5494
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
5484
5495
  </xsl:when>
5485
5496
  <xsl:otherwise>
5486
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note and dl which render separaterely -->
5497
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
5487
5498
  </xsl:otherwise>
5488
5499
  </xsl:choose>
5489
5500
 
@@ -5564,6 +5575,11 @@
5564
5575
  </xsl:if>
5565
5576
  </xsl:template> <!-- table/name -->
5566
5577
 
5578
+ <!-- SOURCE: ... -->
5579
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
5580
+ <xsl:call-template name="termsource"/>
5581
+ </xsl:template>
5582
+
5567
5583
  <xsl:template name="calculate-columns-numbers">
5568
5584
  <xsl:param name="table-row"/>
5569
5585
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -5924,7 +5940,7 @@
5924
5940
  </fo:table-header>
5925
5941
  </xsl:template> <!-- thead -->
5926
5942
 
5927
- <!-- template is using for iso, jcgm, bsi only -->
5943
+ <!-- template is using for iec, iso, jcgm, bsi only -->
5928
5944
  <xsl:template name="table-header-title">
5929
5945
  <xsl:param name="cols-count"/>
5930
5946
  <!-- row for title -->
@@ -5974,7 +5990,7 @@
5974
5990
  <xsl:param name="colwidths"/>
5975
5991
  <xsl:param name="colgroup"/>
5976
5992
 
5977
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
5993
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
5978
5994
 
5979
5995
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
5980
5996
 
@@ -6044,6 +6060,7 @@
6044
6060
 
6045
6061
  <xsl:apply-templates select="../*[local-name()='dl']"/>
6046
6062
  <xsl:apply-templates select="../*[local-name()='note']"/>
6063
+ <xsl:apply-templates select="../*[local-name()='source']"/>
6047
6064
 
6048
6065
  <xsl:variable name="isDisplayRowSeparator">
6049
6066
 
@@ -6745,7 +6762,7 @@
6745
6762
  <xsl:variable name="isAdded" select="@added"/>
6746
6763
  <xsl:variable name="isDeleted" select="@deleted"/>
6747
6764
  <!-- <dl><xsl:copy-of select="."/></dl> -->
6748
- <fo:block-container>
6765
+ <fo:block-container xsl:use-attribute-sets="dl-block-style">
6749
6766
 
6750
6767
  <xsl:call-template name="setBlockSpanAll"/>
6751
6768
 
@@ -6753,6 +6770,18 @@
6753
6770
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
6754
6771
  </xsl:if>
6755
6772
 
6773
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']">
6774
+ <!-- set font-size as sourcecode font-size -->
6775
+ <xsl:variable name="sourcecode_attributes">
6776
+ <xsl:call-template name="get_sourcecode_attributes"/>
6777
+ </xsl:variable>
6778
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@font-size">
6779
+ <xsl:attribute name="{local-name()}">
6780
+ <xsl:value-of select="."/>
6781
+ </xsl:attribute>
6782
+ </xsl:for-each>
6783
+ </xsl:if>
6784
+
6756
6785
  <xsl:if test="parent::*[local-name() = 'note']">
6757
6786
  <xsl:attribute name="margin-left">
6758
6787
  <xsl:choose>
@@ -7186,6 +7215,7 @@
7186
7215
  <xsl:param name="split_keep-within-line"/>
7187
7216
 
7188
7217
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
7218
+
7189
7219
  <xsl:call-template name="insert_dt_cell">
7190
7220
  <xsl:with-param name="key_iso" select="$key_iso"/>
7191
7221
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -7207,6 +7237,7 @@
7207
7237
  <!-- border is mandatory, to calculate real width -->
7208
7238
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
7209
7239
  <xsl:attribute name="text-align">left</xsl:attribute>
7240
+
7210
7241
  </xsl:if>
7211
7242
 
7212
7243
  <fo:block xsl:use-attribute-sets="dt-block-style">
@@ -7649,6 +7680,7 @@
7649
7680
  <fo:inline>
7650
7681
  <xsl:for-each select="$styles/style">
7651
7682
  <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
7683
+
7652
7684
  </xsl:for-each>
7653
7685
  <xsl:apply-templates/>
7654
7686
  </fo:inline>
@@ -9166,6 +9198,13 @@
9166
9198
  </fo:block>
9167
9199
  </xsl:template>
9168
9200
 
9201
+ <!-- SOURCE: ... -->
9202
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
9203
+
9204
+ <xsl:call-template name="termsource"/>
9205
+
9206
+ </xsl:template>
9207
+
9169
9208
  <xsl:template match="*[local-name() = 'image']">
9170
9209
  <xsl:variable name="isAdded" select="../@added"/>
9171
9210
  <xsl:variable name="isDeleted" select="../@deleted"/>
@@ -10300,9 +10339,11 @@
10300
10339
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
10301
10340
  </xsl:if>
10302
10341
 
10303
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
10342
+ <xsl:apply-templates select="node()[not(local-name() = 'name' or local-name() = 'dl')]"/>
10304
10343
  </fo:block>
10305
10344
 
10345
+ <xsl:apply-templates select="*[local-name() = 'dl']"/> <!-- Key table -->
10346
+
10306
10347
  <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
10307
10348
 
10308
10349
  </fo:block-container>
@@ -10334,11 +10375,22 @@
10334
10375
  <!-- add sourcecode highlighting -->
10335
10376
  <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
10336
10377
  <xsl:variable name="class" select="@class"/>
10378
+
10379
+ <!-- Example: <1> -->
10380
+ <xsl:variable name="is_callout">
10381
+ <xsl:if test="parent::*[local-name() = 'dt']">
10382
+ <xsl:variable name="dt_id" select="../@id"/>
10383
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']//*[local-name() = 'callout'][@target = $dt_id]">true</xsl:if>
10384
+ </xsl:if>
10385
+ </xsl:variable>
10386
+
10337
10387
  <xsl:choose>
10338
10388
  <xsl:when test="$sourcecode_css//class[@name = $class]">
10339
10389
  <fo:inline>
10340
10390
  <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
10391
+ <xsl:if test="$is_callout = 'true'">&lt;</xsl:if>
10341
10392
  <xsl:apply-templates/>
10393
+ <xsl:if test="$is_callout = 'true'">&gt;</xsl:if>
10342
10394
  </fo:inline>
10343
10395
  </xsl:when>
10344
10396
  <xsl:otherwise>
@@ -10762,6 +10814,10 @@
10762
10814
  </fo:block>
10763
10815
  </xsl:template>
10764
10816
 
10817
+ <xsl:template match="*[local-name() = 'div']">
10818
+ <fo:block><xsl:apply-templates/></fo:block>
10819
+ </xsl:template>
10820
+
10765
10821
  <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit'] | *[local-name() = 'div'][@type = 'requirement-inherit'] | *[local-name() = 'div'][@type = 'recommendation-inherit'] | *[local-name() = 'div'][@type = 'permission-inherit']">
10766
10822
  <fo:block xsl:use-attribute-sets="inherit-style">
10767
10823
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
@@ -11464,13 +11520,8 @@
11464
11520
  </xsl:template>
11465
11521
 
11466
11522
  <xsl:template match="*[local-name() = 'deprecates']">
11467
- <xsl:variable name="title-deprecated">
11468
- <xsl:call-template name="getLocalizedString">
11469
- <xsl:with-param name="key">deprecated</xsl:with-param>
11470
- </xsl:call-template>
11471
- </xsl:variable>
11472
11523
  <fo:block xsl:use-attribute-sets="deprecates-style">
11473
- <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
11524
+ <xsl:apply-templates/>
11474
11525
  </fo:block>
11475
11526
  </xsl:template>
11476
11527
 
@@ -12747,6 +12798,23 @@
12747
12798
  <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
12748
12799
  <xsl:copy-of select="."/>
12749
12800
  </xsl:template>
12801
+
12802
+ <!-- add @id, redundant for table auto-layout algorithm -->
12803
+ <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
12804
+ <xsl:copy>
12805
+ <xsl:copy-of select="@*"/>
12806
+ <xsl:call-template name="add_id"/>
12807
+ <xsl:apply-templates mode="update_xml_step1"/>
12808
+ </xsl:copy>
12809
+ </xsl:template>
12810
+
12811
+ <xsl:template name="add_id">
12812
+ <xsl:if test="not(@id)">
12813
+ <!-- add @id - first element with @id plus '_element_name' -->
12814
+ <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
12815
+ </xsl:if>
12816
+ </xsl:template>
12817
+
12750
12818
  <!-- =========================================================================== -->
12751
12819
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
12752
12820
  <!-- =========================================================================== -->
@@ -4389,11 +4389,17 @@
4389
4389
  <!-- ========================== -->
4390
4390
  <!-- Definition's list styles -->
4391
4391
  <!-- ========================== -->
4392
+
4393
+ <xsl:attribute-set name="dl-block-style">
4394
+
4395
+ </xsl:attribute-set>
4396
+
4392
4397
  <xsl:attribute-set name="dt-row-style">
4393
4398
 
4394
4399
  </xsl:attribute-set>
4395
4400
 
4396
4401
  <xsl:attribute-set name="dt-cell-style">
4402
+
4397
4403
  </xsl:attribute-set>
4398
4404
 
4399
4405
  <xsl:attribute-set name="dt-block-style">
@@ -4415,6 +4421,7 @@
4415
4421
 
4416
4422
  <xsl:attribute-set name="dd-cell-style">
4417
4423
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
4424
+
4418
4425
  </xsl:attribute-set>
4419
4426
 
4420
4427
  <!-- ========================== -->
@@ -4541,6 +4548,10 @@
4541
4548
 
4542
4549
  </xsl:attribute-set>
4543
4550
 
4551
+ <xsl:attribute-set name="figure-source-style">
4552
+
4553
+ </xsl:attribute-set>
4554
+
4544
4555
  <!-- Formula's styles -->
4545
4556
  <xsl:attribute-set name="formula-style">
4546
4557
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -5074,7 +5085,7 @@
5074
5085
 
5075
5086
  <xsl:template name="processTables_Contents">
5076
5087
  <tables>
5077
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
5088
+ <xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
5078
5089
  <table id="{@id}" alt-text="{*[local-name() = 'name']}">
5079
5090
  <xsl:copy-of select="*[local-name() = 'name']"/>
5080
5091
  </table>
@@ -5439,7 +5450,7 @@
5439
5450
  </xsl:attribute>
5440
5451
  </xsl:for-each>
5441
5452
 
5442
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
5453
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
5443
5454
  <xsl:if test="$isNoteOrFnExist = 'true'">
5444
5455
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
5445
5456
  </xsl:if>
@@ -5483,7 +5494,7 @@
5483
5494
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
5484
5495
  </xsl:when>
5485
5496
  <xsl:otherwise>
5486
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note and dl which render separaterely -->
5497
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
5487
5498
  </xsl:otherwise>
5488
5499
  </xsl:choose>
5489
5500
 
@@ -5564,6 +5575,11 @@
5564
5575
  </xsl:if>
5565
5576
  </xsl:template> <!-- table/name -->
5566
5577
 
5578
+ <!-- SOURCE: ... -->
5579
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
5580
+ <xsl:call-template name="termsource"/>
5581
+ </xsl:template>
5582
+
5567
5583
  <xsl:template name="calculate-columns-numbers">
5568
5584
  <xsl:param name="table-row"/>
5569
5585
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -5924,7 +5940,7 @@
5924
5940
  </fo:table-header>
5925
5941
  </xsl:template> <!-- thead -->
5926
5942
 
5927
- <!-- template is using for iso, jcgm, bsi only -->
5943
+ <!-- template is using for iec, iso, jcgm, bsi only -->
5928
5944
  <xsl:template name="table-header-title">
5929
5945
  <xsl:param name="cols-count"/>
5930
5946
  <!-- row for title -->
@@ -5974,7 +5990,7 @@
5974
5990
  <xsl:param name="colwidths"/>
5975
5991
  <xsl:param name="colgroup"/>
5976
5992
 
5977
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
5993
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
5978
5994
 
5979
5995
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
5980
5996
 
@@ -6044,6 +6060,7 @@
6044
6060
 
6045
6061
  <xsl:apply-templates select="../*[local-name()='dl']"/>
6046
6062
  <xsl:apply-templates select="../*[local-name()='note']"/>
6063
+ <xsl:apply-templates select="../*[local-name()='source']"/>
6047
6064
 
6048
6065
  <xsl:variable name="isDisplayRowSeparator">
6049
6066
 
@@ -6745,7 +6762,7 @@
6745
6762
  <xsl:variable name="isAdded" select="@added"/>
6746
6763
  <xsl:variable name="isDeleted" select="@deleted"/>
6747
6764
  <!-- <dl><xsl:copy-of select="."/></dl> -->
6748
- <fo:block-container>
6765
+ <fo:block-container xsl:use-attribute-sets="dl-block-style">
6749
6766
 
6750
6767
  <xsl:call-template name="setBlockSpanAll"/>
6751
6768
 
@@ -6753,6 +6770,18 @@
6753
6770
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
6754
6771
  </xsl:if>
6755
6772
 
6773
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']">
6774
+ <!-- set font-size as sourcecode font-size -->
6775
+ <xsl:variable name="sourcecode_attributes">
6776
+ <xsl:call-template name="get_sourcecode_attributes"/>
6777
+ </xsl:variable>
6778
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@font-size">
6779
+ <xsl:attribute name="{local-name()}">
6780
+ <xsl:value-of select="."/>
6781
+ </xsl:attribute>
6782
+ </xsl:for-each>
6783
+ </xsl:if>
6784
+
6756
6785
  <xsl:if test="parent::*[local-name() = 'note']">
6757
6786
  <xsl:attribute name="margin-left">
6758
6787
  <xsl:choose>
@@ -7186,6 +7215,7 @@
7186
7215
  <xsl:param name="split_keep-within-line"/>
7187
7216
 
7188
7217
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
7218
+
7189
7219
  <xsl:call-template name="insert_dt_cell">
7190
7220
  <xsl:with-param name="key_iso" select="$key_iso"/>
7191
7221
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -7207,6 +7237,7 @@
7207
7237
  <!-- border is mandatory, to calculate real width -->
7208
7238
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
7209
7239
  <xsl:attribute name="text-align">left</xsl:attribute>
7240
+
7210
7241
  </xsl:if>
7211
7242
 
7212
7243
  <fo:block xsl:use-attribute-sets="dt-block-style">
@@ -7649,6 +7680,7 @@
7649
7680
  <fo:inline>
7650
7681
  <xsl:for-each select="$styles/style">
7651
7682
  <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
7683
+
7652
7684
  </xsl:for-each>
7653
7685
  <xsl:apply-templates/>
7654
7686
  </fo:inline>
@@ -9166,6 +9198,13 @@
9166
9198
  </fo:block>
9167
9199
  </xsl:template>
9168
9200
 
9201
+ <!-- SOURCE: ... -->
9202
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
9203
+
9204
+ <xsl:call-template name="termsource"/>
9205
+
9206
+ </xsl:template>
9207
+
9169
9208
  <xsl:template match="*[local-name() = 'image']">
9170
9209
  <xsl:variable name="isAdded" select="../@added"/>
9171
9210
  <xsl:variable name="isDeleted" select="../@deleted"/>
@@ -10300,9 +10339,11 @@
10300
10339
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
10301
10340
  </xsl:if>
10302
10341
 
10303
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
10342
+ <xsl:apply-templates select="node()[not(local-name() = 'name' or local-name() = 'dl')]"/>
10304
10343
  </fo:block>
10305
10344
 
10345
+ <xsl:apply-templates select="*[local-name() = 'dl']"/> <!-- Key table -->
10346
+
10306
10347
  <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
10307
10348
 
10308
10349
  </fo:block-container>
@@ -10334,11 +10375,22 @@
10334
10375
  <!-- add sourcecode highlighting -->
10335
10376
  <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
10336
10377
  <xsl:variable name="class" select="@class"/>
10378
+
10379
+ <!-- Example: <1> -->
10380
+ <xsl:variable name="is_callout">
10381
+ <xsl:if test="parent::*[local-name() = 'dt']">
10382
+ <xsl:variable name="dt_id" select="../@id"/>
10383
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']//*[local-name() = 'callout'][@target = $dt_id]">true</xsl:if>
10384
+ </xsl:if>
10385
+ </xsl:variable>
10386
+
10337
10387
  <xsl:choose>
10338
10388
  <xsl:when test="$sourcecode_css//class[@name = $class]">
10339
10389
  <fo:inline>
10340
10390
  <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
10391
+ <xsl:if test="$is_callout = 'true'">&lt;</xsl:if>
10341
10392
  <xsl:apply-templates/>
10393
+ <xsl:if test="$is_callout = 'true'">&gt;</xsl:if>
10342
10394
  </fo:inline>
10343
10395
  </xsl:when>
10344
10396
  <xsl:otherwise>
@@ -10762,6 +10814,10 @@
10762
10814
  </fo:block>
10763
10815
  </xsl:template>
10764
10816
 
10817
+ <xsl:template match="*[local-name() = 'div']">
10818
+ <fo:block><xsl:apply-templates/></fo:block>
10819
+ </xsl:template>
10820
+
10765
10821
  <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit'] | *[local-name() = 'div'][@type = 'requirement-inherit'] | *[local-name() = 'div'][@type = 'recommendation-inherit'] | *[local-name() = 'div'][@type = 'permission-inherit']">
10766
10822
  <fo:block xsl:use-attribute-sets="inherit-style">
10767
10823
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
@@ -11464,13 +11520,8 @@
11464
11520
  </xsl:template>
11465
11521
 
11466
11522
  <xsl:template match="*[local-name() = 'deprecates']">
11467
- <xsl:variable name="title-deprecated">
11468
- <xsl:call-template name="getLocalizedString">
11469
- <xsl:with-param name="key">deprecated</xsl:with-param>
11470
- </xsl:call-template>
11471
- </xsl:variable>
11472
11523
  <fo:block xsl:use-attribute-sets="deprecates-style">
11473
- <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
11524
+ <xsl:apply-templates/>
11474
11525
  </fo:block>
11475
11526
  </xsl:template>
11476
11527
 
@@ -12747,6 +12798,23 @@
12747
12798
  <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
12748
12799
  <xsl:copy-of select="."/>
12749
12800
  </xsl:template>
12801
+
12802
+ <!-- add @id, redundant for table auto-layout algorithm -->
12803
+ <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
12804
+ <xsl:copy>
12805
+ <xsl:copy-of select="@*"/>
12806
+ <xsl:call-template name="add_id"/>
12807
+ <xsl:apply-templates mode="update_xml_step1"/>
12808
+ </xsl:copy>
12809
+ </xsl:template>
12810
+
12811
+ <xsl:template name="add_id">
12812
+ <xsl:if test="not(@id)">
12813
+ <!-- add @id - first element with @id plus '_element_name' -->
12814
+ <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
12815
+ </xsl:if>
12816
+ </xsl:template>
12817
+
12750
12818
  <!-- =========================================================================== -->
12751
12819
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
12752
12820
  <!-- =========================================================================== -->
@@ -382,6 +382,9 @@
382
382
  <optional>
383
383
  <ref name="dl"/>
384
384
  </optional>
385
+ <optional>
386
+ <ref name="source"/>
387
+ </optional>
385
388
  </element>
386
389
  </define>
387
390
  <define name="figure">
@@ -404,9 +407,6 @@
404
407
  <attribute name="class"/>
405
408
  </optional>
406
409
  <ref name="BlockAttributes"/>
407
- <optional>
408
- <ref name="source"/>
409
- </optional>
410
410
  <optional>
411
411
  <ref name="tname"/>
412
412
  </optional>
@@ -431,6 +431,20 @@
431
431
  <zeroOrMore>
432
432
  <ref name="note"/>
433
433
  </zeroOrMore>
434
+ <optional>
435
+ <ref name="source"/>
436
+ </optional>
437
+ </element>
438
+ </define>
439
+ <define name="source">
440
+ <element name="source">
441
+ <attribute name="status">
442
+ <ref name="SourceStatusType"/>
443
+ </attribute>
444
+ <ref name="origin"/>
445
+ <optional>
446
+ <ref name="modification"/>
447
+ </optional>
434
448
  </element>
435
449
  </define>
436
450
  <define name="sourcecode">
@@ -2099,10 +2113,7 @@
2099
2113
  <define name="termsource">
2100
2114
  <element name="termsource">
2101
2115
  <attribute name="status">
2102
- <choice>
2103
- <value>identical</value>
2104
- <value>modified</value>
2105
- </choice>
2116
+ <ref name="SourceStatusType"/>
2106
2117
  </attribute>
2107
2118
  <attribute name="type">
2108
2119
  <choice>
@@ -2116,6 +2127,17 @@
2116
2127
  </optional>
2117
2128
  </element>
2118
2129
  </define>
2130
+ <define name="SourceStatusType">
2131
+ <choice>
2132
+ <value>identical</value>
2133
+ <value>modified</value>
2134
+ <value>restyled</value>
2135
+ <value>context-added</value>
2136
+ <value>generalisation</value>
2137
+ <value>specialisation</value>
2138
+ <value>unspecified</value>
2139
+ </choice>
2140
+ </define>
2119
2141
  <define name="origin">
2120
2142
  <element name="origin">
2121
2143
  <choice>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IEEE
3
- VERSION = "1.0.8".freeze
3
+ VERSION = "1.0.9".freeze
4
4
  end
5
5
  end
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
- spec.add_dependency "metanorma-standoc", "~> 2.4.0"
28
+ spec.add_dependency "metanorma-standoc", "~> 2.4.2"
29
29
  spec.add_dependency "mnconvert", "~> 1.20"
30
30
 
31
31
  spec.add_development_dependency "debug"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
11
+ date: 2023-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.4.0
19
+ version: 2.4.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.4.0
26
+ version: 2.4.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mnconvert
29
29
  requirement: !ruby/object:Gem::Requirement