metanorma-nist 1.2.7 → 1.2.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +7 -5
  3. data/README.adoc +23 -3
  4. data/lib/asciidoctor/nist/basicdoc.rng +52 -3
  5. data/lib/asciidoctor/nist/boilerplate.rb +5 -3
  6. data/lib/asciidoctor/nist/cleanup.rb +5 -3
  7. data/lib/asciidoctor/nist/converter.rb +7 -2
  8. data/lib/asciidoctor/nist/front.rb +37 -46
  9. data/lib/asciidoctor/nist/front_id.rb +18 -7
  10. data/lib/asciidoctor/nist/isodoc.rng +51 -3
  11. data/lib/asciidoctor/nist/nist.rng +1 -0
  12. data/lib/asciidoctor/nist/nist_intro.xml +9 -9
  13. data/lib/asciidoctor/nist/nist_intro_cswp.xml +9 -9
  14. data/lib/asciidoctor/nist/validate.rb +17 -6
  15. data/lib/isodoc/nist/base_convert.rb +2 -3
  16. data/lib/isodoc/nist/fonts_manifest.yaml +4 -0
  17. data/lib/isodoc/nist/html/header_cswp.html +2 -3
  18. data/lib/isodoc/nist/html/html_nist_titlepage.html +5 -3
  19. data/lib/isodoc/nist/html/htmlstyle.css +221 -221
  20. data/lib/isodoc/nist/html/htmlstyle.scss +5 -6
  21. data/lib/isodoc/nist/html/nist.css +49 -50
  22. data/lib/isodoc/nist/html/nist.scss +49 -50
  23. data/lib/isodoc/nist/html/nist_cswp.css +48 -49
  24. data/lib/isodoc/nist/html/nist_cswp.scss +48 -49
  25. data/lib/isodoc/nist/html/word_nist_titlepage.html +8 -8
  26. data/lib/isodoc/nist/html/word_nist_titlepage_cswp.html +2 -0
  27. data/lib/isodoc/nist/html/wordstyle.css +42 -42
  28. data/lib/isodoc/nist/html/wordstyle.scss +42 -42
  29. data/lib/isodoc/nist/html/wordstyle_cswp.css +52 -52
  30. data/lib/isodoc/nist/html/wordstyle_cswp.scss +52 -52
  31. data/lib/isodoc/nist/html_convert.rb +6 -5
  32. data/lib/isodoc/nist/metadata.rb +28 -40
  33. data/lib/isodoc/nist/metadata_id.rb +3 -7
  34. data/lib/isodoc/nist/nist.csts.xsl +4780 -0
  35. data/lib/isodoc/nist/nist.cswp.xsl +401 -159
  36. data/lib/isodoc/nist/nist.sp.xsl +387 -194
  37. data/lib/isodoc/nist/pdf_convert.rb +5 -1
  38. data/lib/isodoc/nist/presentation_xml_convert.rb +30 -10
  39. data/lib/isodoc/nist/refs.rb +6 -20
  40. data/lib/isodoc/nist/render.rb +42 -40
  41. data/lib/isodoc/nist/render_dates.rb +8 -9
  42. data/lib/isodoc/nist/word_convert.rb +11 -7
  43. data/lib/isodoc/nist/xref.rb +11 -5
  44. data/lib/metanorma/nist/processor.rb +12 -8
  45. data/lib/metanorma/nist/version.rb +1 -1
  46. data/metanorma-nist.gemspec +2 -2
  47. metadata +8 -6
@@ -808,10 +808,25 @@
808
808
  <fo:block>
809
809
  <fo:block><xsl:value-of select="nist:person/nist:name/nist:completename"/></fo:block>
810
810
  <xsl:variable name="org-name" select="nist:person/nist:affiliation/nist:organization/nist:name"/>
811
+ <xsl:variable name="subdivision">
812
+ <xsl:for-each select="nist:person/nist:affiliation/nist:organization/nist:subdivision">
813
+ <xsl:value-of select="."/>
814
+ <xsl:if test="position() != last()">, </xsl:if>
815
+ </xsl:for-each>
816
+ </xsl:variable>
817
+ <xsl:variable name="following_subdivision">
818
+ <xsl:for-each select="following-sibling::nist:contributor[nist:role/@type = 'author'][1]/nist:person/nist:affiliation/nist:organization/nist:subdivision">
819
+ <xsl:value-of select="."/>
820
+ <xsl:if test="position() != last()">, </xsl:if>
821
+ </xsl:for-each>
822
+ </xsl:variable>
811
823
  <xsl:variable name="org-address" select="nist:person/nist:affiliation/nist:organization/nist:address/nist:formattedAddress"/>
812
- <xsl:if test="concat(following-sibling::nist:contributor[nist:role/@type = 'author'][1]/nist:person/nist:affiliation/nist:organization/nist:name, following-sibling::nist:contributor[nist:role/@type = 'author'][1]/nist:person/nist:affiliation/nist:organization/nist:address/nist:formattedAddress) != concat($org-name, $org-address)">
824
+ <xsl:if test="concat(following-sibling::nist:contributor[nist:role/@type = 'author'][1]/nist:person/nist:affiliation/nist:organization/nist:name, $following_subdivision, following-sibling::nist:contributor[nist:role/@type = 'author'][1]/nist:person/nist:affiliation/nist:organization/nist:address/nist:formattedAddress) != concat($org-name, $subdivision, $org-address)">
813
825
  <fo:block font-style="italic" margin-bottom="12pt">
814
826
  <xsl:value-of select="$org-name"/>
827
+ <xsl:if test="normalize-space($subdivision) != ''">
828
+ <fo:inline>, <xsl:value-of select="$subdivision"/></fo:inline>
829
+ </xsl:if>
815
830
  <xsl:if test="normalize-space($org-address) != ''">
816
831
  <fo:inline>, <xsl:value-of select="$org-address"/></fo:inline>
817
832
  </xsl:if>
@@ -915,7 +930,7 @@
915
930
  <fo:block font-size="12pt" font-weight="bold" text-align="center" margin-bottom="12pt"><xsl:value-of select="$title-list-figures"/></fo:block>
916
931
  <xsl:for-each select="//nist:figure[@id and nist:name]">
