metanorma-iec 1.3.11 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2223,7 +2223,7 @@
2223
2223
  </xsl:variable>
2224
2224
  <fo:block line-height="1.1" space-before="14pt" role="H{$levelTerm}">
2225
2225
  <fo:block font-weight="bold" keep-with-next="always">
2226
- <xsl:apply-templates select="ancestor::iec:term/iec:name" mode="presentation"/>
2226
+ <xsl:apply-templates select="ancestor::iec:term[1]/iec:name" mode="presentation"/>
2227
2227
  </fo:block>
2228
2228
  <fo:block font-weight="bold" keep-with-next="always">
2229
2229
  <xsl:apply-templates/>
@@ -2597,6 +2597,8 @@
2597
2597
 
2598
2598
  <title-list-figures lang="en">List of Figures</title-list-figures>
2599
2599
 
2600
+ <title-table-figures lang="en">Table of Figures</title-table-figures>
2601
+
2600
2602
  <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
2601
2603
 
2602
2604
  <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
@@ -2873,6 +2875,11 @@
2873
2875
 
2874
2876
 
2875
2877
 
2878
+ </xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
2879
+
2880
+
2881
+
2882
+
2876
2883
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
2877
2884
 
2878
2885
 
@@ -3049,13 +3056,20 @@
3049
3056
 
3050
3057
  </xsl:attribute-set><xsl:attribute-set name="list-style">
3051
3058
 
3052
- </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
3059
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
3060
+ <xsl:attribute name="line-height">135%</xsl:attribute>
3061
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
3053
3062
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
3054
3063
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
3055
3064
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
3056
3065
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
3057
3066
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
3058
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
3067
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
3068
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
3069
+ <xsl:sort select="@displayorder" data-type="number"/>
3070
+ <xsl:apply-templates select="." mode="contents"/>
3071
+ </xsl:for-each>
3072
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
3059
3073
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
3060
3074
 
3061
3075
  <!-- Normative references -->
@@ -3068,13 +3082,33 @@
3068
3082
  <!-- Bibliography -->
3069
3083
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
3070
3084
 
3071
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
3085
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
3086
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
3087
+ <xsl:sort select="@displayorder" data-type="number"/>
3088
+ <xsl:apply-templates select="." mode="contents"/>
3089
+ </xsl:for-each>
3090
+
3091
+ <xsl:for-each select="/*/*[local-name()='annex']">
3092
+ <xsl:sort select="@displayorder" data-type="number"/>
3093
+ <xsl:apply-templates select="." mode="contents"/>
3094
+ </xsl:for-each>
3095
+
3096
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
3097
+ <xsl:sort select="@displayorder" data-type="number"/>
3098
+ <xsl:apply-templates select="." mode="contents"/>
3099
+ </xsl:for-each>
3100
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
3072
3101
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
3073
3102
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
3074
3103
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
3075
3104
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
3076
3105
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
3077
- </xsl:template><xsl:template name="processMainSectionsDefault">
3106
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
3107
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
3108
+ <xsl:sort select="@displayorder" data-type="number"/>
3109
+ <xsl:apply-templates select="."/>
3110
+ </xsl:for-each>
3111
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
3078
3112
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
3079
3113
 
3080
3114
  <!-- Normative references -->
@@ -3086,6 +3120,22 @@
3086
3120
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
3087
3121
  <!-- Bibliography -->
3088
3122
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
3123
+ </xsl:template><xsl:template name="processMainSectionsDefault">
3124
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
3125
+ <xsl:sort select="@displayorder" data-type="number"/>
3126
+ <xsl:apply-templates select="."/>
3127
+
3128
+ </xsl:for-each>
3129
+
3130
+ <xsl:for-each select="/*/*[local-name()='annex']">
3131
+ <xsl:sort select="@displayorder" data-type="number"/>
3132
+ <xsl:apply-templates select="."/>
3133
+ </xsl:for-each>
3134
+
3135
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
3136
+ <xsl:sort select="@displayorder" data-type="number"/>
3137
+ <xsl:apply-templates select="."/>
3138
+ </xsl:for-each>
3089
3139
  </xsl:template><xsl:template match="text()">
3090
3140
  <xsl:value-of select="."/>
3091
3141
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -3980,9 +4030,8 @@
3980
4030
 
