metanorma-ieee 1.5.7 → 1.6.0

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.
@@ -457,7 +457,7 @@
457
457
  <xsl:with-param name="format" select="'ddMMyyyy'"/>
458
458
  </xsl:call-template>
459
459
  </xsl:variable> -->
460
- <xsl:variable name="approved_date" select="normalize-space(/mn:metanorma/mn:bibdata/mn:date[@type = 'ieee-sasb-approved' and @format = 'ddMMMyyyy'])"/>
460
+ <xsl:variable name="approved_date" select="normalize-space(/mn:metanorma/mn:bibdata/mn:date[@type = 'ieee-sasb-approved' and (@format = 'ddMMMyyyy' or @format = 'text')])"/>
461
461
 
462
462
  <!-- Example: Revision of IEEE Std 802.1X™-2010
463
463
  Incorporating IEEE Std 802.1Xbx™-2014
@@ -640,7 +640,7 @@
640
640
 
641
641
  <fo:block-container margin-left="47mm" margin-top="10mm"> <!-- margin-top="27mm" -->
642
642
 
643
- <fo:block-container margin-left="0mm">
643
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style">
644
644
 
645
645
  <xsl:apply-templates select="/*/mn:preface/mn:clause[@type = 'toc']">
646
646
  <xsl:with-param name="num" select="$num"/>
@@ -2291,12 +2291,9 @@
2291
2291
  <!-- <xsl:template match="mn:fmt-title[@inline-header = 'true'][following-sibling::*[1][self::mn:p] or following-sibling::*[1][self::mn:clause] or not(following-sibling::*)]" priority="3"> -->
2292
2292
  <xsl:template match="mn:fmt-title[../@inline-header = 'true'][following-sibling::*[1][self::mn:p] or following-sibling::*[1][self::mn:clause] or not(following-sibling::*)]" priority="3">
2293
2293
  <fo:block>
2294
- <xsl:attribute name="space-before">
2295
- <xsl:call-template name="getTitleMarginTop"/>
2296
- </xsl:attribute>
2297
- <xsl:attribute name="margin-bottom">
2298
- <xsl:call-template name="getTitleMarginBottom"/>
2299
- </xsl:attribute>
2294
+ <xsl:variable name="title_styles"><styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"/></styles></xsl:variable>
2295
+ <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*[local-name() = 'space-before' or local-name() = 'margin-bottom']"/>
2296
+
2300
2297
  <xsl:call-template name="title"/>
2301
2298
  <xsl:apply-templates select="following-sibling::*[1][self::mn:p]">
2302
2299
  <xsl:with-param name="inline-header">true</xsl:with-param>
@@ -2345,90 +2342,8 @@
2345
2342
  </xsl:choose>
2346
2343
  </xsl:template>
2347
2344
 
2348
- <xsl:template name="getTitleMarginBottom">
2349
- <xsl:variable name="level">
2350
- <xsl:call-template name="getLevel"/>
2351
- </xsl:variable>
2352
- <xsl:choose>
2353
- <xsl:when test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">
2354
- <xsl:choose>
2355
- <xsl:when test="ancestor::mn:abstract">6pt</xsl:when>
2356
- <xsl:otherwise>12pt</xsl:otherwise>
2357
- </xsl:choose>
2358
- </xsl:when>
2359
- <xsl:otherwise>
2360
- <xsl:choose>
2361
- <xsl:when test="$level = 1 and (ancestor::mn:preface or ancestor::mn:introduction or ancestor::mn:acknowledgements)">12pt</xsl:when>
2362
- <xsl:when test="$level = 1 and not(following-sibling::*[1][self::mn:clause])">12pt</xsl:when>
2363
- <xsl:when test="$level = 1">24pt</xsl:when>
2364
- <xsl:otherwise>12pt</xsl:otherwise>
2365
- </xsl:choose>
2366
- </xsl:otherwise>
2367
- </xsl:choose>
2368
- </xsl:template>
2369
-
2370
2345
  <xsl:template match="mn:fmt-title" priority="2" name="title">
2371
2346
 