917
932
  <fo:block text-align-last="justify" margin-top="6pt" margin-bottom="6pt">
918
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
933
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{nist:name}">
919
934
  <xsl:apply-templates select="nist:name" mode="contents"/>
920
935
  <fo:inline keep-together.within-line="always">
921
936
  <fo:leader leader-pattern="dots"/>
@@ -941,7 +956,7 @@
941
956
  <fo:block font-size="12pt" font-weight="bold" text-align="center" margin-bottom="12pt"><xsl:value-of select="$title-list-tables"/></fo:block>
942
957
  <xsl:for-each select="//nist:table[@id and nist:name]">
943
958
  <fo:block text-align-last="justify" margin-top="6pt" margin-bottom="6pt">
944
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
959
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{nist:name}">
945
960
  <xsl:apply-templates select="nist:name" mode="contents"/>
946
961
  <fo:inline keep-together.within-line="always">
947
962
  <fo:leader leader-pattern="dots"/>
@@ -1340,35 +1355,24 @@
1340
1355
  <!-- Bibliography -->
1341
1356
  <!-- ============================= -->
1342
1357
 
1343
- <!-- Example: [ITU-T A.23] ITU-T A.23, Recommendation ITU-T A.23, Annex A (2014), Guide for ITU-T and ISO/IEC JTC 1 cooperation. -->
1358
+ <!-- Examples:
1359
+ [b-ASM] b-ASM, http://www.eecs.umich.edu/gasm/ (accessed 20 March 2018).
1360
+ [b-Börger & Stärk] b-Börger & Stärk, Börger, E., and Stärk, R. S. (2003), Abstract State Machines: A Method for High-Level System Design and Analysis, Springer-Verlag.
1361
+ -->
1344
1362
  <xsl:template match="nist:bibitem">
1345
- <fo:block id="{@id}" margin-top="6pt" margin-left="14mm" text-indent="-14mm">
1346
- <fo:inline padding-right="5mm">[<xsl:value-of select="nist:docidentifier"/>]</fo:inline><xsl:value-of select="nist:docidentifier"/>
1347
- <xsl:if test="nist:title">
1348
- <fo:inline font-style="italic">
1349
- <xsl:text>, </xsl:text>
1350
- <xsl:choose>
1351
- <xsl:when test="nist:title[@type = 'main' and @language = 'en']">
1352
- <xsl:value-of select="nist:title[@type = 'main' and @language = 'en']"/>
1353
- </xsl:when>
1354
- <xsl:otherwise>
1355
- <xsl:value-of select="nist:title"/>
1356
- </xsl:otherwise>
1357
- </xsl:choose>
1358
- </fo:inline>
1359
- </xsl:if>
1360
- <xsl:apply-templates select="nist:formattedref"/>
1361
- </fo:block>
1363
+ <fo:block id="{@id}" margin-top="6pt" margin-left="12mm" text-indent="-12mm">
1364
+ <xsl:variable name="docidentifier" select="normalize-space(nist:docidentifier[@display = 'true'])"/>
1365
+ <xsl:if test="$docidentifier != ''">
1366
+ <fo:inline padding-right="5mm"><xsl:value-of select="$docidentifier"/></fo:inline>
1367
+ </xsl:if>
1368
+ <xsl:apply-templates select="nist:formattedref"/>
1369
+ </fo:block>
1362
1370
  </xsl:template>
1363
- <xsl:template match="nist:bibitem/nist:docidentifier"/>
1364
-
1365
- <xsl:template match="nist:bibitem/nist:title"/>
1366
1371
 
1367
1372
  <xsl:template match="nist:formattedref">
1368
- <xsl:text>, </xsl:text><xsl:apply-templates/>
1373
+ <xsl:apply-templates/>
1369
1374
  </xsl:template>
1370
1375
 
1371
-
1372
1376
  <!-- ============================= -->
1373
1377
  <!-- ============================= -->
1374
1378
 
@@ -1488,21 +1492,21 @@
1488
1492
  <!-- ====== -->
1489
1493
 
1490
1494
 
1491
- <xsl:template match="nist:p/nist:fn[not(ancestor::nist:table)] | nist:title/nist:fn | nist:table/nist:name/nist:fn" priority="2">
1495
+ <xsl:template match="nist:p//nist:fn[not(ancestor::nist:table)] | nist:title/nist:fn | nist:table/nist:name/nist:fn" priority="2">
1492
1496
  <fo:footnote>
1493
1497
  <xsl:variable name="number">
1494
- <xsl:number level="any" count="nist:p/nist:fn[not(ancestor::nist:table)] | nist:title/nist:fn | nist:table/nist:name/nist:fn"/>
1498
+ <xsl:number level="any" count="nist:p//nist:fn[not(ancestor::nist:table)] | nist:title/nist:fn | nist:table/nist:name/nist:fn"/>
1495
1499
  </xsl:variable>
1496
1500
  <fo:inline font-size="60%" keep-with-previous.within-line="always" vertical-align="super">
1497
1501
  <fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
1498
1502
  <!-- <xsl:value-of select="@reference"/> -->
1499
- <xsl:value-of select="$number + count(//nist:bibitem/nist:note)"/>
1503
+ <xsl:value-of select="$number + count(//nist:bibitem//nist:note)"/>
1500
1504
  </fo:basic-link>
1501
1505
  </fo:inline>
1502
1506
  <fo:footnote-body>
1503
1507
  <fo:block font-size="10pt" font-family="Times New Roman" font-style="normal" font-weight="normal" text-align="justify" margin-bottom="12pt" start-indent="0">
1504
1508
  <fo:inline id="footnote_{@reference}_{$number}" font-size="75%" keep-with-next.within-line="always" vertical-align="super"> <!-- alignment-baseline="hanging" -->
1505
- <xsl:value-of select="$number + count(//nist:bibitem/nist:note)"/>
1509
+ <xsl:value-of select="$number + count(//nist:bibitem//nist:note)"/>
1506
1510
  </fo:inline>
1507
1511
  <xsl:for-each select="nist:p">
1508
1512
  <xsl:apply-templates/>
@@ -1536,104 +1540,6 @@
1536
1540
  </xsl:element>
1537
1541
  </xsl:template>
1538
1542
 
