metanorma-itu 1.4.0 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1768,9 +1768,10 @@
1768
1768
  <xsl:otherwise>5mm</xsl:otherwise>
1769
1769
  </xsl:choose>
1770
1770
  </xsl:attribute>
1771
- <xsl:apply-templates select="ancestor::itu:term/itu:name" mode="presentation"/>
1771
+ <xsl:apply-templates select="ancestor::itu:term[1]/itu:name" mode="presentation"/>
1772
1772
  </fo:inline>
1773
1773
  <fo:inline font-weight="bold">
1774
+ <xsl:call-template name="setStyle_preferred"/>
1774
1775
  <xsl:apply-templates/>
1775
1776
  </fo:inline>
1776
1777
  <xsl:if test="../itu:termsource/itu:origin">
@@ -2922,7 +2923,8 @@
2922
2923
  <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"/>
2923
2924
 
2924
2925
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2925
- <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2926
+
2927
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
2926
2928
  <xsl:sort select="@displayorder" data-type="number"/>
2927
2929
  <xsl:apply-templates select="." mode="contents"/>
2928
2930
  </xsl:for-each>
@@ -2932,7 +2934,7 @@
2932
2934
  <xsl:apply-templates select="." mode="contents"/>
2933
2935
  </xsl:for-each>
2934
2936
 
2935
- <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2937
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2936
2938
  <xsl:sort select="@displayorder" data-type="number"/>
2937
2939
  <xsl:apply-templates select="." mode="contents"/>
2938
2940
  </xsl:for-each>
@@ -4418,6 +4420,7 @@
4418
4420
  </xsl:if>
4419
4421
 
4420
4422
  <fo:block margin-top="6pt">
4423
+ <xsl:copy-of select="@id"/>
4421
4424
 
4422
4425
 
4423
4426
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -5267,14 +5270,18 @@
5267
5270
  </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
5268
5271
  <fo:inline><xsl:apply-templates/></fo:inline>
5269
5272
  </xsl:template><xsl:template match="*[local-name() = 'terms']">
5273
+ <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
5270
5274
  <fo:block id="{@id}">
5271
5275
  <xsl:apply-templates/>
5272
5276
  </fo:block>
5273
5277
  </xsl:template><xsl:template match="*[local-name() = 'term']">
5278
+ <!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
5274
5279
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
5275
5280
 
5276
5281
 
5277
-
5282
+ <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
5283
+
5284
+ </xsl:if>
5278
5285
  <xsl:apply-templates/>
5279
5286
  </fo:block>
5280
5287
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
@@ -5698,12 +5705,12 @@
5698
5705
  </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">
5699
5706
  <xsl:apply-templates mode="contents"/>
5700
5707
  <xsl:text> </xsl:text>
5701
- </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">
5708
+ </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'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
5702
5709
  <xsl:apply-templates mode="bookmarks"/>
5703
5710
  <xsl:text> </xsl:text>
5704
5711
  </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">
5705
5712
  <xsl:value-of select="."/>
5706
- </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">
5713
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
5707
5714
  <xsl:value-of select="."/>
5708
5715
  </xsl:template><xsl:template match="node()" mode="contents">
5709
5716
  <xsl:apply-templates mode="contents"/>
@@ -5973,6 +5980,8 @@
5973
5980
 
5974
5981
 
5975
5982
 
5983
+
5984
+
5976
5985
  <fo:block xsl:use-attribute-sets="sourcecode-style">
5977
5986
  <xsl:variable name="_font-size">
5978
5987
 
@@ -6006,13 +6015,17 @@
6006
6015
 
6007
6016
 
6008
6017
 
6018
+
6019
+
6009
6020
  <xsl:apply-templates/>
6010
6021
  </fo:block>
6011
-
6022
+
6012
6023
 
6013
6024
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
6014
6025
 
6015
6026
 
6027
+
6028
+
6016
6029
  </fo:block-container>
6017
6030
  </fo:block-container>
6018
6031
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -6248,7 +6261,8 @@
6248
6261
  </fo:block>
6249
6262
  </fo:table-cell>
6250
6263
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
6251
- <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
6264
+ <fo:block font-size="11pt">
6265
+
6252
6266
  <xsl:apply-templates/>
