metanorma-ogc 1.2.6 → 1.2.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +29 -8
  3. data/README.adoc +3 -4
  4. data/lib/asciidoctor/ogc/basicdoc.rng +50 -3
  5. data/lib/asciidoctor/ogc/boilerplate.xml +1 -1
  6. data/lib/asciidoctor/ogc/converter.rb +0 -1
  7. data/lib/asciidoctor/ogc/isodoc.rng +61 -3
  8. data/lib/isodoc/ogc/base_convert.rb +2 -3
  9. data/lib/isodoc/ogc/biblio.rb +1 -0
  10. data/lib/isodoc/ogc/html/htmlstyle.css +206 -206
  11. data/lib/isodoc/ogc/html/htmlstyle.scss +4 -4
  12. data/lib/isodoc/ogc/html/ogc.css +21 -21
  13. data/lib/isodoc/ogc/html/ogc.scss +21 -21
  14. data/lib/isodoc/ogc/html/ogc_wp.css +35 -35
  15. data/lib/isodoc/ogc/html/ogc_wp.scss +35 -35
  16. data/lib/isodoc/ogc/html/wordstyle.css +19 -19
  17. data/lib/isodoc/ogc/html/wordstyle.scss +19 -19
  18. data/lib/isodoc/ogc/html/wordstyle_wp.css +23 -23
  19. data/lib/isodoc/ogc/html/wordstyle_wp.scss +23 -23
  20. data/lib/isodoc/ogc/html_convert.rb +4 -1
  21. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +293 -69
  22. data/lib/isodoc/ogc/ogc.best-practice.xsl +293 -69
  23. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +293 -69
  24. data/lib/isodoc/ogc/ogc.community-practice.xsl +293 -69
  25. data/lib/isodoc/ogc/ogc.community-standard.xsl +293 -69
  26. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +293 -69
  27. data/lib/isodoc/ogc/ogc.engineering-report.xsl +293 -69
  28. data/lib/isodoc/ogc/ogc.other.xsl +293 -69
  29. data/lib/isodoc/ogc/ogc.policy.xsl +293 -69
  30. data/lib/isodoc/ogc/ogc.reference-model.xsl +293 -69
  31. data/lib/isodoc/ogc/ogc.release-notes.xsl +293 -69
  32. data/lib/isodoc/ogc/ogc.standard.xsl +293 -69
  33. data/lib/isodoc/ogc/ogc.test-suite.xsl +293 -69
  34. data/lib/isodoc/ogc/ogc.user-guide.xsl +293 -69
  35. data/lib/isodoc/ogc/ogc.white-paper.xsl +289 -66
  36. data/lib/isodoc/ogc/presentation_xml_convert.rb +13 -0
  37. data/lib/isodoc/ogc/word_convert.rb +7 -1
  38. data/lib/isodoc/ogc/xref.rb +8 -4
  39. data/lib/metanorma/ogc.rb +7 -0
  40. data/lib/metanorma/ogc/processor.rb +16 -8
  41. data/lib/metanorma/ogc/version.rb +1 -1
  42. data/metanorma-ogc.gemspec +2 -2
  43. metadata +6 -6
@@ -91,7 +91,7 @@
91
91
 
92
92
  <xsl:template match="/">
93
93
  <xsl:call-template name="namespaceCheck"/>
94
- <fo:root font-family="Arial, STIX Two Math, HanSans" font-size="11pt" xml:lang="{$lang}">
94
+ <fo:root font-family="Arial, STIX Two Math, Source Han Sans" font-size="11pt" xml:lang="{$lang}">
95
95
  <fo:layout-master-set>
96
96
 
97
97
  <!-- Document pages -->
@@ -124,7 +124,7 @@
124
124
  </fo:block-container>
125
125
  </fo:block-container>
126
126
 
127
- <fo:block font-family="Lato Light" font-size="14pt" font-style="italic" margin-top="6pt" color="rgb(21, 43, 77)">
127
+ <fo:block font-family="Lato" font-weight="300" font-size="14pt" font-style="italic" margin-top="6pt" color="rgb(21, 43, 77)">
128
128
  <xsl:text>Additional context, inspirational quote, etc. fits into this subheading area</xsl:text>
129
129
  </fo:block>
130
130
 