1539
-
1540
-
1541
- <!-- Examples:
1542
- [b-ASM] b-ASM, http://www.eecs.umich.edu/gasm/ (accessed 20 March 2018).
1543
- [b-Börger & Stärk] b-Börger & Stärk, Börger, E., and Stärk, R. S. (2003), Abstract State Machines: A Method for High-Level System Design and Analysis, Springer-Verlag.
1544
- -->
1545
- <xsl:template match="nist:annex//nist:bibitem">
1546
- <fo:block id="{@id}" margin-top="6pt" margin-left="12mm" text-indent="-12mm">
1547
- <xsl:if test="nist:formattedref">
1548
- <xsl:choose>
1549
- <xsl:when test="nist:docidentifier[@type = 'metanorma']">
1550
- <xsl:attribute name="margin-left">0</xsl:attribute>
1551
- <xsl:attribute name="text-indent">0</xsl:attribute>
1552
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1553
- <!-- create list -->
1554
- <fo:list-block>
1555
- <fo:list-item>
1556
- <fo:list-item-label end-indent="label-end()">
1557
- <fo:block>
1558
- <xsl:apply-templates select="nist:docidentifier[@type = 'metanorma']" mode="process"/>
1559
- </fo:block>
1560
- </fo:list-item-label>
1561
- <fo:list-item-body start-indent="body-start()">
1562
- <fo:block margin-left="3mm">
1563
- <xsl:apply-templates select="nist:formattedref"/>
1564
- </fo:block>
1565
- </fo:list-item-body>
1566
- </fo:list-item>
1567
- </fo:list-block>
1568
- </xsl:when>
1569
- <xsl:otherwise>
1570
- <xsl:apply-templates select="nist:formattedref"/>
1571
- <xsl:apply-templates select="nist:docidentifier[@type != 'metanorma' or not(@type)]" mode="process"/>
1572
- </xsl:otherwise>
1573
- </xsl:choose>
1574
-
1575
-
1576
- </xsl:if>
1577
- <xsl:if test="nist:title">
1578
- <xsl:for-each select="nist:contributor">
1579
- <xsl:choose>
1580
- <xsl:when test="nist:person/nist:name/nist:completename">
1581
- <xsl:apply-templates select="nist:person/nist:name/nist:completename"/>
1582
- </xsl:when>
1583
- <xsl:otherwise>
1584
- <xsl:apply-templates select="nist:organization/nist:name"/>
1585
- </xsl:otherwise>
1586
- </xsl:choose>
1587
- <xsl:if test="position() != last()">, </xsl:if>
1588
- </xsl:for-each>
1589
- <xsl:text> (</xsl:text>
1590
- <xsl:variable name="date">
1591
- <xsl:choose>
1592
- <xsl:when test="nist:date[@type='issued']">
1593
- <xsl:call-template name="formatDate">
1594
- <xsl:with-param name="date" select="nist:date[@type='issued']/nist:on"/>
1595
- </xsl:call-template>
1596
- </xsl:when>
1597
- <xsl:otherwise>
1598
- <xsl:call-template name="formatDate">
1599
- <xsl:with-param name="date" select="nist:date/nist:on"/>
1600
- </xsl:call-template>
1601
- </xsl:otherwise>
1602
- </xsl:choose>
1603
- </xsl:variable>
1604
- <xsl:value-of select="$date"/>
1605
- <xsl:text>) </xsl:text>
1606
- <fo:inline font-style="italic"><xsl:value-of select="nist:title"/></fo:inline>
1607
- <xsl:if test="nist:contributor[nist:role/@type='publisher']/nist:organization/nist:name">
1608
- <xsl:text> (</xsl:text><xsl:value-of select="nist:contributor[nist:role/@type='publisher']/nist:organization/nist:name"/><xsl:text>)</xsl:text>
1609
- </xsl:if>
1610
- <xsl:if test="nist:place">
1611
- <xsl:text> (</xsl:text><xsl:value-of select="nist:place"/><xsl:text>)</xsl:text>
1612
- </xsl:if>
1613
- <xsl:text>, </xsl:text>
1614
- <xsl:value-of select="$date"/>
1615
- <xsl:text>. </xsl:text>
1616
- <xsl:value-of select="nist:docidentifier"/>
1617
- <xsl:value-of select="$linebreak"/>
1618
- <xsl:value-of select="nist:uri"/>
1619
- </xsl:if>
1620
- </fo:block>
1621
- </xsl:template>
1622
-
1623
- <xsl:template match="nist:annex//nist:bibitem//nist:formattedref">
1624
- <xsl:apply-templates/>
1625
- </xsl:template>
1626
-
1627
- <xsl:template match="nist:docidentifier[@type = 'metanorma']" mode="process">
1628
- <xsl:apply-templates/>
1629
- </xsl:template>
1630
- <xsl:template match="nist:docidentifier[@type != 'metanorma' or not(@type)]" mode="process">
1631
- <xsl:text> [</xsl:text><xsl:apply-templates/><xsl:text>]</xsl:text>
1632
- </xsl:template>
1633
- <xsl:template match="nist:docidentifier"/>
1634
-
1635
-
1636
-
1637
1543
  <xsl:template match="nist:ul | nist:ol" mode="ul_ol">
1638
1544
  <xsl:param name="margin"/>
1639
1545
  <fo:list-block>
@@ -1693,7 +1599,7 @@
1693
1599
  <xsl:number format="1."/>
1694
1600
  </xsl:when>
1695
1601
  <xsl:when test="../@type = 'arabic'">
1696
- <xsl:number format="a)"/>
1602
+ <xsl:number format="a)" lang="en"/>
1697
1603
  </xsl:when>
1698
1604
  <xsl:when test="../@type = 'alphabet'">
1699
1605
  <xsl:number format="1)"/>
@@ -1702,7 +1608,7 @@
1702
1608
  <xsl:number format="i)"/>
1703
1609
  </xsl:when>
1704
1610
  <xsl:when test="../@type = 'alphabet_upper'">
1705
- <xsl:number format="A)"/>
1611
+ <xsl:number format="A)" lang="en"/>
1706
1612
  </xsl:when>
1707
1613
  <xsl:when test="ancestor::*[nist:annex]">
1708
1614
  <!-- <xsl:variable name="level">
@@ -1710,7 +1616,7 @@
1710
1616
  </xsl:variable> -->