3981
4031
  <!-- Table's note name (NOTE, for example) -->
3982
4032
 
3983
- <fo:inline padding-right="2mm">
4033
+ <fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
3984
4034
 
3985
-
3986
4035
 
3987
4036
 
3988
4037
 
@@ -4526,6 +4575,7 @@
4526
4575
  <fo:table-cell>
4527
4576
 
4528
4577
  <fo:block margin-top="6pt">
4578
+ <xsl:copy-of select="@id"/>
4529
4579
 
4530
4580
 
4531
4581
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -4633,6 +4683,8 @@
4633
4683
  <xsl:if test="$font-size != ''">
4634
4684
  <xsl:attribute name="font-size">
4635
4685
  <xsl:choose>
4686
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4687
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4636
4688
  <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4637
4689
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4638
4690
  </xsl:choose>
@@ -5369,14 +5421,18 @@
5369
5421
  </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
5370
5422
  <fo:inline><xsl:apply-templates/></fo:inline>
5371
5423
  </xsl:template><xsl:template match="*[local-name() = 'terms']">
5424
+ <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
5372
5425
  <fo:block id="{@id}">
5373
5426
  <xsl:apply-templates/>
5374
5427
  </fo:block>
5375
5428
  </xsl:template><xsl:template match="*[local-name() = 'term']">
5429
+ <!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
5376
5430
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
5377
5431
 
5378
5432
 
5379
-
5433
+ <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
5434
+
5435
+ </xsl:if>
5380
5436
  <xsl:apply-templates/>
5381
5437
  </fo:block>
5382
5438
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
@@ -5438,6 +5494,7 @@
5438
5494
  <xsl:otherwise>
5439
5495
  <fo:block xsl:use-attribute-sets="image-style">
5440
5496
 
5497
+
5441
5498
  <xsl:variable name="src">
5442
5499
  <xsl:call-template name="image_src"/>
5443
5500
  </xsl:variable>
@@ -5685,6 +5742,13 @@
5685
5742
  </xsl:attribute>
5686
5743
  <xsl:apply-templates mode="svg_update"/>
5687
5744
  </xsl:copy>
5745
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
5746
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
5747
+ <xsl:for-each select="*[local-name() = 'svg']">
5748
+ <xsl:call-template name="image_svg">
5749
+ <xsl:with-param name="name" select="$name"/>
5750
+ </xsl:call-template>
5751
+ </xsl:for-each>
5688
5752
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
5689
5753
  <xsl:variable name="svg_content" select="document(@src)"/>
5690
5754
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -5789,7 +5853,7 @@
5789
5853
  </fo:basic-link>
5790
5854
  </fo:block>
5791
5855
  </fo:block-container>
5792
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
5856
+ </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
5793
5857
  <xsl:apply-templates mode="contents"/>
5794
5858
  <xsl:text> </xsl:text>
5795
5859
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
@@ -5797,7 +5861,7 @@
5797
5861
  <xsl:text> </xsl:text>
5798
5862
  </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
5799
5863
  <xsl:value-of select="."/>
5800
- </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
5864
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
5801
5865
  <xsl:value-of select="."/>
5802
5866
  </xsl:template><xsl:template match="node()" mode="contents">
5803
5867
  <xsl:apply-templates mode="contents"/>
@@ -5895,6 +5959,8 @@
5895
5959
 
5896
5960
 
5897
5961
 
5962
+
5963
+
5898
5964
  </fo:bookmark-tree>
5899
5965
  </xsl:if>
5900
5966
  </xsl:template><xsl:template name="insertFigureBookmarks">
@@ -6088,12 +6154,16 @@
6088
6154
  <xsl:if test="$font-size != ''">
6089
6155
  <xsl:attribute name="font-size">
6090
6156
  <xsl:choose>
6157
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
6158
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
6091
6159
  <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
6092
6160
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
6093
6161
  </xsl:choose>
6094
6162
  </xsl:attribute>
6095
6163
  </xsl:if>
6096
6164
 
6165
+
6166
+
6097
6167
  <xsl:apply-templates/>
6098
6168
  </fo:block>
6099
6169
 
@@ -6336,7 +6406,8 @@
6336
6406
  </fo:block>
6337
6407
  </fo:table-cell>