@@ -651,13 +651,13 @@
651
651
  <xsl:otherwise> <!-- for ordered lists -->
652
652
  <xsl:choose>
653
653
  <xsl:when test="../@type = 'arabic'">
654
- <xsl:number format="a)"/>
654
+ <xsl:number format="a)" lang="en"/>
655
655
  </xsl:when>
656
656
  <xsl:when test="../@type = 'alphabet'">
657
657
  <xsl:number format="1)"/>
658
658
  </xsl:when>
659
659
  <xsl:when test="../@type = 'alphabet_upper'">
660
- <xsl:number format="A)"/>
660
+ <xsl:number format="A)" lang="en"/>
661
661
  </xsl:when>
662
662
 
663
663
  <xsl:when test="../@type = 'roman'">
@@ -908,13 +908,22 @@
908
908
  <title-part lang="en">
909
909
 
910
910
 
911
+
911
912
  </title-part>
912
913
  <title-part lang="fr">
913
914
 
914
915
 
916
+
915
917
  </title-part>
916
918
  <title-part lang="zh">第 # 部分:</title-part>
917
919
 
920
+ <title-subpart lang="en">
921
+
922
+ </title-subpart>
923
+ <title-subpart lang="fr">
924
+
925
+ </title-subpart>
926
+
918
927
  <title-modified lang="en">modified</title-modified>
919
928
  <title-modified lang="fr">modifiée</title-modified>
920
929
 
@@ -1282,6 +1291,7 @@
1282
1291
 
1283
1292
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1284
1293
 
1294
+
1285
1295
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1286
1296
 
1287
1297
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1319,6 +1329,7 @@
1319
1329
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1320
1330
 
1321
1331
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1332
+
1322
1333
 
1323
1334
 
1324
1335
 
@@ -1449,7 +1460,9 @@
1449
1460
 
1450
1461
 
1451
1462
 
1452
-
1463
+ <!-- <xsl:if test="$namespace = 'bipm'">
1464
+ <fo:block>&#xA0;</fo:block>
1465
+ </xsl:if> -->
1453
1466
 
1454
1467
  <!-- $namespace = 'iso' or -->
1455
1468
 
@@ -1481,10 +1494,12 @@
1481
1494
 
1482
1495
 
1483
1496
  <xsl:variable name="colwidths">
1484
- <xsl:call-template name="calculate-column-widths">
1485
- <xsl:with-param name="cols-count" select="$cols-count"/>
1486
- <xsl:with-param name="table" select="$simple-table"/>
1487
- </xsl:call-template>
1497
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1498
+ <xsl:call-template name="calculate-column-widths">
1499
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1500
+ <xsl:with-param name="table" select="$simple-table"/>
1501
+ </xsl:call-template>
1502
+ </xsl:if>
1488
1503
  </xsl:variable>
1489
1504
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1490
1505
 
@@ -1529,7 +1544,12 @@
1529
1544
 
1530
1545
  <xsl:variable name="table_attributes">
1531
1546
  <attribute name="table-layout">fixed</attribute>
1532
- <attribute name="width">100%</attribute>
1547
+ <attribute name="width">
1548
+ <xsl:choose>
1549
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
1550
+ <xsl:otherwise>100%</xsl:otherwise>
1551
+ </xsl:choose>
1552
+ </attribute>
1533
1553
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1534
1554
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1535
1555
 
@@ -1561,16 +1581,25 @@
1561
1581
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1562
1582
  </xsl:if>
1563
1583
 
1564
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1565
- <xsl:choose>
1566
- <xsl:when test=". = 1 or . = 0">
1567
- <fo:table-column column-width="proportional-column-width(2)"/>
1568
- </xsl:when>
1569
- <xsl:otherwise>
1570
- <fo:table-column column-width="proportional-column-width({.})"/>
1571
- </xsl:otherwise>
1572
- </xsl:choose>
1573
- </xsl:for-each>
1584
+ <xsl:choose>
1585
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1586
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1587
+ <fo:table-column column-width="{@width}"/>
1588
+ </xsl:for-each>
1589
+ </xsl:when>
1590
+ <xsl:otherwise>
1591
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1592
+ <xsl:choose>
1593
+ <xsl:when test=". = 1 or . = 0">
1594
+ <fo:table-column column-width="proportional-column-width(2)"/>
1595
+ </xsl:when>
1596
+ <xsl:otherwise>
1597
+ <fo:table-column column-width="proportional-column-width({.})"/>
1598
+ </xsl:otherwise>
1599
+ </xsl:choose>
1600
+ </xsl:for-each>
1601
+ </xsl:otherwise>
1602
+ </xsl:choose>
1574
1603
 