2372
- <xsl:variable name="level">
2373
- <xsl:call-template name="getLevel"/>
2374
- </xsl:variable>
2375
-
2376
- <xsl:variable name="font-family">
2377
- <xsl:choose>
2378
- <xsl:when test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">Arial Black</xsl:when>
2379
- <xsl:otherwise>Arial</xsl:otherwise>
2380
- </xsl:choose>
2381
- </xsl:variable>
2382
-
2383
- <xsl:variable name="font-size">
2384
- <xsl:choose>
2385
- <xsl:when test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">
2386
- <xsl:choose>
2387
- <xsl:when test="ancestor::mn:abstract">13pt</xsl:when>
2388
- <xsl:when test="$level = 1">20pt</xsl:when>
2389
- <xsl:when test="$level = 2">16pt</xsl:when>
2390
- <xsl:when test="$level = 3">13pt</xsl:when>
2391
- <xsl:otherwise>11pt</xsl:otherwise> <!-- 4th, ... levels -->
2392
- </xsl:choose>
2393
- </xsl:when>
2394
- <xsl:otherwise>
2395
- <xsl:choose>
2396
- <xsl:when test="@type = 'section-title'">12pt</xsl:when>
2397
- <xsl:when test="$level = 1 and ancestor::mn:acknowledgements">11pt</xsl:when>
2398
- <xsl:when test="$level = 1">12pt</xsl:when>
2399
- <xsl:when test="$level = 2">11pt</xsl:when>
2400
- <xsl:otherwise>10pt</xsl:otherwise> <!-- 3rd, 4th, ... levels -->
2401
- </xsl:choose>
2402
- </xsl:otherwise>
2403
- </xsl:choose>
2404
- </xsl:variable>
2405
-
2406
- <xsl:variable name="font-weight">
2407
- <xsl:choose>
2408
- <xsl:when test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">normal</xsl:when>
2409
- <xsl:otherwise>
2410
- <xsl:choose>
2411
- <!-- <xsl:when test="@ancestor = 'annex' and $level = 1">normal</xsl:when> -->
2412
- <xsl:when test="ancestor::mn:annex and $level = 1">normal</xsl:when>
2413
- <xsl:otherwise>bold</xsl:otherwise>
2414
- </xsl:choose>
2415
- </xsl:otherwise>
2416
- </xsl:choose>
2417
- </xsl:variable>
2418
-
2419
- <xsl:variable name="margin-top">
2420
- <xsl:call-template name="getTitleMarginTop"/>
2421
- </xsl:variable>
2422
-
2423
- <xsl:variable name="margin-bottom">
2424
- <xsl:call-template name="getTitleMarginBottom"/>
2425
- </xsl:variable>
2426
- <!-- <xsl:choose>
2427
- <xsl:when test="$level = 1">12pt</xsl:when>
2428
- <xsl:otherwise>12pt</xsl:otherwise>
2429
- </xsl:choose>
2430
- </xsl:variable> -->
2431
-
2432
2347
  <xsl:variable name="element-name">
2433
2348
  <xsl:choose>
2434
2349
  <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
@@ -2436,26 +2351,7 @@
2436
2351
  </xsl:choose>
2437
2352
  </xsl:variable>
2438
2353
 
2439
- <xsl:variable name="attributes_">
2440
- <attributes>
2441
- <xsl:attribute name="font-family"><xsl:value-of select="$font-family"/></xsl:attribute>
2442
- <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
2443
- <xsl:attribute name="font-weight"><xsl:value-of select="$font-weight"/></xsl:attribute>
2444
- <xsl:attribute name="space-before"><xsl:value-of select="$margin-top"/></xsl:attribute>
2445
- <!-- <xsl:attribute name="margin-top"><xsl:value-of select="$margin-top"/></xsl:attribute> -->
2446
- <xsl:if test="ancestor::mn:introduction"><xsl:attribute name="margin-top"><xsl:value-of select="$margin-top"/></xsl:attribute></xsl:if>
2447
- <xsl:attribute name="margin-bottom"><xsl:value-of select="$margin-bottom"/></xsl:attribute>
2448
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2449
- <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
2450
-
2451
- <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
2452
-
2453
- <xsl:if test="@type = 'floating-title' or @type = 'section-title'">
2454
- <xsl:copy-of select="@id"/>
2455
- </xsl:if>
2456
- </attributes>
2457
- </xsl:variable>
2458
- <xsl:variable name="attributes" select="xalan:nodeset($attributes_)"/>
2354
+ <xsl:variable name="title_styles"><styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template></styles></xsl:variable>
2459
2355
 