6253
6267
  </fo:block>
6254
6268
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
@@ -6364,13 +6378,15 @@
6364
6378
  <!-- <xsl:apply-templates /> -->
6365
6379
  <xsl:copy-of select="$termsource_text"/>
6366
6380
  </xsl:when>
6367
- <xsl:otherwise>
6381
+ <xsl:otherwise>
6382
+
6368
6383
 
6369
6384
  <xsl:text>[</xsl:text>
6370
6385
 
6371
6386
  <!-- <xsl:apply-templates /> -->
6372
6387
  <xsl:copy-of select="$termsource_text"/>
6373
6388
 
6389
+
6374
6390
  <xsl:text>]</xsl:text>
6375
6391
 
6376
6392
  </xsl:otherwise>
@@ -6437,12 +6453,20 @@
6437
6453
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6438
6454
  <xsl:text>— </xsl:text>
6439
6455
  <xsl:apply-templates/>
6440
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
6456
+ </xsl:template><xsl:variable name="bibitem_hidden_">
6457
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6458
+ <xsl:copy-of select="."/>
6459
+ </xsl:for-each>
6460
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
6461
+ <xsl:copy-of select="."/>
6462
+ </xsl:for-each>
6463
+ </xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6441
6464
 
6442
6465
  <xsl:variable name="bibitemid">
6443
6466
  <xsl:choose>
6444
- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
6445
- <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6467
+ <!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
6468
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
6469
+ <xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6446
6470
  <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
6447
6471
  </xsl:choose>
6448
6472
  </xsl:variable>
@@ -6534,10 +6558,10 @@
6534
6558
  </xsl:choose>
6535
6559
  </xsl:variable>
6536
6560
 
6537
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
6561
+ <!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
6538
6562
 
6539
6563
  <xsl:choose>
6540
- <xsl:when test="$language = 'zh'">
6564
+ <xsl:when test="$lang = 'zh'">
6541
6565
  <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
6542
6566
  </xsl:when>
6543
6567
  <xsl:when test="../../@inline-header = 'true'">
@@ -6571,24 +6595,29 @@
6571
6595
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
6572
6596
  <xsl:variable name="title-deprecated">
6573
6597
 
6574
-
6575
- <xsl:call-template name="getTitle">
6576
- <xsl:with-param name="name" select="'title-deprecated'"/>
6598
+ <xsl:call-template name="getLocalizedString">
6599
+ <xsl:with-param name="key">deprecated</xsl:with-param>
6577
6600
  </xsl:call-template>
6578
6601
 
6602
+
6579
6603
  </xsl:variable>
6580
6604
  <fo:block xsl:use-attribute-sets="deprecates-style">
6581
6605
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
6582
6606
  </fo:block>
6607
+ </xsl:template><xsl:template name="setStyle_preferred">
6608
+ <xsl:if test="*[local-name() = 'strong']">
6609
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
6610
+ </xsl:if>
6583
6611
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
6584
6612
  <fo:block xsl:use-attribute-sets="definition-style">
6585
6613
  <xsl:apply-templates/>
6586
6614
  </fo:block>
6587
6615
  </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
6588
6616
  <xsl:apply-templates/>
6589
- </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
6617
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
6590
6618
  <fo:inline> <xsl:apply-templates/></fo:inline>
6591
- <fo:block> </fo:block>
6619
+ <!-- <fo:block>&#xA0;</fo:block> -->
6620
+ <fo:block/>
6592
6621
  </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
6593
6622
 
6594
6623
  <fo:block>
@@ -7528,12 +7557,15 @@
7528
7557
  <xsl:param name="default">left</xsl:param>
7529
7558
  <xsl:attribute name="text-align">
7530
7559
  <xsl:choose>
7531
- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
7560
+ <xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
7532
7561
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
7533
7562
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
7534
7563
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
7535
7564
  </xsl:choose>
7536
7565
  </xsl:attribute>
7566
+ <xsl:if test="@align = 'indent'">
7567
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
7568
+ </xsl:if>
7537
7569
  </xsl:template><xsl:template name="number-to-words">
7538
7570
  <xsl:param name="number"/>
7539
7571
  <xsl:param name="first"/>
@@ -1768,9 +1768,10 @@
1768
1768
  <xsl:otherwise>5mm</xsl:otherwise>