1575
1604
  <xsl:choose>
1576
1605
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -1583,10 +1612,12 @@
1583
1612
 
1584
1613
  </fo:table>
1585
1614
 
1615
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1586
1616
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1587
1617
  <xsl:call-template name="insertTableFooterInSeparateTable">
1588
1618
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
1589
1619
  <xsl:with-param name="colwidths" select="$colwidths"/>
1620
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1590
1621
  </xsl:call-template>
1591
1622
  </xsl:for-each>
1592
1623
 
@@ -1621,6 +1652,7 @@
1621
1652
  <xsl:if test="normalize-space() != ''">
1622
1653
  <fo:block xsl:use-attribute-sets="table-name-style">
1623
1654
 
1655
+
1624
1656
  <xsl:apply-templates/>
1625
1657
  </fo:block>
1626
1658
  </xsl:if>
@@ -1841,12 +1873,22 @@
1841
1873
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1842
1874
  <xsl:param name="table_attributes"/>
1843
1875
  <xsl:param name="colwidths"/>
1876
+ <xsl:param name="colgroup"/>
1844
1877
 
1845
1878
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1846
1879
 
1847
1880
  <xsl:if test="$isNoteOrFnExist = 'true'">
1848
1881
 
1849
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1882
+ <xsl:variable name="cols-count">
1883
+ <xsl:choose>
1884
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1885
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
1886
+ </xsl:when>
1887
+ <xsl:otherwise>
1888
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
1889
+ </xsl:otherwise>
1890
+ </xsl:choose>
1891
+ </xsl:variable>
1850
1892
 
1851
1893
  <fo:table keep-with-previous="always">
1852
1894
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -1864,16 +1906,25 @@
1864
1906
  </xsl:choose>
1865
1907
  </xsl:for-each>
1866
1908
 
1867
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1868
- <xsl:choose>
1869
- <xsl:when test=". = 1 or . = 0">
1870
- <fo:table-column column-width="proportional-column-width(2)"/>
1871
- </xsl:when>
1872
- <xsl:otherwise>
1873
- <fo:table-column column-width="proportional-column-width({.})"/>
1874
- </xsl:otherwise>
1875
- </xsl:choose>
1876
- </xsl:for-each>
1909
+ <xsl:choose>
1910
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1911
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
1912
+ <fo:table-column column-width="{@width}"/>
1913
+ </xsl:for-each>
1914
+ </xsl:when>
1915
+ <xsl:otherwise>
1916
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1917
+ <xsl:choose>
1918
+ <xsl:when test=". = 1 or . = 0">
1919
+ <fo:table-column column-width="proportional-column-width(2)"/>
1920
+ </xsl:when>
1921
+ <xsl:otherwise>
1922
+ <fo:table-column column-width="proportional-column-width({.})"/>
1923
+ </xsl:otherwise>
1924
+ </xsl:choose>
1925
+ </xsl:for-each>
1926
+ </xsl:otherwise>
1927
+ </xsl:choose>
1877
1928
 
1878
1929
  <fo:table-body>
1879
1930
  <fo:table-row>
@@ -1974,6 +2025,7 @@
1974
2025
 
1975
2026
 
1976
2027
 
2028
+
1977
2029
  <!-- <xsl:if test="$namespace = 'bipm'">
1978
2030
  <xsl:attribute name="height">8mm</xsl:attribute>
1979
2031
  </xsl:if> -->
@@ -2069,7 +2121,8 @@
2069
2121
  </xsl:attribute>
2070
2122
  </xsl:if>
2071
2123
  <xsl:call-template name="display-align"/>
2072
- <fo:block>
2124
+ <fo:block>
2125
+
2073
2126
  <xsl:apply-templates/>
2074
2127
  </fo:block>
2075
2128
  </fo:table-cell>
@@ -2297,7 +2350,13 @@
2297
2350
  <xsl:apply-templates/>
2298
2351
  </fo:inline>