2460
2356
  <xsl:variable name="section">
2461
2357
  <xsl:call-template name="extractSection"/>
@@ -2463,26 +2359,15 @@
2463
2359
 
2464
2360
  <xsl:choose>
2465
2361
  <xsl:when test="string-length($section) != 0 and $element-name = 'fo:block' and ($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report')">
2466
-
2467
- <xsl:variable name="provisional-distance-between-starts">
2468
- <xsl:choose>
2469
- <xsl:when test="$level = 1 and string-length($section) = 2">8.5mm</xsl:when>
2470
- <xsl:when test="$level = 1 and string-length($section) = 3">13mm</xsl:when>
2471
- <xsl:when test="$level &gt;= 2">17.8mm</xsl:when>
2472
- <xsl:otherwise>10mm</xsl:otherwise>
2473
- </xsl:choose>
2474
- </xsl:variable>
2475
- <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}">
2476
-
2477
- <xsl:copy-of select="$attributes/attributes/@*"/>
2478
-
2479
- <xsl:if test="$level = 1">
2480
- <xsl:attribute name="line-height">20pt</xsl:attribute>
2481
- </xsl:if>
2362
+ <fo:list-block>
2363
+ <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
2482
2364
 
2483
2365
  <fo:list-item>
2484
2366
  <fo:list-item-label end-indent="label-end()">
2485
2367
  <fo:block id="__internal_layout__toc_section_{generate-id()}">
2368
+ <xsl:variable name="level">
2369
+ <xsl:call-template name="getLevel"/>
2370
+ </xsl:variable>
2486
2371
  <xsl:if test="$level = 1">
2487
2372
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
2488
2373
  </xsl:if>
@@ -2510,8 +2395,7 @@
2510
2395
  </xsl:when>
2511
2396
  <xsl:otherwise>
2512
2397
  <xsl:element name="{$element-name}">
2513
-
2514
- <xsl:copy-of select="$attributes/attributes/@*"/>
2398
+ <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
2515
2399
 
2516
2400
  <!-- if first and last childs are `add` ace-tag, then move start ace-tag before title -->
2517
2401
  <xsl:if test="mn:tab[1]/following-sibling::node()[last()][self::mn:add][starts-with(text(), $ace_tag)]">
@@ -2658,50 +2542,15 @@
2658
2542
  <!-- <xsl:otherwise>fo:block</xsl:otherwise>
2659
2543
  </xsl:choose>
2660
2544
  </xsl:variable> -->
2661
- <xsl:element name="{$element-name}">
2662
- <xsl:call-template name="setBlockAttributes">
2663
- <xsl:with-param name="text_align_default">justify</xsl:with-param>
2664
- </xsl:call-template>
2665
-
2666
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute><!-- 8pt -->
2667
- <xsl:if test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report') and (ancestor::mn:sections or ancestor::mn:annex)">
2668
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2669
- </xsl:if>
2670
- <xsl:if test="../following-sibling::*[1][self::mn:note or self::mn:termnote or self::mn:ul or self::mn:ol] or following-sibling::*[1][self::mn:ul or self::mn:ol]">
2671
- <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
2672
- </xsl:if>
2673
- <xsl:if test="parent::mn:li">
2674
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2675
- <xsl:if test="ancestor::mn:feedback-statement">
2676
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2677
- </xsl:if>
2678
- </xsl:if>
2679
- <xsl:if test="parent::mn:li and (ancestor::mn:note or ancestor::mn:termnote)">
2680
- <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
2681
- </xsl:if>
2682
- <xsl:if test="(following-sibling::*[1][self::mn:clause or self::mn:terms or self::mn:references])">
2683
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2684
- </xsl:if>
2685
- <xsl:if test="@id">
2686
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
2687
- </xsl:if>
2688
- <xsl:attribute name="line-height">1.2</xsl:attribute>
2689
- <!-- bookmarks only in paragraph -->
2690
- <xsl:if test="count(mn:bookmark) != 0 and count(*) = count(mn:bookmark) and normalize-space() = ''">
2691
- <xsl:attribute name="font-size">0</xsl:attribute>
2692
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2693
- <xsl:attribute name="line-height">0</xsl:attribute>
2694
- </xsl:if>
2695
2545
 