6338
6408
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
6339
- <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
6409
+ <fo:block font-size="11pt">
6410
+
6340
6411
  <xsl:apply-templates/>
6341
6412
  </fo:block>
6342
6413
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
@@ -6441,6 +6512,7 @@
6441
6512
  </xsl:choose>
6442
6513
  </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
6443
6514
  <fo:block xsl:use-attribute-sets="termsource-style">
6515
+
6444
6516
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
6445
6517
  <xsl:variable name="termsource_text">
6446
6518
  <xsl:apply-templates/>
@@ -6451,13 +6523,15 @@
6451
6523
  <!-- <xsl:apply-templates /> -->
6452
6524
  <xsl:copy-of select="$termsource_text"/>
6453
6525
  </xsl:when>
6454
- <xsl:otherwise>
6526
+ <xsl:otherwise>
6527
+
6455
6528
 
6456
6529
  <xsl:text>[</xsl:text>
6457
6530
 
6458
6531
  <!-- <xsl:apply-templates /> -->
6459
6532
  <xsl:copy-of select="$termsource_text"/>
6460
6533
 
6534
+
6461
6535
  <xsl:text>]</xsl:text>
6462
6536
 
6463
6537
  </xsl:otherwise>
@@ -6469,14 +6543,15 @@
6469
6543
  </xsl:if>
6470
6544
  </xsl:template><xsl:variable name="localized.source">
6471
6545
  <xsl:call-template name="getLocalizedString">
6472
- <xsl:with-param name="key">source</xsl:with-param>
6473
- </xsl:call-template>
6546
+ <xsl:with-param name="key">source</xsl:with-param>
6547
+ </xsl:call-template>
6474
6548
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
6475
6549
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6476
6550
  <xsl:if test="normalize-space(@citeas) = ''">
6477
6551
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
6478
6552
  </xsl:if>
6479
6553
 
6554
+
6480
6555
  <fo:inline>
6481
6556
 
6482
6557
 
@@ -6484,6 +6559,7 @@
6484
6559
 
6485
6560
 
6486
6561
 
6562
+
6487
6563
  <xsl:call-template name="getTitle">
6488
6564
  <xsl:with-param name="name" select="'title-source'"/>
6489
6565
  </xsl:call-template>
@@ -6495,6 +6571,7 @@
6495
6571
  <fo:inline xsl:use-attribute-sets="origin-style">
6496
6572
  <xsl:apply-templates/>
6497
6573
  </fo:inline>
6574
+
6498
6575
  </fo:basic-link>
6499
6576
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
6500
6577
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -6538,12 +6615,20 @@
6538
6615
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6539
6616
  <xsl:text>— </xsl:text>
6540
6617
  <xsl:apply-templates/>
6541
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
6618
+ </xsl:template><xsl:variable name="bibitem_hidden_">
6619
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6620
+ <xsl:copy-of select="."/>
6621
+ </xsl:for-each>
6622
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
6623
+ <xsl:copy-of select="."/>
6624
+ </xsl:for-each>
6625
+ </xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6542
6626
 
6543
6627
  <xsl:variable name="bibitemid">
6544
6628
  <xsl:choose>
6545
- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
6546
- <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6629
+ <!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
6630
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
6631
+ <xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6547
6632
  <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
6548
6633
  </xsl:choose>
6549
6634
  </xsl:variable>
@@ -6561,6 +6646,9 @@
6561
6646
 
6562
6647
  </xsl:if>
6563
6648
 
6649
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
6650
+ <xsl:variable name="text" select="normalize-space()"/>
6651
+
6564
6652
 
6565
6653
 
6566
6654
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -6573,7 +6661,9 @@
6573
6661
 
6574
6662
 
6575
6663
  </xsl:if>
6576
-
6664
+
6665
+
6666
+
6577
6667
  <xsl:apply-templates/>
6578
6668
  </fo:basic-link>
6579
6669
 
@@ -6629,10 +6719,10 @@
6629
6719
  </xsl:choose>
6630
6720
  </xsl:variable>
6631
6721
 
6632
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
6722
+ <!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
6633
6723
 
6634
6724
  <xsl:choose>
6635
- <xsl:when test="$language = 'zh'">
6725
+ <xsl:when test="$lang = 'zh'">
6636
6726
  <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
6637
6727
  </xsl:when>