1711
1617
  <xsl:choose>
1712
1618
  <xsl:when test="$level = 1">
1713
- <xsl:number format="a)"/>
1619
+ <xsl:number format="a)" lang="en"/>
1714
1620
  </xsl:when>
1715
1621
  <xsl:when test="$level = 2">
1716
1622
  <xsl:number format="i)"/>
@@ -2225,13 +2131,22 @@
2225
2131
  <title-part lang="en">
2226
2132
 
2227
2133
 
2134
+
2228
2135
  </title-part>
2229
2136
  <title-part lang="fr">
2230
2137
 
2231
2138
 
2139
+
2232
2140
  </title-part>
2233
2141
  <title-part lang="zh">第 # 部分:</title-part>
2234
2142
 
2143
+ <title-subpart lang="en">
2144
+
2145
+ </title-subpart>
2146
+ <title-subpart lang="fr">
2147
+
2148
+ </title-subpart>
2149
+
2235
2150
  <title-modified lang="en">modified</title-modified>
2236
2151
  <title-modified lang="fr">modifiée</title-modified>
2237
2152
 
@@ -2534,6 +2449,7 @@
2534
2449
 
2535
2450
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2536
2451
 
2452
+
2537
2453
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2538
2454
 
2539
2455
 
@@ -2541,6 +2457,7 @@
2541
2457
 
2542
2458
 
2543
2459
 
2460
+
2544
2461
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
2545
2462
 
2546
2463
 
@@ -2558,6 +2475,7 @@
2558
2475
  </xsl:attribute-set><xsl:attribute-set name="term-style">
2559
2476
 
2560
2477
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2478
+
2561
2479
 
2562
2480
 
2563
2481
 
@@ -2667,7 +2585,7 @@
2667
2585
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2668
2586
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
2669
2587
  <xsl:call-template name="add-zero-spaces-java"/>
2670
- </xsl:template><xsl:template match="*[local-name()='table']">
2588
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
2671
2589
 
2672
2590
  <xsl:variable name="simple-table">
2673
2591
  <xsl:call-template name="getSimpleTable"/>
@@ -2677,7 +2595,9 @@
2677
2595
 
2678
2596
 
2679
2597
 
2680
-
2598
+ <!-- <xsl:if test="$namespace = 'bipm'">
2599
+ <fo:block>&#xA0;</fo:block>
2600
+ </xsl:if> -->
2681
2601
 
2682
2602
  <!-- $namespace = 'iso' or -->
2683
2603
 
@@ -2709,10 +2629,12 @@
2709
2629
 
2710
2630
 
2711
2631
  <xsl:variable name="colwidths">
2712
- <xsl:call-template name="calculate-column-widths">
2713
- <xsl:with-param name="cols-count" select="$cols-count"/>
2714
- <xsl:with-param name="table" select="$simple-table"/>
2715
- </xsl:call-template>
2632
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2633
+ <xsl:call-template name="calculate-column-widths">
2634
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2635
+ <xsl:with-param name="table" select="$simple-table"/>
2636
+ </xsl:call-template>
2637
+ </xsl:if>
2716
2638
  </xsl:variable>
2717
2639
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2718
2640
 
@@ -2763,7 +2685,12 @@
2763
2685
 
2764
2686
  <xsl:variable name="table_attributes">
2765
2687
  <attribute name="table-layout">fixed</attribute>
2766
- <attribute name="width">100%</attribute>
2688
+ <attribute name="width">
2689
+ <xsl:choose>
2690
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
2691
+ <xsl:otherwise>100%</xsl:otherwise>
2692
+ </xsl:choose>
2693
+ </attribute>
2767
2694
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2768
2695
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2769
2696
 
@@ -2792,16 +2719,25 @@
2792
2719
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2793
2720
  </xsl:if>
2794
2721
 
2795
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2796
- <xsl:choose>
2797
- <xsl:when test=". = 1 or . = 0">
2798
- <fo:table-column column-width="proportional-column-width(2)"/>
2799
- </xsl:when>
2800
- <xsl:otherwise>
2801
- <fo:table-column column-width="proportional-column-width({.})"/>
2802
- </xsl:otherwise>
2803
- </xsl:choose>
2804
- </xsl:for-each>
2722
+ <xsl:choose>
2723
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2724
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2725
+ <fo:table-column column-width="{@width}"/>
2726
+ </xsl:for-each>
2727
+ </xsl:when>
2728
+ <xsl:otherwise>
2729
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2730
+ <xsl:choose>
2731
+ <xsl:when test=". = 1 or . = 0">
2732
+ <fo:table-column column-width="proportional-column-width(2)"/>
2733
+ </xsl:when>
2734
+ <xsl:otherwise>
2735
+ <fo:table-column column-width="proportional-column-width({.})"/>
2736
+ </xsl:otherwise>
2737
+ </xsl:choose>
2738
+ </xsl:for-each>
2739
+ </xsl:otherwise>
2740
+ </xsl:choose>
2805
2741
 
2806
2742
  <xsl:choose>
2807
2743
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -2814,10 +2750,12 @@
2814
2750
 
2815
2751
  </fo:table>
2816
2752
 
2753
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2817
2754
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2818
2755
  <xsl:call-template name="insertTableFooterInSeparateTable">
2819
2756
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
2820
2757
  <xsl:with-param name="colwidths" select="$colwidths"/>
2758
+ <xsl:with-param name="colgroup" select="$colgroup"/>
2821
2759
  </xsl:call-template>
2822
2760
  </xsl:for-each>
2823
2761
 
@@ -2850,6 +2788,7 @@
2850
2788
  <xsl:if test="normalize-space() != ''">
2851
2789
  <fo:block xsl:use-attribute-sets="table-name-style">
2852
2790
 
2791
+
2853
2792
  <xsl:apply-templates/>
2854
2793
  </fo:block>
2855
2794
  </xsl:if>
@@ -3070,12 +3009,22 @@
3070
3009
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
3071
3010
  <xsl:param name="table_attributes"/>
3072
3011
  <xsl:param name="colwidths"/>
3012
+ <xsl:param name="colgroup"/>
3073
3013
 
3074
3014
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3075
3015
 
3076
3016
  <xsl:if test="$isNoteOrFnExist = 'true'">