2696
- <xsl:if test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report') and not(parent::mn:li)">
2697
- <xsl:attribute name="line-height"><xsl:value-of select="$line-height"/></xsl:attribute>
2698
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2699
- </xsl:if>
2546
+ <xsl:variable name="p_styles">
2547
+ <styles xsl:use-attribute-sets="p-style">
2548
+ <xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
2549
+ </styles>
2550
+ </xsl:variable>
2700
2551
 
2701
- <xsl:if test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report') and parent::mn:li">
2702
- <xsl:attribute name="line-height">inherit</xsl:attribute>
2703
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2704
- </xsl:if>
2552
+ <xsl:element name="{$element-name}">
2553
+ <xsl:copy-of select="xalan:nodeset($p_styles)/styles/@*"/>
2705
2554
 
2706
2555
  <xsl:apply-templates>
2707
2556
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -5985,6 +5834,10 @@
5985
5834
  </xsl:element>
5986
5835
  </xsl:template>
5987
5836
 
5837
+ <!-- show sourcecode's name 'before' or 'after' source code -->
5838
+ <xsl:variable name="sourcecode-name-position"><xsl:text>after</xsl:text>
5839
+ </xsl:variable>
5840
+
5988
5841
  <xsl:template match="mn:sourcecode" name="sourcecode">
5989
5842
 
5990
5843
  <xsl:variable name="sourcecode_attributes">
@@ -6008,7 +5861,12 @@
6008
5861
 
6009
5862
  <xsl:call-template name="refine_sourcecode-container-style"/>
6010
5863
 
6011
- <fo:block-container margin-left="0mm" role="SKIP">
5864
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
5865
+
5866
+ <!-- <xsl:if test="$namespace = 'rsd'"> -->
5867
+ <xsl:if test="$sourcecode-name-position = 'before'">
5868
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name BEFORE content -->
5869
+ </xsl:if>
6012
5870
 
6013
5871
  <fo:block xsl:use-attribute-sets="sourcecode-style">
6014
5872
 
@@ -6030,7 +5888,16 @@
6030
5888
  </fo:block>
6031
5889
 
6032
5890
  <xsl:apply-templates select="mn:dl"/> <!-- Key table -->
6033
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
5891
+
5892
+ <!-- <xsl:choose>
5893
+ <xsl:when test="$namespace = 'rsd'"></xsl:when>
5894
+ <xsl:otherwise>
5895
+ <xsl:apply-templates select="mn:fmt-name" /> --><!-- show sourcecode's name AFTER content -->
5896
+ <!-- </xsl:otherwise>
5897
+ </xsl:choose> -->
5898
+ <xsl:if test="$sourcecode-name-position = 'after'">
5899
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
5900
+ </xsl:if>
6034
5901
 
6035
5902
  </fo:block-container>
6036
5903
  </fo:block-container>
@@ -11852,6 +11719,10 @@
11852
11719
  <!-- image -->
11853
11720
  <!-- ====== -->
11854
11721
 
11722
+ <!-- show figure's name 'before' or 'after' image -->
11723
+ <xsl:variable name="figure-name-position"><xsl:text>after</xsl:text>
11724
+ </xsl:variable>
11725
+
11855
11726
  <xsl:template match="mn:figure" name="figure">
11856
11727
  <xsl:variable name="isAdded" select="@added"/>
11857
11728
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -11864,6 +11735,10 @@
11864
11735
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
11865
11736
  </xsl:call-template>