6638
6728
  <xsl:when test="../../@inline-header = 'true'">
@@ -7077,9 +7167,97 @@
7077
7167
  <fo:block-container border="1pt solid black" width="50%">
7078
7168
  <fo:block> </fo:block>
7079
7169
  </fo:block-container>
7170
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
7171
+ <xsl:param name="colwidths"/>
7172
+ <xsl:variable name="colwidths_">
7173
+ <xsl:choose>
7174
+ <xsl:when test="not($colwidths)">
7175
+ <xsl:variable name="toc_table_simple">
7176
+ <tbody>
7177
+ <xsl:apply-templates mode="toc_table_width"/>
7178
+ </tbody>
7179
+ </xsl:variable>
7180
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
7181
+ <xsl:call-template name="calculate-column-widths">
7182
+ <xsl:with-param name="cols-count" select="$cols-count"/>
7183
+ <xsl:with-param name="table" select="$toc_table_simple"/>
7184
+ </xsl:call-template>
7185
+ </xsl:when>
7186
+ <xsl:otherwise>
7187
+ <xsl:copy-of select="$colwidths"/>
7188
+ </xsl:otherwise>
7189
+ </xsl:choose>
7190
+ </xsl:variable>
7191
+ <fo:block role="TOCI" space-after="16pt">
7192
+ <fo:table width="100%" table-layout="fixed">
7193
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
7194
+ <fo:table-column column-width="proportional-column-width({.})"/>
7195
+ </xsl:for-each>
7196
+ <fo:table-body>
7197
+ <xsl:apply-templates/>
7198
+ </fo:table-body>
7199
+ </fo:table>
7200
+ </fo:block>
7201
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
7202
+ <fo:table-row min-height="5mm">
7203
+ <xsl:apply-templates/>
7204
+ </fo:table-row>
7205
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
7206
+ <xsl:apply-templates/>
7207
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
7208
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
7209
+ <xsl:variable name="target" select="@target"/>
7210
+ <xsl:for-each select="*[local-name() = 'tab']">
7211
+ <xsl:variable name="current_id" select="generate-id()"/>
7212
+ <fo:table-cell>
7213
+ <fo:block>
7214
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
7215
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
7216
+ <xsl:choose>
7217
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
7218
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
7219
+ </xsl:choose>
7220
+ </xsl:for-each>
7221
+ </fo:basic-link>
7222
+ </fo:block>
7223
+ </fo:table-cell>
7224
+ </xsl:for-each>
7225
+ <!-- last column - for page numbers -->
7226
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
7227
+ <fo:block>
7228
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
7229
+ <fo:page-number-citation ref-id="{$target}"/>
7230
+ </fo:basic-link>
7231
+ </fo:block>
7232
+ </fo:table-cell>
7233
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
7234
+ <xsl:apply-templates mode="toc_table_width"/>
7235
+ </xsl:template><xsl:template match="*[local-name() = 'clause'][@type = 'toc']/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'clause'][not(@type = 'toc')]/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'li']" mode="toc_table_width">
7236
+ <tr>
7237
+ <xsl:apply-templates mode="toc_table_width"/>
7238
+ </tr>
7239
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
7240
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
7241
+ <xsl:for-each select="*[local-name() = 'tab']">
7242
+ <xsl:variable name="current_id" select="generate-id()"/>
7243
+ <td>
7244
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
7245
+ <xsl:copy-of select="."/>
7246
+ </xsl:for-each>
7247
+ </td>
7248
+ </xsl:for-each>
7249
+ <td>333</td> <!-- page number, just for fill -->
7080
7250
  </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
7081
7251
  <fo:inline padding-right="5mm"> </fo:inline>
7082
7252
  <fo:inline><xsl:apply-templates/></fo:inline>
7253
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
7254
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
7255
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
7256
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
7257
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
7258
+ </svg>
7259
+ </fo:instream-foreign-object>
7260
+ </fo:inline>
7083
7261
  </xsl:template><xsl:template name="convertDate">
7084
7262
  <xsl:param name="date"/>
7085
7263
  <xsl:param name="format" select="'short'"/>
@@ -215,7 +215,7 @@ module IsoDoc
215
215
 
216
216
  def para_class(_node)
217
217
  classtype = nil