1769
1769
  </xsl:choose>
1770
1770
  </xsl:attribute>
1771
- <xsl:apply-templates select="ancestor::itu:term/itu:name" mode="presentation"/>
1771
+ <xsl:apply-templates select="ancestor::itu:term[1]/itu:name" mode="presentation"/>
1772
1772
  </fo:inline>
1773
1773
  <fo:inline font-weight="bold">
1774
+ <xsl:call-template name="setStyle_preferred"/>
1774
1775
  <xsl:apply-templates/>
1775
1776
  </fo:inline>
1776
1777
  <xsl:if test="../itu:termsource/itu:origin">
@@ -2922,7 +2923,8 @@
2922
2923
  <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"/>
2923
2924
 
2924
2925
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2925
- <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2926
+
2927
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
2926
2928
  <xsl:sort select="@displayorder" data-type="number"/>
2927
2929
  <xsl:apply-templates select="." mode="contents"/>
2928
2930
  </xsl:for-each>
@@ -2932,7 +2934,7 @@
2932
2934
  <xsl:apply-templates select="." mode="contents"/>
2933
2935
  </xsl:for-each>
2934
2936
 
2935
- <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2937
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2936
2938
  <xsl:sort select="@displayorder" data-type="number"/>
2937
2939
  <xsl:apply-templates select="." mode="contents"/>
2938
2940
  </xsl:for-each>
@@ -4418,6 +4420,7 @@
4418
4420
  </xsl:if>
4419
4421
 
4420
4422
  <fo:block margin-top="6pt">
4423
+ <xsl:copy-of select="@id"/>
4421
4424
 
4422
4425
 
4423
4426
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -5267,14 +5270,18 @@
5267
5270
  </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
5268
5271
  <fo:inline><xsl:apply-templates/></fo:inline>
5269
5272
  </xsl:template><xsl:template match="*[local-name() = 'terms']">
5273
+ <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
5270
5274
  <fo:block id="{@id}">
5271
5275
  <xsl:apply-templates/>
5272
5276
  </fo:block>
5273
5277
  </xsl:template><xsl:template match="*[local-name() = 'term']">
5278
+ <!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
5274
5279
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
5275
5280
 
5276
5281
 
5277
-
5282
+ <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
5283
+
5284
+ </xsl:if>
5278
5285
  <xsl:apply-templates/>
5279
5286
  </fo:block>
5280
5287
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
@@ -5698,12 +5705,12 @@
5698
5705
  </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">
5699
5706
  <xsl:apply-templates mode="contents"/>
5700
5707
  <xsl:text> </xsl:text>
5701
- </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">
5708
+ </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'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
5702
5709
  <xsl:apply-templates mode="bookmarks"/>
5703
5710
  <xsl:text> </xsl:text>
5704
5711
  </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">
5705
5712
  <xsl:value-of select="."/>
5706
- </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">
5713
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
5707
5714
  <xsl:value-of select="."/>
5708
5715
  </xsl:template><xsl:template match="node()" mode="contents">
5709
5716
  <xsl:apply-templates mode="contents"/>
@@ -5973,6 +5980,8 @@
5973
5980
 
5974
5981
 
5975
5982
 
5983
+
5984
+
5976
5985
  <fo:block xsl:use-attribute-sets="sourcecode-style">
5977
5986
  <xsl:variable name="_font-size">
5978
5987
 
@@ -6006,13 +6015,17 @@
6006
6015
 
6007
6016
 
6008
6017
 
6018
+
6019
+
6009
6020
  <xsl:apply-templates/>
6010
6021
  </fo:block>
6011
-
6022
+
6012
6023
 
6013
6024
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
6014
6025
 
6015
6026
 
6027
+
6028
+
6016
6029
  </fo:block-container>
6017
6030
  </fo:block-container>
6018
6031
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -6248,7 +6261,8 @@
6248
6261
  </fo:block>
6249
6262
  </fo:table-cell>
6250
6263
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
6251
- <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
6264
+ <fo:block font-size="11pt">
6265
+
6252
6266
  <xsl:apply-templates/>
6253
6267
  </fo:block>
6254
6268
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
@@ -6364,13 +6378,15 @@
6364
6378
  <!-- <xsl:apply-templates /> -->