11866
11737
 
11738
+ <xsl:if test="$figure-name-position = 'before'"> <!-- show figure's name BEFORE image -->
11739
+ <xsl:apply-templates select="mn:fmt-name"/>
11740
+ </xsl:if>
11741
+
11867
11742
  <!-- Example: Dimensions in millimeters -->
11868
11743
  <xsl:apply-templates select="mn:note[@type = 'units']"/>
11869
11744
 
@@ -11884,7 +11759,16 @@
11884
11759
  <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
11885
11760
  <xsl:call-template name="showFigureKey"/>
11886
11761
  </xsl:if>
11887
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
11762
+
11763
+ <!-- <xsl:choose>
11764
+ <xsl:when test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'rsd'"></xsl:when>
11765
+ <xsl:otherwise>
11766
+ <xsl:apply-templates select="mn:fmt-name" /> --> <!-- show figure's name AFTER image -->
11767
+ <!-- </xsl:otherwise>
11768
+ </xsl:choose> -->
11769
+ <xsl:if test="$figure-name-position = 'after'">
11770
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
11771
+ </xsl:if>
11888
11772
 
11889
11773
  </fo:block-container>
11890
11774
  </xsl:template>
@@ -14063,7 +13947,6 @@
14063
13947
  </xsl:attribute-set>
14064
13948
 
14065
13949
  <xsl:template name="refine_references-non-normative-title-style">
14066
-
14067
13950
  </xsl:template>
14068
13951
 
14069
13952
  <!-- bibitem in Normative References (references/@normative="true") -->
@@ -16144,7 +16027,7 @@
16144
16027
  <!-- ===================================== -->
16145
16028
 
16146
16029
  <xsl:attribute-set name="annex-title-style">
16147
- </xsl:attribute-set>
16030
+ </xsl:attribute-set> <!-- annex-title-style -->
16148
16031
 
16149
16032
  <xsl:template name="refine_annex-title-style">
16150
16033
  </xsl:template>
@@ -16164,6 +16047,156 @@
16164
16047
  </xsl:if>
16165
16048
  </xsl:template>
16166
16049
 