3077
3017
 
3078
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
3018
+ <xsl:variable name="cols-count">
3019
+ <xsl:choose>
3020
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3021
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
3022
+ </xsl:when>
3023
+ <xsl:otherwise>
3024
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
3025
+ </xsl:otherwise>
3026
+ </xsl:choose>
3027
+ </xsl:variable>
3079
3028
 
3080
3029
  <fo:table keep-with-previous="always">
3081
3030
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -3093,16 +3042,25 @@
3093
3042
  </xsl:choose>
3094
3043
  </xsl:for-each>
3095
3044
 
3096
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3097
- <xsl:choose>
3098
- <xsl:when test=". = 1 or . = 0">
3099
- <fo:table-column column-width="proportional-column-width(2)"/>
3100
- </xsl:when>
3101
- <xsl:otherwise>
3102
- <fo:table-column column-width="proportional-column-width({.})"/>
3103
- </xsl:otherwise>
3104
- </xsl:choose>
3105
- </xsl:for-each>
3045
+ <xsl:choose>
3046
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3047
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
3048
+ <fo:table-column column-width="{@width}"/>
3049
+ </xsl:for-each>
3050
+ </xsl:when>
3051
+ <xsl:otherwise>
3052
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3053
+ <xsl:choose>
3054
+ <xsl:when test=". = 1 or . = 0">
3055
+ <fo:table-column column-width="proportional-column-width(2)"/>
3056
+ </xsl:when>
3057
+ <xsl:otherwise>
3058
+ <fo:table-column column-width="proportional-column-width({.})"/>
3059
+ </xsl:otherwise>
3060
+ </xsl:choose>
3061
+ </xsl:for-each>
3062
+ </xsl:otherwise>
3063
+ </xsl:choose>
3106
3064
 
3107
3065
  <fo:table-body>
3108
3066
  <fo:table-row>
@@ -3206,6 +3164,7 @@
3206
3164
 
3207
3165
 
3208
3166
 
3167
+
3209
3168
  <!-- <xsl:if test="$namespace = 'bipm'">
3210
3169
  <xsl:attribute name="height">8mm</xsl:attribute>
3211
3170
  </xsl:if> -->
@@ -3299,7 +3258,8 @@
3299
3258
  </xsl:attribute>
3300
3259
  </xsl:if>
3301
3260
  <xsl:call-template name="display-align"/>
3302
- <fo:block>
3261
+ <fo:block>
3262
+
3303
3263
  <xsl:apply-templates/>
3304
3264
  </fo:block>
3305
3265
  </fo:table-cell>
@@ -3520,7 +3480,13 @@
3520
3480
  <xsl:apply-templates/>
3521
3481
  </fo:inline>
3522
3482
  </xsl:template><xsl:template match="*[local-name()='dl']">
3523
- <fo:block-container margin-left="0mm">
3483
+ <fo:block-container>
3484
+
3485
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3486
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3487
+ </xsl:if>
3488
+
3489
+
3524
3490
  <xsl:if test="parent::*[local-name() = 'note']">
3525
3491
  <xsl:attribute name="margin-left">
3526
3492
  <xsl:choose>
@@ -3530,8 +3496,12 @@
3530
3496
  </xsl:attribute>
3531
3497
 
3532
3498
  </xsl:if>
3533
- <fo:block-container margin-left="0mm">
3534
-
3499
+ <fo:block-container>
3500
+
3501
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3502
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3503
+
3504
+
3535
3505
  <xsl:variable name="parent" select="local-name(..)"/>
3536
3506
 
3537
3507
  <xsl:variable name="key_iso">
@@ -3545,9 +3515,12 @@
3545
3515
  <fo:block margin-bottom="12pt" text-align="left">
3546
3516
 
3547
3517
  <xsl:variable name="title-where">
3548
- <xsl:call-template name="getTitle">
3549
- <xsl:with-param name="name" select="'title-where'"/>
3550
- </xsl:call-template>
3518
+
3519
+
3520
+ <xsl:call-template name="getTitle">
3521
+ <xsl:with-param name="name" select="'title-where'"/>
3522
+ </xsl:call-template>
3523
+
3551
3524
  </xsl:variable>
3552
3525
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
3553
3526
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -3563,9 +3536,12 @@
3563
3536
 
3564
3537
 
3565
3538
  <xsl:variable name="title-where">
3566
- <xsl:call-template name="getTitle">
3567
- <xsl:with-param name="name" select="'title-where'"/>
3568
- </xsl:call-template>
3539
+
3540
+
3541
+ <xsl:call-template name="getTitle">
3542
+ <xsl:with-param name="name" select="'title-where'"/>
3543
+ </xsl:call-template>
3544
+
3569
3545
  </xsl:variable>
3570
3546
  <xsl:value-of select="$title-where"/>
3571
3547
  </fo:block>
@@ -3576,9 +3552,12 @@
3576
3552
 
3577
3553
 
3578
3554
  <xsl:variable name="title-key">
3579
- <xsl:call-template name="getTitle">
3580
- <xsl:with-param name="name" select="'title-key'"/>
3581
- </xsl:call-template>
3555
+
3556
+
3557
+ <xsl:call-template name="getTitle">
3558
+ <xsl:with-param name="name" select="'title-key'"/>
3559
+ </xsl:call-template>
3560
+
3582
3561
  </xsl:variable>
3583
3562
  <xsl:value-of select="$title-key"/>
3584
3563
  </fo:block>
@@ -3712,12 +3691,32 @@
3712
3691
  </xsl:otherwise>
3713
3692
  </xsl:choose>
3714
3693
  </xsl:template><xsl:template name="getMaxLength_dt">