6365
6379
  <xsl:copy-of select="$termsource_text"/>
6366
6380
  </xsl:when>
6367
- <xsl:otherwise>
6381
+ <xsl:otherwise>
6382
+
6368
6383
 
6369
6384
  <xsl:text>[</xsl:text>
6370
6385
 
6371
6386
  <!-- <xsl:apply-templates /> -->
6372
6387
  <xsl:copy-of select="$termsource_text"/>
6373
6388
 
6389
+
6374
6390
  <xsl:text>]</xsl:text>
6375
6391
 
6376
6392
  </xsl:otherwise>
@@ -6437,12 +6453,20 @@
6437
6453
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6438
6454
  <xsl:text>— </xsl:text>
6439
6455
  <xsl:apply-templates/>
6440
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
6456
+ </xsl:template><xsl:variable name="bibitem_hidden_">
6457
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6458
+ <xsl:copy-of select="."/>
6459
+ </xsl:for-each>
6460
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
6461
+ <xsl:copy-of select="."/>
6462
+ </xsl:for-each>
6463
+ </xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6441
6464
 
6442
6465
  <xsl:variable name="bibitemid">
6443
6466
  <xsl:choose>
6444
- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
6445
- <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6467
+ <!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
6468
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
6469
+ <xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6446
6470
  <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
6447
6471
  </xsl:choose>
6448
6472
  </xsl:variable>
@@ -6534,10 +6558,10 @@
6534
6558
  </xsl:choose>
6535
6559
  </xsl:variable>
6536
6560
 
6537
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
6561
+ <!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
6538
6562
 
6539
6563
  <xsl:choose>
6540
- <xsl:when test="$language = 'zh'">
6564
+ <xsl:when test="$lang = 'zh'">
6541
6565
  <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
6542
6566
  </xsl:when>
6543
6567
  <xsl:when test="../../@inline-header = 'true'">
@@ -6571,24 +6595,29 @@
6571
6595
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
6572
6596
  <xsl:variable name="title-deprecated">
6573
6597
 
6574
-
6575
- <xsl:call-template name="getTitle">
6576
- <xsl:with-param name="name" select="'title-deprecated'"/>
6598
+ <xsl:call-template name="getLocalizedString">
6599
+ <xsl:with-param name="key">deprecated</xsl:with-param>
6577
6600
  </xsl:call-template>
6578
6601
 
6602
+
6579
6603
  </xsl:variable>
6580
6604
  <fo:block xsl:use-attribute-sets="deprecates-style">
6581
6605
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
6582
6606
  </fo:block>
6607
+ </xsl:template><xsl:template name="setStyle_preferred">
6608
+ <xsl:if test="*[local-name() = 'strong']">
6609
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
6610
+ </xsl:if>
6583
6611
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
6584
6612
  <fo:block xsl:use-attribute-sets="definition-style">
6585
6613
  <xsl:apply-templates/>
6586
6614
  </fo:block>
6587
6615
  </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
6588
6616
  <xsl:apply-templates/>
6589
- </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
6617
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
6590
6618
  <fo:inline> <xsl:apply-templates/></fo:inline>
6591
- <fo:block> </fo:block>
6619
+ <!-- <fo:block>&#xA0;</fo:block> -->
6620
+ <fo:block/>
6592
6621
  </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
6593
6622
 
6594
6623
  <fo:block>
@@ -7528,12 +7557,15 @@
7528
7557
  <xsl:param name="default">left</xsl:param>
7529
7558
  <xsl:attribute name="text-align">
7530
7559
  <xsl:choose>
7531
- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
7560
+ <xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
7532
7561
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
7533
7562
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
7534
7563
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
7535
7564
  </xsl:choose>
7536
7565
  </xsl:attribute>
7566
+ <xsl:if test="@align = 'indent'">
7567
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
7568
+ </xsl:if>
7537
7569
  </xsl:template><xsl:template name="number-to-words">
7538
7570
  <xsl:param name="number"/>
7539
7571
  <xsl:param name="first"/>
@@ -6,16 +6,16 @@ module IsoDoc
6
6
  class Metadata < IsoDoc::Metadata
7
7
  def initialize(lang, script, labels)
8
8
  super