16050
+ <xsl:attribute-set name="p-style">
16051
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute><!-- 8pt -->
16052
+ <xsl:attribute name="line-height">1.2</xsl:attribute>
16053
+ </xsl:attribute-set> <!-- p-style -->
16054
+
16055
+ <xsl:template name="refine_p-style">
16056
+ <xsl:param name="element-name"/>
16057
+ <xsl:param name="margin"/>
16058
+ <xsl:call-template name="setBlockAttributes">
16059
+ <xsl:with-param name="text_align_default">justify</xsl:with-param>
16060
+ </xsl:call-template>
16061
+
16062
+ <xsl:if test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report') and (ancestor::mn:sections or ancestor::mn:annex)">
16063
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
16064
+ </xsl:if>
16065
+ <xsl:if test="../following-sibling::*[1][self::mn:note or self::mn:termnote or self::mn:ul or self::mn:ol] or following-sibling::*[1][self::mn:ul or self::mn:ol]">
16066
+ <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
16067
+ </xsl:if>
16068
+ <xsl:if test="parent::mn:li">
16069
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
16070
+ <xsl:if test="ancestor::mn:feedback-statement">
16071
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
16072
+ </xsl:if>
16073
+ </xsl:if>
16074
+ <xsl:if test="parent::mn:li and (ancestor::mn:note or ancestor::mn:termnote)">
16075
+ <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
16076
+ </xsl:if>
16077
+ <xsl:if test="(following-sibling::*[1][self::mn:clause or self::mn:terms or self::mn:references])">
16078
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
16079
+ </xsl:if>
16080
+ <xsl:copy-of select="@id"/>
16081
+
16082
+ <!-- bookmarks only in paragraph -->
16083
+ <xsl:if test="count(mn:bookmark) != 0 and count(*) = count(mn:bookmark) and normalize-space() = ''">
16084
+ <xsl:attribute name="font-size">0</xsl:attribute>
16085
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
16086
+ <xsl:attribute name="line-height">0</xsl:attribute>
16087
+ </xsl:if>
16088
+
16089
+ <xsl:if test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report') and not(parent::mn:li)">
16090
+ <xsl:attribute name="line-height"><xsl:value-of select="$line-height"/></xsl:attribute>
16091
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
16092
+ </xsl:if>
16093
+
16094
+ <xsl:if test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report') and parent::mn:li">
16095
+ <xsl:attribute name="line-height">inherit</xsl:attribute>
16096
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
16097
+ </xsl:if>
16098
+ <!-- $namespace = 'ieee' -->
16099
+
16100
+ </xsl:template> <!-- refine_p-style -->
16101
+
16102
+ <xsl:attribute-set name="title-style">
16103
+ <!-- Note: font-size for level 1 title -->
16104
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
16105
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
16106
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
16107
+ <xsl:attribute name="margin-bottom">24pt</xsl:attribute>
16108
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
16109
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
16110
+ </xsl:attribute-set> <!-- title-style -->
16111
+
16112
+ <xsl:template name="refine_title-style">
16113
+ <xsl:param name="element-name"/>
16114
+ <xsl:variable name="level">
16115
+ <xsl:call-template name="getLevel"/>
16116
+ </xsl:variable>
16117
+ <xsl:variable name="space_before">
16118
+ <xsl:call-template name="getTitleMarginTop"/>
16119
+ </xsl:variable>
16120
+
16121
+ <xsl:choose>
16122
+ <xsl:when test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">
16123
+ <xsl:attribute name="font-family">Arial Black</xsl:attribute>
16124
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
16125
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
16126
+ <xsl:if test="ancestor::mn:abstract">
16127
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
16128
+ </xsl:if>
16129
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
16130
+ <xsl:variable name="section">
16131
+ <xsl:call-template name="extractSection"/>
16132
+ </xsl:variable>
16133
+ <xsl:if test="string-length($section) != 0 and $element-name = 'fo:block'">
16134
+ <xsl:attribute name="provisional-distance-between-starts">
16135
+ <xsl:choose>
16136
+ <xsl:when test="$level = 1 and string-length($section) = 2">8.5mm</xsl:when>
16137
+ <xsl:when test="$level = 1 and string-length($section) = 3">13mm</xsl:when>
16138
+ <xsl:when test="$level &gt;= 2">17.8mm</xsl:when>
16139
+ <xsl:otherwise>10mm</xsl:otherwise>
16140
+ </xsl:choose>
16141
+ </xsl:attribute>
16142
+ <xsl:if test="$level = 1">
16143
+ <xsl:attribute name="font-size">20pt</xsl:attribute>
16144
+ <xsl:attribute name="line-height">20pt</xsl:attribute>
16145
+ </xsl:if>
16146
+ <xsl:if test="$level = 2">
16147
+ <xsl:attribute name="font-size">16pt</xsl:attribute>
16148
+ </xsl:if>
16149
+ <xsl:if test="$level = 3">
16150
+ <xsl:attribute name="font-size">13pt</xsl:attribute>
16151
+ </xsl:if>
16152
+ <xsl:if test="$level &gt;= 4">
16153
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
16154
+ </xsl:if>
16155
+ <xsl:if test="ancestor::mn:abstract">
16156
+ <xsl:attribute name="font-size">13pt</xsl:attribute>
16157
+ </xsl:if>
16158
+ </xsl:if>
16159
+ </xsl:when>
16160
+ <xsl:otherwise>
16161
+ <xsl:if test="$level = 1">
16162
+ <xsl:if test="ancestor::mn:acknowledgements">
16163
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
16164
+ </xsl:if>
16165
+ <xsl:if test="ancestor::mn:annex">
16166
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
16167
+ </xsl:if>
16168
+ <xsl:if test="not(following-sibling::*[1][self::mn:clause])">
16169
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
16170
+ </xsl:if>
16171
+ <xsl:if test="ancestor::mn:preface or ancestor::mn:introduction or ancestor::mn:acknowledgements">
16172
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
16173
+ </xsl:if>
16174
+ </xsl:if>
16175
+ <xsl:if test="$level &gt;= 2">
16176
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
16177
+ </xsl:if>
16178
+ <xsl:if test="$level = 2">
16179
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
16180
+ </xsl:if>
16181
+ <xsl:if test="$level &gt;= 3">
16182
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
16183
+ </xsl:if>
16184
+ <xsl:if test="@type = 'section-title'">
16185
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
16186
+ </xsl:if>
16187
+ </xsl:otherwise>
16188
+ </xsl:choose>
16189
+
16190
+ <xsl:attribute name="space-before"><xsl:value-of select="$space_before"/></xsl:attribute>
16191
+ <xsl:if test="ancestor::mn:introduction"><xsl:attribute name="margin-top"><xsl:value-of select="$space_before"/></xsl:attribute></xsl:if>
16192
+
16193
+ <xsl:if test="@type = 'floating-title' or @type = 'section-title'">
16194
+ <xsl:copy-of select="@id"/>
16195
+ </xsl:if>
16196
+ <!-- $namespace = 'ieee' -->
16197
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
16198
+ </xsl:template> <!-- refine_title-style -->
16199
+
16167
16200
  <xsl:template name="processPrefaceSectionsDefault">