2299
2352
  </xsl:template><xsl:template match="*[local-name()='dl']">
2300
- <fo:block-container margin-left="0mm">
2353
+ <fo:block-container>
2354
+
2355
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2356
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2357
+ </xsl:if>
2358
+
2359
+
2301
2360
  <xsl:if test="parent::*[local-name() = 'note']">
2302
2361
  <xsl:attribute name="margin-left">
2303
2362
  <xsl:choose>
@@ -2307,8 +2366,12 @@
2307
2366
  </xsl:attribute>
2308
2367
 
2309
2368
  </xsl:if>
2310
- <fo:block-container margin-left="0mm">
2311
-
2369
+ <fo:block-container>
2370
+
2371
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2372
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2373
+
2374
+
2312
2375
  <xsl:variable name="parent" select="local-name(..)"/>
2313
2376
 
2314
2377
  <xsl:variable name="key_iso">
@@ -2322,9 +2385,12 @@
2322
2385
  <fo:block margin-bottom="12pt" text-align="left">
2323
2386
 
2324
2387
  <xsl:variable name="title-where">
2325
- <xsl:call-template name="getTitle">
2326
- <xsl:with-param name="name" select="'title-where'"/>
2327
- </xsl:call-template>
2388
+
2389
+
2390
+ <xsl:call-template name="getTitle">
2391
+ <xsl:with-param name="name" select="'title-where'"/>
2392
+ </xsl:call-template>
2393
+
2328
2394
  </xsl:variable>
2329
2395
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2330
2396
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2340,9 +2406,12 @@
2340
2406
 
2341
2407
 
2342
2408
  <xsl:variable name="title-where">
2343
- <xsl:call-template name="getTitle">
2344
- <xsl:with-param name="name" select="'title-where'"/>
2345
- </xsl:call-template>
2409
+
2410
+
2411
+ <xsl:call-template name="getTitle">
2412
+ <xsl:with-param name="name" select="'title-where'"/>
2413
+ </xsl:call-template>
2414
+
2346
2415
  </xsl:variable>
2347
2416
  <xsl:value-of select="$title-where"/>
2348
2417
  </fo:block>
@@ -2353,9 +2422,12 @@
2353
2422
 
2354
2423
 
2355
2424
  <xsl:variable name="title-key">
2356
- <xsl:call-template name="getTitle">
2357
- <xsl:with-param name="name" select="'title-key'"/>
2358
- </xsl:call-template>
2425
+
2426
+
2427
+ <xsl:call-template name="getTitle">
2428
+ <xsl:with-param name="name" select="'title-key'"/>
2429
+ </xsl:call-template>
2430
+
2359
2431
  </xsl:variable>
2360
2432
  <xsl:value-of select="$title-key"/>
2361
2433
  </fo:block>
@@ -2481,12 +2553,32 @@
2481
2553
  </xsl:otherwise>
2482
2554
  </xsl:choose>
2483
2555
  </xsl:template><xsl:template name="getMaxLength_dt">
2484
- <xsl:for-each select="*[local-name()='dt']">
2485
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2486
- <xsl:if test="position() = 1">
2487
- <xsl:value-of select="string-length(normalize-space(.))"/>
2488
- </xsl:if>
2489
- </xsl:for-each>
2556
+ <xsl:variable name="lengths">
2557
+ <xsl:for-each select="*[local-name()='dt']">
2558
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2559
+ <xsl:variable name="attributes">
2560
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2561
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2562
+ </xsl:variable>
2563
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2564
+ </xsl:for-each>
2565
+ </xsl:variable>
2566
+ <xsl:variable name="maxLength">
2567
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2568
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2569
+ <xsl:if test="position() = 1">
2570
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2571
+ </xsl:if>
2572
+ </xsl:for-each> -->
2573
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2574
+ <xsl:sort select="." data-type="number" order="descending"/>
2575
+ <xsl:if test="position() = 1">
2576
+ <xsl:value-of select="."/>
2577
+ </xsl:if>
2578
+ </xsl:for-each>
2579
+ </xsl:variable>
2580
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2581
+ <xsl:value-of select="$maxLength"/>
2490
2582
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2491
2583
  <xsl:param name="key_iso"/>
2492
2584
 
@@ -2601,6 +2693,7 @@
2601
2693
  </fo:inline>