218
- classtype = "MsoCommentText" if in_comment
218
+ classtype = "MsoCommentText" if @in_comment
219
219
  classtype = "Sourcecode" if @annotation
220
220
  classtype
221
221
  end
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.3.11".freeze
3
+ VERSION = "1.4.1".freeze
4
4
  end
5
5
  end
6
6
 
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
29
29
 
30
- spec.add_dependency "metanorma-iso", "~> 1.9.0"
30
+ spec.add_dependency "metanorma-iso", "~> 1.10.0"
31
31
  spec.add_dependency "ruby-jing"
32
32
 
33
33
  spec.add_development_dependency "byebug"
@@ -1,8 +1,6 @@
1
1
  require "spec_helper"
2
2
  require "fileutils"
3
3
 
4
- OPTIONS = [backend: :iec, header_footer: true].freeze
5
-
6
4
  RSpec.describe Asciidoctor::Iec do
7
5
  before(:all) do
8
6
  @blank_hdr = blank_hdr_gen
@@ -133,7 +133,7 @@ RSpec.describe Asciidoctor::Iec do
133
133
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
134
134
  #{TERMS_BOILERPLATE}
135
135
  <term id="term-term1">
136
- <preferred>Term1</preferred>
136
+ <preferred><expression><name>Term1</name></expression></preferred>
137
137
  <termnote id="_">
138
138
  <p id="_">This is a note</p>
139
139
  </termnote>
@@ -255,7 +255,7 @@ RSpec.describe Asciidoctor::Iec do
255
255
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
256
256
  #{TERMS_BOILERPLATE}
257
257
  <term id="term-term1">
258
- <preferred>Term1</preferred>
258
+ <preferred><expression><name>Term1</name></expression></preferred>
259
259
  <termexample id="_">
260
260
  <p id="_">This is an example</p>
261
261
  </termexample>
@@ -467,77 +467,4 @@ RSpec.describe Asciidoctor::Iec do
467
467
  expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
468
468
  .to be_equivalent_to xmlpp(output)
469
469
  end
470
-
471
- it "processes unmodified term sources" do
472
- input = <<~INPUT
473
- #{ASCIIDOC_BLANK_HDR}
474
- == Terms and Definitions
475
-
476
- === Term1
477
-
478
- [.source]
479
- <<ISO2191,section=1>>
480
- INPUT
481
- output = <<~OUTPUT
482
- #{@blank_hdr}
483
- <sections>
484
- <terms id="_" obligation="normative">
485
- <title>Terms and definitions</title>
486
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
487
- #{TERMS_BOILERPLATE}
488
- <term id="term-term1">
489
- <preferred>Term1</preferred>
490
- <termsource status="identical">
491
- <origin bibitemid="ISO2191" type="inline" citeas="">
492
- <localityStack>
493
- <locality type="section"><referenceFrom>1</referenceFrom></locality>
494
- </localityStack>
495
- </origin>
496
- </termsource>
497
- </term>
498
- </terms>
499
- </sections>
500
- </iec-standard>
501
- OUTPUT
502
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
503
- .to be_equivalent_to xmlpp(output)
504
- end
505
-
506
- it "processes modified term sources" do
507
- input = <<~INPUT
508
- #{ASCIIDOC_BLANK_HDR}
509
- == Terms and Definitions
510
-
511
- === Term1
512
-
513
- [.source]
514
- <<ISO2191,section=1>>, with adjustments
515
- INPUT
516
- output = <<~OUTPUT
517
- #{@blank_hdr}
518
- <sections>
519
- <terms id="_" obligation="normative">
520
- <title>Terms and definitions</title>
521
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
522
- #{TERMS_BOILERPLATE}
523
- <term id="term-term1">
524
- <preferred>Term1</preferred>
525
- <termsource status="modified">
526
- <origin bibitemid="ISO2191" type="inline" citeas="">
527
- <localityStack>
528
- <locality type="section"><referenceFrom>1</referenceFrom></locality>
529
- </localityStack>
530
- </origin>
531
- <modification>
532
- <p id="_">with adjustments</p>
533
- </modification>
534
- </termsource>
535
- </term>
536
- </terms>
537
- </sections>
538
- </iec-standard>
539
- OUTPUT
540
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
541
- .to be_equivalent_to xmlpp(output)
542
- end
543
470
  end