3715
- <xsl:for-each select="*[local-name()='dt']">
3716
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3717
- <xsl:if test="position() = 1">
3718
- <xsl:value-of select="string-length(normalize-space(.))"/>
3719
- </xsl:if>
3720
- </xsl:for-each>
3694
+ <xsl:variable name="lengths">
3695
+ <xsl:for-each select="*[local-name()='dt']">
3696
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
3697
+ <xsl:variable name="attributes">
3698
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
3699
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
3700
+ </xsl:variable>
3701
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
3702
+ </xsl:for-each>
3703
+ </xsl:variable>
3704
+ <xsl:variable name="maxLength">
3705
+ <!-- <xsl:for-each select="*[local-name()='dt']">
3706
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3707
+ <xsl:if test="position() = 1">
3708
+ <xsl:value-of select="string-length(normalize-space(.))"/>
3709
+ </xsl:if>
3710
+ </xsl:for-each> -->
3711
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
3712
+ <xsl:sort select="." data-type="number" order="descending"/>
3713
+ <xsl:if test="position() = 1">
3714
+ <xsl:value-of select="."/>
3715
+ </xsl:if>
3716
+ </xsl:for-each>
3717
+ </xsl:variable>
3718
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
3719
+ <xsl:value-of select="$maxLength"/>
3721
3720
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
3722
3721
  <xsl:param name="key_iso"/>
3723
3722
 
@@ -3845,6 +3844,7 @@
3845
3844
  </fo:inline>
3846
3845
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
3847
3846
  <fo:inline font-weight="bold">
3847
+
3848
3848
  <xsl:apply-templates/>
3849
3849
  </fo:inline>
3850
3850
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -3871,6 +3871,7 @@
3871
3871
 
3872
3872
 
3873
3873
 
3874
+
3874
3875
 
3875
3876
  </xsl:variable>
3876
3877
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -3884,6 +3885,10 @@
3884
3885
  </xsl:if>
3885
3886
  <xsl:apply-templates/>
3886
3887
  </fo:inline>
3888
+ </xsl:template><xsl:template match="*[local-name()='underline']">
3889
+ <fo:inline text-decoration="underline">
3890
+ <xsl:apply-templates/>
3891
+ </fo:inline>
3887
3892
  </xsl:template><xsl:template match="*[local-name()='del']">
3888
3893
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3889
3894
  <xsl:apply-templates/>
@@ -4173,7 +4178,18 @@
4173
4178
  <xsl:with-param name="previousRow" select="$newRow"/>
4174
4179
  </xsl:apply-templates>
4175
4180
  </xsl:template><xsl:template name="getLang">
4176
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4181
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4182
+ <xsl:variable name="language">
4183
+ <xsl:choose>
4184
+ <xsl:when test="$language_current != ''">
4185
+ <xsl:value-of select="$language_current"/>
4186
+ </xsl:when>
4187
+ <xsl:otherwise>
4188
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4189
+ </xsl:otherwise>
4190
+ </xsl:choose>
4191
+ </xsl:variable>
4192
+
4177
4193
  <xsl:choose>
4178
4194
  <xsl:when test="$language = 'English'">en</xsl:when>
4179
4195
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -4208,6 +4224,7 @@
4208
4224
  <xsl:value-of select="substring($str, 2)"/>
4209
4225
  </xsl:template><xsl:template match="mathml:math">
4210
4226
  <fo:inline font-family="STIX Two Math"> <!-- -->
4227
+
4211
4228
  <xsl:variable name="mathml">
4212
4229
  <xsl:apply-templates select="." mode="mathml"/>
4213
4230
  </xsl:variable>
@@ -4237,6 +4254,7 @@
4237
4254
  </xsl:choose>
4238
4255
  </xsl:variable>
4239
4256
  <fo:inline xsl:use-attribute-sets="link-style">
4257
+
4240
4258
  <xsl:choose>
4241
4259
  <xsl:when test="$target = ''">
4242
4260
  <xsl:apply-templates/>
@@ -4290,10 +4308,14 @@
4290
4308
  </fo:inline>
4291
4309
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
4292
4310
  <xsl:variable name="title-modified">
4293
- <xsl:call-template name="getTitle">
4294
- <xsl:with-param name="name" select="'title-modified'"/>
4295
- </xsl:call-template>
4311
+
4312
+
4313
+ <xsl:call-template name="getTitle">
4314
+ <xsl:with-param name="name" select="'title-modified'"/>
4315
+ </xsl:call-template>
4316
+
4296
4317
  </xsl:variable>
4318
+
4297
4319
  <xsl:choose>
4298
4320
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
4299
4321
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -4447,8 +4469,9 @@
4447
4469
  </xsl:if> -->
4448
4470
  </fo:inline>
4449
4471
  </xsl:if>
4450
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
4451
- <fo:block-container id="{@id}">
4472
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
4473
+ <fo:block-container id="{@id}">
4474
+
4452
4475
  <fo:block>
4453
4476
  <xsl:apply-templates/>
4454
4477
  </fo:block>
@@ -4499,7 +4522,7 @@
4499
4522
  <xsl:apply-templates mode="bookmarks"/>
4500
4523
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4501
4524
  <xsl:apply-templates select="."/>
4502
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4525
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4503
4526
  <xsl:apply-templates mode="bookmarks"/>
4504
4527
  </xsl:template><xsl:template name="addBookmarks">
4505
4528
  <xsl:param name="contents"/>
@@ -4515,6 +4538,8 @@
4515
4538
  <xsl:variable name="bookmark-title_">
4516
4539
  <xsl:call-template name="getLangVersion">
4517
4540
  <xsl:with-param name="lang" select="@lang"/>
4541
+ <xsl:with-param name="doctype" select="@doctype"/>
4542
+ <xsl:with-param name="title" select="@title-part"/>
4518
4543
  </xsl:call-template>
4519
4544
  </xsl:variable>
4520
4545
  <xsl:choose>
@@ -4532,13 +4557,34 @@
4532
4557
  </xsl:choose>
4533
4558
  </fo:bookmark-title>
4534
4559
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4560
+
4561
+ <xsl:call-template name="insertFigureBookmarks">
4562
+ <xsl:with-param name="contents" select="contents"/>
4563
+ </xsl:call-template>
4564
+
4565
+ <xsl:call-template name="insertTableBookmarks">
4566
+ <xsl:with-param name="contents" select="contents"/>
4567
+ <xsl:with-param name="lang" select="@lang"/>
4568
+ </xsl:call-template>
4569
+
4535
4570
  </fo:bookmark>
4536
4571
 
4537
4572
  </xsl:for-each>
4538
4573
  </xsl:when>
4539
4574
  <xsl:otherwise>
4540
4575
  <xsl:for-each select="xalan:nodeset($contents)/doc">