2602
2694
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2603
2695
  <fo:inline font-weight="bold">
2696
+
2604
2697
  <xsl:apply-templates/>
2605
2698
  </fo:inline>
2606
2699
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2640,6 +2733,10 @@
2640
2733
  </xsl:if>
2641
2734
  <xsl:apply-templates/>
2642
2735
  </fo:inline>
2736
+ </xsl:template><xsl:template match="*[local-name()='underline']">
2737
+ <fo:inline text-decoration="underline">
2738
+ <xsl:apply-templates/>
2739
+ </fo:inline>
2643
2740
  </xsl:template><xsl:template match="*[local-name()='del']">
2644
2741
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2645
2742
  <xsl:apply-templates/>
@@ -2929,7 +3026,18 @@
2929
3026
  <xsl:with-param name="previousRow" select="$newRow"/>
2930
3027
  </xsl:apply-templates>
2931
3028
  </xsl:template><xsl:template name="getLang">
2932
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3029
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3030
+ <xsl:variable name="language">
3031
+ <xsl:choose>
3032
+ <xsl:when test="$language_current != ''">
3033
+ <xsl:value-of select="$language_current"/>
3034
+ </xsl:when>
3035
+ <xsl:otherwise>
3036
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3037
+ </xsl:otherwise>
3038
+ </xsl:choose>
3039
+ </xsl:variable>
3040
+
2933
3041
  <xsl:choose>
2934
3042
  <xsl:when test="$language = 'English'">en</xsl:when>
2935
3043
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2964,6 +3072,7 @@
2964
3072
  <xsl:value-of select="substring($str, 2)"/>
2965
3073
  </xsl:template><xsl:template match="mathml:math">
2966
3074
  <fo:inline font-family="STIX Two Math"> <!-- -->
3075
+
2967
3076
  <xsl:variable name="mathml">
2968
3077
  <xsl:apply-templates select="." mode="mathml"/>
2969
3078
  </xsl:variable>
@@ -2993,6 +3102,7 @@
2993
3102
  </xsl:choose>
2994
3103
  </xsl:variable>
2995
3104
  <fo:inline xsl:use-attribute-sets="link-style">
3105
+
2996
3106
  <xsl:choose>
2997
3107
  <xsl:when test="$target = ''">
2998
3108
  <xsl:apply-templates/>
@@ -3046,10 +3156,14 @@
3046
3156
  </fo:inline>
3047
3157
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3048
3158
  <xsl:variable name="title-modified">
3049
- <xsl:call-template name="getTitle">
3050
- <xsl:with-param name="name" select="'title-modified'"/>
3051
- </xsl:call-template>
3159
+
3160
+
3161
+ <xsl:call-template name="getTitle">
3162
+ <xsl:with-param name="name" select="'title-modified'"/>
3163
+ </xsl:call-template>
3164
+
3052
3165
  </xsl:variable>
3166
+
3053
3167
  <xsl:choose>
3054
3168
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3055
3169
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -3206,7 +3320,8 @@
3206
3320
  </fo:inline>
3207
3321
  </xsl:if>
3208
3322
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
3209
- <fo:block-container id="{@id}">
3323
+ <fo:block-container id="{@id}">
3324
+
3210
3325
  <fo:block>
3211
3326
  <xsl:apply-templates/>
3212
3327
  </fo:block>
@@ -3257,7 +3372,7 @@
3257
3372
  <xsl:apply-templates mode="bookmarks"/>
3258
3373
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3259
3374
  <xsl:apply-templates select="."/>
3260
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3375
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3261
3376
  <xsl:apply-templates mode="bookmarks"/>
3262
3377
  </xsl:template><xsl:template name="addBookmarks">
3263
3378
  <xsl:param name="contents"/>
@@ -3273,6 +3388,8 @@
3273
3388
  <xsl:variable name="bookmark-title_">
3274
3389
  <xsl:call-template name="getLangVersion">
3275
3390
  <xsl:with-param name="lang" select="@lang"/>
3391
+ <xsl:with-param name="doctype" select="@doctype"/>
3392
+ <xsl:with-param name="title" select="@title-part"/>
3276
3393
  </xsl:call-template>
3277
3394
  </xsl:variable>
3278
3395
  <xsl:choose>