9
- here = File.dirname(__FILE__)
10
9
  n = "International_Telecommunication_Union_Logo.svg"
11
- set(:logo_html,
12
- File.expand_path(File.join(here, "html", n)))
13
- set(:logo_comb,
14
- File.expand_path(File.join(here, "html", "itu-document-comb.png")))
15
- set(:logo_word,
16
- File.expand_path(File.join(here, "html", n)))
17
- set(:logo_sp,
18
- File.expand_path(File.join(here, "html", "logo-sp.png")))
10
+ set(:logo_html, fileloc(n))
11
+ set(:logo_comb, fileloc("itu-document-comb.png"))
12
+ set(:logo_word, fileloc(n))
13
+ set(:logo_sp, fileloc("logo-sp.png"))
14
+ end
15
+
16
+ def fileloc(file)
17
+ here = File.dirname(__FILE__)
18
+ File.expand_path(File.join(here, "html", file))
19
19
  end
20
20
 
21
21
  def title(isoxml, _out)
@@ -114,10 +114,8 @@ module IsoDoc
114
114
  isoxml.at(ns("//bibdata/copyright/from"))
115
115
  pubdate and
116
116
  set(:placedate_year,
117
- @labels["placedate"].sub(/%/,
118
- pubdate.text.sub(
119
- /^(\d\d\d\d).*$/, "\\1"
120
- )))
117
+ @labels["placedate"]
118
+ .sub(/%/, pubdate.text.sub(/^(\d\d\d\d).*$/, "\\1")))
121
119
  end
122
120
 
123
121
  def monthyr(isodate)
@@ -156,8 +154,8 @@ module IsoDoc
156
154
  return isodate unless m && m[:yr] && m[:mo] && m[:dd]
157
155
 
158
156
  mmm = DateTime.parse(isodate).localize(@lang.to_sym)
159
- .to_additional_s("MMM")
160
- @i18n.l10n("#{m[:dd]} #{mmm} #{m[:yr]}")
157
+ .to_additional_s("yMMM")
158
+ @i18n.l10n("#{m[:dd]} #{mmm}")
161
159
  end
162
160
 
163
161
  def ddMMMMYYYY(date1, date2)
@@ -23,18 +23,26 @@ module IsoDoc
23
23
  &.at(ns("//bibdata/ext/structuredidentifier/annexid"))&.text
24
24
  docxml.xpath(ns("//annex")).each { |c| annex_names(c, annexid) }
25
25
  else
26
- i = Counter.new(0, numerals: :roman)
27
- docxml.xpath(ns("//annex[@obligation = 'informative']"))
28
- .each do |c|
29
- i.increment(c)
30
- annex_names(c, i.print.upcase)
31
- end
32
- i = Counter.new("@", skip_i: true)
33
- docxml.xpath(ns("//annex[not(@obligation = 'informative')]"))
34
- .each do |c|
35
- i.increment(c)
36
- annex_names(c, i.print)
37
- end
26
+ informative_annex_names(docxml)
27
+ normative_annex_names(docxml)
28
+ end
29
+ end
30
+
31
+ def informative_annex_names(docxml)
32
+ i = Counter.new(0, numerals: :roman)
33
+ docxml.xpath(ns("//annex[@obligation = 'informative']"))
34
+ .each do |c|
35
+ i.increment(c)
36
+ annex_names(c, i.print.upcase)
37
+ end
38
+ end
39
+
40
+ def normative_annex_names(docxml)
41
+ i = Counter.new("@", skip_i: true)
42
+ docxml.xpath(ns("//annex[not(@obligation = 'informative')]"))
43
+ .each do |c|
44
+ i.increment(c)
45
+ annex_names(c, i.print)
38
46
  end
39
47
  end
40
48
 
@@ -51,7 +59,9 @@ module IsoDoc
51
59
  n = Counter.new
52
60
  n = section_names(doc.at(ns("//clause[@type = 'scope']")), n, 1)
53
61
  n = section_names(doc.at(ns(@klass.norm_ref_xpath)), n, 1)
54
- n = section_names(doc.at(ns("//sections/terms | //sections/clause[descendant::terms]")), n, 1)
62
+ n = section_names(
63
+ doc.at(ns("//sections/terms | //sections/clause[descendant::terms]")), n, 1
64
+ )
55
65
  n = section_names(doc.at(ns("//sections/definitions")), n, 1)