4576
+
4541
4577
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4578
+
4579
+ <xsl:call-template name="insertFigureBookmarks">
4580
+ <xsl:with-param name="contents" select="contents"/>
4581
+ </xsl:call-template>
4582
+
4583
+ <xsl:call-template name="insertTableBookmarks">
4584
+ <xsl:with-param name="contents" select="contents"/>
4585
+ <xsl:with-param name="lang" select="@lang"/>
4586
+ </xsl:call-template>
4587
+
4542
4588
  </xsl:for-each>
4543
4589
  </xsl:otherwise>
4544
4590
  </xsl:choose>
@@ -4584,8 +4630,44 @@
4584
4630
 
4585
4631
  </fo:bookmark-tree>
4586
4632
  </xsl:if>
4633
+ </xsl:template><xsl:template name="insertFigureBookmarks">
4634
+ <xsl:param name="contents"/>
4635
+ <xsl:if test="xalan:nodeset($contents)/figure">
4636
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
4637
+ <fo:bookmark-title>Figures</fo:bookmark-title>
4638
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
4639
+ <fo:bookmark internal-destination="{@id}">
4640
+ <fo:bookmark-title>
4641
+ <xsl:value-of select="normalize-space(title)"/>
4642
+ </fo:bookmark-title>
4643
+ </fo:bookmark>
4644
+ </xsl:for-each>
4645
+ </fo:bookmark>
4646
+ </xsl:if>
4647
+ </xsl:template><xsl:template name="insertTableBookmarks">
4648
+ <xsl:param name="contents"/>
4649
+ <xsl:param name="lang"/>
4650
+ <xsl:if test="xalan:nodeset($contents)/table">
4651
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
4652
+ <fo:bookmark-title>
4653
+ <xsl:choose>
4654
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
4655
+ <xsl:otherwise>Tables</xsl:otherwise>
4656
+ </xsl:choose>
4657
+ </fo:bookmark-title>
4658
+ <xsl:for-each select="xalan:nodeset($contents)/table">
4659
+ <fo:bookmark internal-destination="{@id}">
4660
+ <fo:bookmark-title>
4661
+ <xsl:value-of select="normalize-space(title)"/>
4662
+ </fo:bookmark-title>
4663
+ </fo:bookmark>
4664
+ </xsl:for-each>
4665
+ </fo:bookmark>
4666
+ </xsl:if>
4587
4667
  </xsl:template><xsl:template name="getLangVersion">
4588
4668
  <xsl:param name="lang"/>
4669
+ <xsl:param name="doctype" select="''"/>
4670
+ <xsl:param name="title" select="''"/>
4589
4671
  <xsl:choose>
4590
4672
  <xsl:when test="$lang = 'en'">
4591
4673
 
@@ -4625,6 +4707,12 @@
4625
4707
  <!-- <xsl:text> </xsl:text> -->
4626
4708
  </xsl:template><xsl:template name="getSection">
4627
4709
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4710
+ <!--
4711
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
4712
+ <xsl:value-of select="."/>
4713
+ </xsl:for-each>
4714
+ -->
4715
+
4628
4716
  </xsl:template><xsl:template name="getName">
4629
4717
  <xsl:choose>
4630
4718
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -4677,6 +4765,10 @@
4677
4765
  <xsl:copy>
4678
4766
  <xsl:apply-templates mode="contents_item"/>
4679
4767
  </xsl:copy>
4768
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
4769
+ <xsl:copy>
4770
+ <xsl:apply-templates mode="contents_item"/>
4771
+ </xsl:copy>
4680
4772
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
4681
4773
  <xsl:text> </xsl:text>
4682
4774
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -4702,6 +4794,7 @@
4702
4794
 
4703
4795
 
4704
4796
 
4797
+
4705
4798
 
4706
4799
 
4707
4800
  10
@@ -5074,7 +5167,8 @@
5074
5167
  <fo:block-container margin-left="0mm">
5075
5168
 
5076
5169
  <fo:block xsl:use-attribute-sets="quote-style">
5077
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
5170
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
5171
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5078
5172
  </fo:block>
5079
5173
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5080
5174
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -5201,9 +5295,12 @@
5201
5295
  </fo:block>
5202
5296
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5203
5297
  <xsl:variable name="title-deprecated">
5204
- <xsl:call-template name="getTitle">
5205
- <xsl:with-param name="name" select="'title-deprecated'"/>
5206
- </xsl:call-template>
5298
+
5299
+
5300
+ <xsl:call-template name="getTitle">
5301
+ <xsl:with-param name="name" select="'title-deprecated'"/>
5302
+ </xsl:call-template>
5303
+
5207
5304
  </xsl:variable>
5208
5305
  <fo:block xsl:use-attribute-sets="deprecates-style">
5209
5306
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -5225,6 +5322,7 @@
5225
5322
 
5226
5323
 
5227
5324
 
5325
+
5228
5326
 
5229
5327
 
5230
5328
 
@@ -5240,7 +5338,7 @@
5240
5338
  </xsl:if>
5241
5339
 
5242
5340
 
5243
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
5341
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
5244
5342
  <fo:block break-after="page"/>
5245
5343
  <fo:block>
5246
5344
  <xsl:call-template name="setId"/>
@@ -5248,7 +5346,8 @@
5248
5346
  </fo:block>
5249
5347
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
5250
5348
  <fo:block>
5251
- <xsl:call-template name="setId"/>
5349
+ <xsl:call-template name="setId"/>
5350
+
5252
5351
 
5253
5352
  <xsl:apply-templates/>
5254
5353
  </fo:block>
@@ -5256,7 +5355,7 @@
5256
5355
  <fo:block id="{@id}">
5257
5356
  <xsl:apply-templates/>
5258
5357
  </fo:block>
5259
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5358
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5260
5359
 
5261
5360
  <fo:block break-after="page"/>
5262
5361
 
@@ -5315,7 +5414,10 @@
5315
5414
  <fo:table-column column-width="107mm"/>
5316
5415
  <fo:table-column column-width="15mm"/>
5317
5416
  <fo:table-body>
5318
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
5417
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
5418
+
5419
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
5420
+
5319
5421
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
5320
5422
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
5321
5423
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -5333,6 +5435,10 @@
5333
5435
  <fo:block><xsl:apply-templates/></fo:block>