@@ -3290,13 +3407,34 @@
3290
3407
  </xsl:choose>
3291
3408
  </fo:bookmark-title>
3292
3409
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3410
+
3411
+ <xsl:call-template name="insertFigureBookmarks">
3412
+ <xsl:with-param name="contents" select="contents"/>
3413
+ </xsl:call-template>
3414
+
3415
+ <xsl:call-template name="insertTableBookmarks">
3416
+ <xsl:with-param name="contents" select="contents"/>
3417
+ <xsl:with-param name="lang" select="@lang"/>
3418
+ </xsl:call-template>
3419
+
3293
3420
  </fo:bookmark>
3294
3421
 
3295
3422
  </xsl:for-each>
3296
3423
  </xsl:when>
3297
3424
  <xsl:otherwise>
3298
3425
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3426
+
3299
3427
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3428
+
3429
+ <xsl:call-template name="insertFigureBookmarks">
3430
+ <xsl:with-param name="contents" select="contents"/>
3431
+ </xsl:call-template>
3432
+
3433
+ <xsl:call-template name="insertTableBookmarks">
3434
+ <xsl:with-param name="contents" select="contents"/>
3435
+ <xsl:with-param name="lang" select="@lang"/>
3436
+ </xsl:call-template>
3437
+
3300
3438
  </xsl:for-each>
3301
3439
  </xsl:otherwise>
3302
3440
  </xsl:choose>
@@ -3326,8 +3464,44 @@
3326
3464
 
3327
3465
  </fo:bookmark-tree>
3328
3466
  </xsl:if>
3467
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3468
+ <xsl:param name="contents"/>
3469
+ <xsl:if test="xalan:nodeset($contents)/figure">
3470
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3471
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3472
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3473
+ <fo:bookmark internal-destination="{@id}">
3474
+ <fo:bookmark-title>
3475
+ <xsl:value-of select="normalize-space(title)"/>
3476
+ </fo:bookmark-title>
3477
+ </fo:bookmark>
3478
+ </xsl:for-each>
3479
+ </fo:bookmark>
3480
+ </xsl:if>
3481
+ </xsl:template><xsl:template name="insertTableBookmarks">
3482
+ <xsl:param name="contents"/>
3483
+ <xsl:param name="lang"/>
3484
+ <xsl:if test="xalan:nodeset($contents)/table">
3485
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3486
+ <fo:bookmark-title>
3487
+ <xsl:choose>
3488
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3489
+ <xsl:otherwise>Tables</xsl:otherwise>
3490
+ </xsl:choose>
3491
+ </fo:bookmark-title>
3492
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3493
+ <fo:bookmark internal-destination="{@id}">
3494
+ <fo:bookmark-title>
3495
+ <xsl:value-of select="normalize-space(title)"/>
3496
+ </fo:bookmark-title>
3497
+ </fo:bookmark>
3498
+ </xsl:for-each>
3499
+ </fo:bookmark>
3500
+ </xsl:if>
3329
3501
  </xsl:template><xsl:template name="getLangVersion">
3330
3502
  <xsl:param name="lang"/>
3503
+ <xsl:param name="doctype" select="''"/>
3504
+ <xsl:param name="title" select="''"/>
3331
3505
  <xsl:choose>
3332
3506
  <xsl:when test="$lang = 'en'">
3333
3507
 
@@ -3799,9 +3973,14 @@
3799
3973
 
3800
3974
  <fo:inline>
3801
3975
 
3802
- <xsl:call-template name="getTitle">
3803
- <xsl:with-param name="name" select="'title-source'"/>
3804
- </xsl:call-template>
3976
+
3977
+
3978
+
3979
+ <xsl:call-template name="getTitle">
3980
+ <xsl:with-param name="name" select="'title-source'"/>
3981
+ </xsl:call-template>
3982
+
3983
+
3805
3984
  <xsl:text>: </xsl:text>
3806
3985
  </fo:inline>
3807
3986
 
@@ -3826,7 +4005,8 @@
3826
4005
  <fo:block-container margin-left="0mm">
3827
4006
 
3828
4007
  <fo:block xsl:use-attribute-sets="quote-style">
3829
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4008
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4009
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3830
4010
  </fo:block>
3831
4011
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3832
4012
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -3957,9 +4137,12 @@
3957
4137
  </fo:block>