56
66
  clause_names(doc, n)
57
67
  middle_section_asset_names(doc)
@@ -88,7 +98,8 @@ module IsoDoc
88
98
  next if t["id"].nil? || t["id"].empty?
89
99
 
90
100
  @anchors[t["id"]] =
91
- anchor_struct(label, nil, @labels["figure"], "figure", t["unnumbered"])
101
+ anchor_struct(label, nil, @labels["figure"], "figure",
102
+ t["unnumbered"])
92
103
  end
93
104
  end
94
105
 
@@ -105,14 +116,16 @@ module IsoDoc
105
116
  next if t["id"].nil? || t["id"].empty?
106
117
 
107
118
  @anchors[t["id"]] =
108
- anchor_struct(label, nil, @labels["figure"], "figure", t["unnumbered"])
119
+ anchor_struct(label, nil, @labels["figure"], "figure",
120
+ t["unnumbered"])
109
121
  end
110
122
  end
111
123
 
112
124
  def sequential_formula_names(clause)
113
125
  clause&.first&.xpath(ns(middle_sections))&.each do |c|
114
126
  if c["id"] && @anchors[c["id"]]
115
- hierarchical_formula_names(c, @anchors[c["id"]][:label] || @anchors[c["id"]][:xref] || "???")
127
+ hierarchical_formula_names(c,
128
+ @anchors[c["id"]][:label] || @anchors[c["id"]][:xref] || "???")
116
129
  else
117
130
  hierarchical_formula_names(c, "???")
118
131
  end
@@ -121,9 +134,7 @@ module IsoDoc
121
134
 
122
135
  def hierarchical_formula_names(clause, num)
123
136
  c = Counter.new
124
- clause.xpath(ns(".//formula")).each do |t|
125
- next if t["id"].nil? || t["id"].empty?
126
-
137
+ clause.xpath(ns(".//formula")).reject { |n| blank?(n["id"]) }.each do |t|
127
138
  @anchors[t["id"]] = anchor_struct(
128
139
  "#{num}-#{c.increment(t).print}", nil,
129
140
  t["inequality"] ? @labels["inequality"] : @labels["formula"],
@@ -139,12 +150,10 @@ module IsoDoc
139
150
  end
140
151
 
141
152
  def termnote_anchor_names(docxml)
142
- docxml.xpath(ns("//term[descendant::termnote]")).each do |t|
153
+ docxml.xpath(ns("//term[termnote]")).each do |t|
143
154
  c = Counter.new
144
- notes = t.xpath(ns(".//termnote"))
145
- notes.each do |n|
146
- return if n["id"].nil? || n["id"].empty?
147
-
155
+ notes = t.xpath(ns("./termnote"))
156
+ notes.reject { |n| blank?(n["id"]) }.each do |n|
148
157
  idx = notes.size == 1 ? "" : " #{c.increment(n).print}"
149
158
  @anchors[n["id"]] =
150
159
  { label: termnote_label(idx).strip, type: "termnote", value: idx,
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "1.4.0".freeze
3
+ VERSION = "1.4.3".freeze
4
4
  end
5
5
  end
@@ -25,13 +25,12 @@ Gem::Specification.new do |spec|
25
25
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
26
26
 
27
27
  spec.add_dependency "htmlentities", "~> 4.3.4"
28
- spec.add_dependency "isodoc", "~> 1.7.0"
29
- spec.add_dependency "metanorma-standoc", "~> 1.10.0"
28
+ spec.add_dependency "metanorma-standoc", "~> 1.11.0"
30
29
  spec.add_dependency "ruby-jing"
31
- spec.add_dependency "twitter_cldr"
30
+ spec.add_dependency "twitter_cldr", ">= 3.0.0"
32
31
  spec.add_dependency "tzinfo-data" # we need this for windows only
33
32
 
34
- spec.add_development_dependency "byebug", "~> 9.1"
33
+ spec.add_development_dependency "debug"
35
34
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
36
35
  spec.add_development_dependency "guard", "~> 2.14"
37
36
  spec.add_development_dependency "guard-rspec", "~> 4.7"