5334
5436
  </fo:table-cell>
5335
5437
  </xsl:template><xsl:template name="processBibitem">
5438
+
5439
+
5440
+ <!-- end BIPM bibitem processing-->
5441
+
5336
5442
 
5337
5443
 
5338
5444
 
@@ -5391,6 +5497,8 @@
5391
5497
  <xsl:value-of select="translate(.,'. ','')"/>
5392
5498
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
5393
5499
  <xsl:value-of select="substring(.,1,1)"/>
5500
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5501
+ <fo:inline><xsl:apply-templates/></fo:inline>
5394
5502
  </xsl:template><xsl:template name="convertDate">
5395
5503
  <xsl:param name="date"/>
5396
5504
  <xsl:param name="format" select="'short'"/>
@@ -5415,6 +5523,57 @@
5415
5523
  </xsl:variable>
5416
5524
  <xsl:variable name="result">
5417
5525
  <xsl:choose>
5526
+ <xsl:when test="$format = 'ddMMyyyy'">
5527
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5528
+ <xsl:text> </xsl:text>
5529
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
5530
+ </xsl:when>
5531
+ <xsl:when test="$format = 'ddMM'">
5532
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5533
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
5534
+ </xsl:when>
5535
+ <xsl:when test="$format = 'short' or $day = ''">
5536
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5537
+ </xsl:when>
5538
+ <xsl:otherwise>
5539
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
5540
+ </xsl:otherwise>
5541
+ </xsl:choose>
5542
+ </xsl:variable>
5543
+ <xsl:value-of select="$result"/>
5544
+ </xsl:template><xsl:template name="convertDateLocalized">
5545
+ <xsl:param name="date"/>
5546
+ <xsl:param name="format" select="'short'"/>
5547
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
5548
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
5549
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
5550
+ <xsl:variable name="monthStr">
5551
+ <xsl:choose>
5552
+ <xsl:when test="$month = '01'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_january</xsl:with-param></xsl:call-template></xsl:when>
5553
+ <xsl:when test="$month = '02'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_february</xsl:with-param></xsl:call-template></xsl:when>
5554
+ <xsl:when test="$month = '03'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_march</xsl:with-param></xsl:call-template></xsl:when>
5555
+ <xsl:when test="$month = '04'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_april</xsl:with-param></xsl:call-template></xsl:when>
5556
+ <xsl:when test="$month = '05'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_may</xsl:with-param></xsl:call-template></xsl:when>
5557
+ <xsl:when test="$month = '06'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_june</xsl:with-param></xsl:call-template></xsl:when>
5558
+ <xsl:when test="$month = '07'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_july</xsl:with-param></xsl:call-template></xsl:when>
5559
+ <xsl:when test="$month = '08'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_august</xsl:with-param></xsl:call-template></xsl:when>
5560
+ <xsl:when test="$month = '09'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_september</xsl:with-param></xsl:call-template></xsl:when>
5561
+ <xsl:when test="$month = '10'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_october</xsl:with-param></xsl:call-template></xsl:when>
5562
+ <xsl:when test="$month = '11'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_november</xsl:with-param></xsl:call-template></xsl:when>
5563
+ <xsl:when test="$month = '12'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_december</xsl:with-param></xsl:call-template></xsl:when>
5564
+ </xsl:choose>
5565
+ </xsl:variable>
5566
+ <xsl:variable name="result">
5567
+ <xsl:choose>
5568
+ <xsl:when test="$format = 'ddMMyyyy'">
5569
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5570
+ <xsl:text> </xsl:text>
5571
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
5572
+ </xsl:when>
5573
+ <xsl:when test="$format = 'ddMM'">
5574
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5575
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
5576
+ </xsl:when>
5418
5577
  <xsl:when test="$format = 'short' or $day = ''">
5419
5578
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5420
5579
  </xsl:when>
@@ -5575,13 +5734,22 @@
5575
5734
  </xsl:template><xsl:template name="split">
5576
5735
  <xsl:param name="pText" select="."/>
5577
5736
  <xsl:param name="sep" select="','"/>
5737
+ <xsl:param name="normalize-space" select="'true'"/>
5578
5738
  <xsl:if test="string-length($pText) &gt;0">
5579
5739
  <item>
5580
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
5740
+ <xsl:choose>
5741
+ <xsl:when test="$normalize-space = 'true'">
5742
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
5743
+ </xsl:when>
5744
+ <xsl:otherwise>
5745
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
5746
+ </xsl:otherwise>
5747
+ </xsl:choose>
5581
5748
  </item>
5582
5749
  <xsl:call-template name="split">
5583
5750
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
5584
5751
  <xsl:with-param name="sep" select="$sep"/>
5752
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
5585
5753
  </xsl:call-template>
5586
5754
  </xsl:if>
5587
5755
  </xsl:template><xsl:template name="getDocumentId">
@@ -5605,6 +5773,7 @@
5605
5773
 
5606
5774
 
5607
5775
 
5776
+
5608
5777
  </xsl:variable>
5609
5778
  <xsl:if test="$documentNS != $XSLNS">
5610
5779
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -5647,4 +5816,28 @@
5647
5816
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
5648
5817
  </xsl:call-template>
5649
5818
  </xsl:if>
5819
+ </xsl:template><xsl:template name="repeat">
5820
+ <xsl:param name="char" select="'*'"/>
5821
+ <xsl:param name="count"/>
5822
+ <xsl:if test="$count &gt; 0">
5823
+ <xsl:value-of select="$char"/>
5824
+ <xsl:call-template name="repeat">
5825
+ <xsl:with-param name="char" select="$char"/>
5826
+ <xsl:with-param name="count" select="$count - 1"/>
5827
+ </xsl:call-template>
5828
+ </xsl:if>
5829
+ </xsl:template><xsl:template name="getLocalizedString">
5830
+ <xsl:param name="key"/>
5831
+
5832
+ <xsl:variable name="curr_lang">
5833
+ <xsl:call-template name="getLang"/>
5834
+ </xsl:variable>
5835
+
5836
+ <xsl:choose>
5837
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5838
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5839
+ </xsl:when>
5840
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
5841
+ </xsl:choose>
5842
+
5650
5843
  </xsl:template></xsl:stylesheet>