3958
4138
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3959
4139
  <xsl:variable name="title-deprecated">
3960
- <xsl:call-template name="getTitle">
3961
- <xsl:with-param name="name" select="'title-deprecated'"/>
3962
- </xsl:call-template>
4140
+
4141
+
4142
+ <xsl:call-template name="getTitle">
4143
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4144
+ </xsl:call-template>
4145
+
3963
4146
  </xsl:variable>
3964
4147
  <fo:block xsl:use-attribute-sets="deprecates-style">
3965
4148
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4013,7 +4196,7 @@
4013
4196
  <fo:block id="{@id}">
4014
4197
  <xsl:apply-templates/>
4015
4198
  </fo:block>
4016
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4199
+ </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']">
4017
4200
 
4018
4201
  <fo:block id="{@id}">
4019
4202
  <xsl:apply-templates/>
@@ -4070,7 +4253,8 @@
4070
4253
  <fo:table-column column-width="107mm"/>
4071
4254
  <fo:table-column column-width="15mm"/>
4072
4255
  <fo:table-body>
4073
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4256
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4257
+
4074
4258
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
4075
4259
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
4076
4260
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -4089,6 +4273,10 @@
4089
4273
  </fo:table-cell>
4090
4274
  </xsl:template><xsl:template name="processBibitem">
4091
4275
 
4276
+
4277
+ <!-- end BIPM bibitem processing-->
4278
+
4279
+
4092
4280
  <!-- start OGC bibtem processing -->
4093
4281
  <xsl:choose>
4094
4282
  <xsl:when test="*[local-name() = 'formattedref']">
@@ -4286,6 +4474,8 @@
4286
4474
  <xsl:value-of select="translate(.,'. ','')"/>
4287
4475
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4288
4476
  <xsl:value-of select="substring(.,1,1)"/>
4477
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4478
+ <fo:inline><xsl:apply-templates/></fo:inline>
4289
4479
  </xsl:template><xsl:template name="convertDate">
4290
4480
  <xsl:param name="date"/>
4291
4481
  <xsl:param name="format" select="'short'"/>
@@ -4465,13 +4655,22 @@
4465
4655
  </xsl:template><xsl:template name="split">
4466
4656
  <xsl:param name="pText" select="."/>
4467
4657
  <xsl:param name="sep" select="','"/>
4658
+ <xsl:param name="normalize-space" select="'true'"/>
4468
4659
  <xsl:if test="string-length($pText) &gt;0">
4469
4660
  <item>
4470
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4661
+ <xsl:choose>
4662
+ <xsl:when test="$normalize-space = 'true'">
4663
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4664
+ </xsl:when>
4665
+ <xsl:otherwise>
4666
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4667
+ </xsl:otherwise>
4668
+ </xsl:choose>
4471
4669
  </item>
4472
4670
  <xsl:call-template name="split">
4473
4671
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4474
4672
  <xsl:with-param name="sep" select="$sep"/>
4673
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4475
4674
  </xsl:call-template>
4476
4675
  </xsl:if>
4477
4676
  </xsl:template><xsl:template name="getDocumentId">
@@ -4537,4 +4736,28 @@
4537
4736
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4538
4737
  </xsl:call-template>
4539
4738
  </xsl:if>
4739
+ </xsl:template><xsl:template name="repeat">
4740
+ <xsl:param name="char" select="'*'"/>
4741
+ <xsl:param name="count"/>
4742
+ <xsl:if test="$count &gt; 0">
4743
+ <xsl:value-of select="$char"/>
4744
+ <xsl:call-template name="repeat">
4745
+ <xsl:with-param name="char" select="$char"/>
4746
+ <xsl:with-param name="count" select="$count - 1"/>
4747
+ </xsl:call-template>
4748
+ </xsl:if>
4749
+ </xsl:template><xsl:template name="getLocalizedString">
4750
+ <xsl:param name="key"/>
4751
+
4752
+ <xsl:variable name="curr_lang">
4753
+ <xsl:call-template name="getLang"/>
4754
+ </xsl:variable>
4755
+
4756
+ <xsl:choose>
4757
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
4758
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4759
+ </xsl:when>
4760
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
4761
+ </xsl:choose>
4762
+
4540
4763
  </xsl:template></xsl:stylesheet>