16168
16201
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
16169
16202
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -16502,6 +16535,12 @@
16502
16535
  </xsl:choose>
16503
16536
  </xsl:template>
16504
16537
 
16538
+ <xsl:attribute-set name="reset-margins-style">
16539
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
16540
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
16541
+ <xsl:attribute name="role">SKIP</xsl:attribute>
16542
+ </xsl:attribute-set>
16543
+
16505
16544
  <xsl:attribute-set name="clause-style">
16506
16545
 
16507
16546
  </xsl:attribute-set>
@@ -17521,8 +17560,9 @@
17521
17560
 
17522
17561
  <xsl:template name="setTextAlignment">
17523
17562
  <xsl:param name="default">left</xsl:param>
17563
+ <xsl:param name="skip_default">false</xsl:param>
17524
17564
  <xsl:variable name="align" select="normalize-space(@align)"/>
17525
- <xsl:attribute name="text-align">
17565
+ <xsl:variable name="text_align">
17526
17566
  <xsl:choose>
17527
17567
  <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
17528
17568
  <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
@@ -17530,9 +17570,13 @@
17530
17570
  <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
17531
17571
  <xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
17532
17572
  <xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
17573
+ <xsl:when test="$skip_default = 'true'"/>
17533
17574
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
17534
17575
  </xsl:choose>
17535
- </xsl:attribute>
17576
+ </xsl:variable>
17577
+ <xsl:if test="normalize-space($text_align) != ''">
17578
+ <xsl:attribute name="text-align"><xsl:value-of select="$text_align"/></xsl:attribute>
17579
+ </xsl:if>
17536
17580
  <xsl:if test="$align = 'indent'">
17537
17581
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
17538
17582
  </xsl:if>
@@ -17540,8 +17584,10 @@
17540
17584
 
17541
17585
  <xsl:template name="setBlockAttributes">
17542
17586
  <xsl:param name="text_align_default">left</xsl:param>
17587
+ <xsl:param name="skip_text_align_default">false</xsl:param>
17543
17588
  <xsl:call-template name="setTextAlignment">
17544
17589
  <xsl:with-param name="default" select="$text_align_default"/>
17590
+ <xsl:with-param name="skip_default" select="$skip_text_align_default"/>
17545
17591
  </xsl:call-template>
17546
17592
  <xsl:call-template name="setKeepAttributes"/>
17547
17593
  <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
@@ -7,6 +7,11 @@ module IsoDoc
7
7
  end
8
8
 
9
9
  def bibdata_dates(bib)
10
+ bibdata_date_format(bib)
11
+ bibdata_date_defaults(bib)
12
+ end
13
+
14
+ def bibdata_date_format(bib)
10
15
  bib.xpath(ns("./date")).each do |d|
11
16
  d.next = d.dup
12
17
  d.next["format"] = "ddMMMyyyy"
@@ -16,6 +21,18 @@ module IsoDoc
16
21
  end
17
22
  end
18
23
 
24
+ def bibdata_date_defaults(bib)
25
+ bib.at(ns("./date[@type = 'ieee-sasb-approved']")) and return
26
+ ins = bib.at(ns("./docnumber")) ||
27
+ bib.at(ns("./docidentifier[last()]")) ||
28
+ bib.at(ns("./title[last()]")) or return
29
+ ins.next = <<~XML
30
+ <date type="ieee-sasb-approved" format="text">
31
+ <on>&lt;Date Approved&gt;</on>
32
+ </date>
33
+ XML
34
+ end
35
+
19
36
  def ddMMMyyyy(isodate)
20
37
  isodate.nil? and return nil
21
38
  arr = isodate.split("-")
@@ -29,7 +29,7 @@ module IsoDoc
29
29
 
30
30
  def author_date(xml, renderings)
31
31
  author_date?(xml) or return
32
- cit = renderings[xml["id"]][:citation]
32
+ cit = renderings[xml["id"]][:citation][:author_date]
33
33
  xml << "<docidentifier type='metanorma'>#{cit}</docidentifier>"
34
34
  xml.at(ns("./biblio-tag"))&.remove
35
35
  xml << "<biblio-tag>#{cit}, </biblio-tag>"
@@ -53,7 +53,7 @@ module IsoDoc
53
53
  template: "{{ creatornames }}",
54
54
  extenttemplate: { (bib["type"] || "misc").to_sym => "{{page}}" },
55
55
  sizetemplate: { (bib["type"] || "misc").to_sym => "{{data}}" })
56
- .render1(RelatonBib::XMLParser.from_xml(bib.to_xml))
56
+ .render1(RelatonBib::XMLParser.from_xml(bib.to_xml), false)
57
57
  end
58
58
 
59
59
  def bibliography_bibitem_number1(bibitem, idx, normative)
@@ -17,24 +17,16 @@ module IsoDoc
17
17
 
18
18
  # Style manual 19
19
19
  def anchor_linkend(node, linkend)
20
- if node["citeas"] && i = @bibanchors[node["bibitemid"]]
21
- biblio_anchor_linkend(node, i, linkend)
22
- elsif node["citeas"] && (i = @normrefanchors[node["bibitemid"]])
23
- cit = normref_anchor_linkend(node, i)
24
- cit || super
25
- else super
20
+ if node["citeas"] && bib = @bibanchors[node["bibitemid"]]
21
+ biblio_anchor_linkend(node, bib, linkend)
22
+ else
23
+ node["citeas"] && (bib = @normrefanchors[node["bibitemid"]]) &&
24
+ !%w(standard).include?(bib[:type]) and
25
+ node["style"] ||= "author_date"
26
+ super
26
27
  end
27
28
  end
28
29
 
29
- # force Author-Date referencing on non-standards in norm ref
30
- def normref_anchor_linkend(node, bib)
31
- @ref_renderings or return nil
32
- %w(standard).include?(bib[:type]) and return nil
33
- cit = @ref_renderings[node["bibitemid"]][:citation]&.strip
34
- cit.empty? and cit = nil
35
- cit
36
- end
37
-
38
30
  def biblio_anchor_linkend(node, bib, linkend)
39
31
  if %w(standard).include?(bib[:type])
40
32
  biblio_anchor_linkend_std(node, bib, linkend)
@@ -191,6 +191,11 @@ module IsoDoc
191
191
 
192
192
  def term(docxml); end
193
193
 
194
+ #def term1(elem)
195
+ #super
196
+ #elem.at(ns("./fmt-name"))&.remove # keep fmt-xref-label
197
+ #end
198
+
194
199
  def license_termnote(elem, idx)
195
200
  elem.name = "fn"
196
201
  elem["reference"] = "_termnote_license_#{idx}"
@@ -106,3 +106,5 @@ module Metanorma
106
106
  end
107
107
  end
108
108
  end
109
+
110
+ require_relative "log"