metanorma-ogc 1.2.5 → 1.2.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +62 -0
  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 +36 -43
  8. data/lib/isodoc/ogc/base_convert.rb +1 -2
  9. data/lib/isodoc/ogc/biblio.rb +1 -0
  10. data/lib/isodoc/ogc/html/htmlstyle.css +210 -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 +319 -74
  22. data/lib/isodoc/ogc/ogc.best-practice.xsl +319 -74
  23. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +319 -74
  24. data/lib/isodoc/ogc/ogc.community-practice.xsl +319 -74
  25. data/lib/isodoc/ogc/ogc.community-standard.xsl +319 -74
  26. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +319 -74
  27. data/lib/isodoc/ogc/ogc.engineering-report.xsl +319 -74
  28. data/lib/isodoc/ogc/ogc.other.xsl +319 -74
  29. data/lib/isodoc/ogc/ogc.policy.xsl +319 -74
  30. data/lib/isodoc/ogc/ogc.reference-model.xsl +319 -74
  31. data/lib/isodoc/ogc/ogc.release-notes.xsl +319 -74
  32. data/lib/isodoc/ogc/ogc.standard.xsl +319 -74
  33. data/lib/isodoc/ogc/ogc.test-suite.xsl +319 -74
  34. data/lib/isodoc/ogc/ogc.user-guide.xsl +319 -74
  35. data/lib/isodoc/ogc/ogc.white-paper.xsl +299 -68
  36. data/lib/isodoc/ogc/presentation_xml_convert.rb +13 -0
  37. data/lib/isodoc/ogc/word_convert.rb +7 -1
  38. data/lib/metanorma/ogc.rb +7 -0
  39. data/lib/metanorma/ogc/processor.rb +16 -8
  40. data/lib/metanorma/ogc/version.rb +1 -1
  41. data/metanorma-ogc.gemspec +2 -2
  42. metadata +7 -9
  43. data/.github/workflows/macos.yml +0 -38
  44. data/.github/workflows/ubuntu.yml +0 -56
  45. data/.github/workflows/windows.yml +0 -40
@@ -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
 
@@ -1238,6 +1247,7 @@
1238
1247
 
1239
1248
 
1240
1249
 
1250
+
1241
1251
  </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
1242
1252
 
1243
1253
 
@@ -1281,6 +1291,7 @@
1281
1291
 
1282
1292
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1283
1293
 
1294
+
1284
1295
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1285
1296
 
1286
1297
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1318,6 +1329,7 @@
1318
1329
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1319
1330
 
1320
1331
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1332
+
1321
1333
 
1322
1334
 
1323
1335
 
@@ -1448,7 +1460,9 @@
1448
1460
 
1449
1461
 
1450
1462
 
1451
-
1463
+ <!-- <xsl:if test="$namespace = 'bipm'">
1464
+ <fo:block>&#xA0;</fo:block>
1465
+ </xsl:if> -->
1452
1466
 
1453
1467
  <!-- $namespace = 'iso' or -->
1454
1468
 
@@ -1480,10 +1494,12 @@
1480
1494
 
1481
1495
 
1482
1496
  <xsl:variable name="colwidths">
1483
- <xsl:call-template name="calculate-column-widths">
1484
- <xsl:with-param name="cols-count" select="$cols-count"/>
1485
- <xsl:with-param name="table" select="$simple-table"/>
1486
- </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>
1487
1503
  </xsl:variable>
1488
1504
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1489
1505
 
@@ -1560,16 +1576,25 @@
1560
1576
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1561
1577
  </xsl:if>
1562
1578
 
1563
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1564
- <xsl:choose>
1565
- <xsl:when test=". = 1 or . = 0">
1566
- <fo:table-column column-width="proportional-column-width(2)"/>
1567
- </xsl:when>
1568
- <xsl:otherwise>
1569
- <fo:table-column column-width="proportional-column-width({.})"/>
1570
- </xsl:otherwise>
1571
- </xsl:choose>
1572
- </xsl:for-each>
1579
+ <xsl:choose>
1580
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1581
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1582
+ <fo:table-column column-width="{@width}"/>
1583
+ </xsl:for-each>
1584
+ </xsl:when>
1585
+ <xsl:otherwise>
1586
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1587
+ <xsl:choose>
1588
+ <xsl:when test=". = 1 or . = 0">
1589
+ <fo:table-column column-width="proportional-column-width(2)"/>
1590
+ </xsl:when>
1591
+ <xsl:otherwise>
1592
+ <fo:table-column column-width="proportional-column-width({.})"/>
1593
+ </xsl:otherwise>
1594
+ </xsl:choose>
1595
+ </xsl:for-each>
1596
+ </xsl:otherwise>
1597
+ </xsl:choose>
1573
1598
 
1574
1599
  <xsl:choose>
1575
1600
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -1582,10 +1607,12 @@
1582
1607
 
1583
1608
  </fo:table>
1584
1609
 
1610
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1585
1611
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1586
1612
  <xsl:call-template name="insertTableFooterInSeparateTable">
1587
1613
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
1588
1614
  <xsl:with-param name="colwidths" select="$colwidths"/>
1615
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1589
1616
  </xsl:call-template>
1590
1617
  </xsl:for-each>
1591
1618
 
@@ -1620,6 +1647,7 @@
1620
1647
  <xsl:if test="normalize-space() != ''">
1621
1648
  <fo:block xsl:use-attribute-sets="table-name-style">
1622
1649
 
1650
+
1623
1651
  <xsl:apply-templates/>
1624
1652
  </fo:block>
1625
1653
  </xsl:if>
@@ -1802,12 +1830,26 @@
1802
1830
 
1803
1831
 
1804
1832
 
1805
- <!-- except gb and bipm -->
1806
1833
 
1807
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1808
1834
 
1809
1835
 
1836
+ <!-- except gb -->
1810
1837
 
1838
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1839
+
1840
+
1841
+ <!-- show Note under table in preface (ex. abstract) sections -->
1842
+ <!-- empty, because notes show at page side in main sections -->
1843
+ <!-- <xsl:if test="$namespace = 'bipm'">
1844
+ <xsl:choose>
1845
+ <xsl:when test="ancestor::*[local-name()='preface']">
1846
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1847
+ </xsl:when>
1848
+ <xsl:otherwise>
1849
+ <fo:block/>
1850
+ </xsl:otherwise>
1851
+ </xsl:choose>
1852
+ </xsl:if> -->
1811
1853
 
1812
1854
 
1813
1855
  <!-- horizontal row separator -->
@@ -1826,12 +1868,22 @@
1826
1868
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1827
1869
  <xsl:param name="table_attributes"/>
1828
1870
  <xsl:param name="colwidths"/>
1871
+ <xsl:param name="colgroup"/>
1829
1872
 
1830
1873
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1831
1874
 
1832
1875
  <xsl:if test="$isNoteOrFnExist = 'true'">
1833
1876
 
1834
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1877
+ <xsl:variable name="cols-count">
1878
+ <xsl:choose>
1879
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1880
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
1881
+ </xsl:when>
1882
+ <xsl:otherwise>
1883
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
1884
+ </xsl:otherwise>
1885
+ </xsl:choose>
1886
+ </xsl:variable>
1835
1887
 
1836
1888
  <fo:table keep-with-previous="always">
1837
1889
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -1849,16 +1901,25 @@
1849
1901
  </xsl:choose>
1850
1902
  </xsl:for-each>
1851
1903
 
1852
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1853
- <xsl:choose>
1854
- <xsl:when test=". = 1 or . = 0">
1855
- <fo:table-column column-width="proportional-column-width(2)"/>
1856
- </xsl:when>
1857
- <xsl:otherwise>
1858
- <fo:table-column column-width="proportional-column-width({.})"/>
1859
- </xsl:otherwise>
1860
- </xsl:choose>
1861
- </xsl:for-each>
1904
+ <xsl:choose>
1905
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1906
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
1907
+ <fo:table-column column-width="{@width}"/>
1908
+ </xsl:for-each>
1909
+ </xsl:when>
1910
+ <xsl:otherwise>
1911
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1912
+ <xsl:choose>
1913
+ <xsl:when test=". = 1 or . = 0">
1914
+ <fo:table-column column-width="proportional-column-width(2)"/>
1915
+ </xsl:when>
1916
+ <xsl:otherwise>
1917
+ <fo:table-column column-width="proportional-column-width({.})"/>
1918
+ </xsl:otherwise>
1919
+ </xsl:choose>
1920
+ </xsl:for-each>
1921
+ </xsl:otherwise>
1922
+ </xsl:choose>
1862
1923
 
1863
1924
  <fo:table-body>
1864
1925
  <fo:table-row>
@@ -1870,7 +1931,11 @@
1870
1931
 
1871
1932
 
1872
1933
 
1873
- <!-- except gb and bipm -->
1934
+
1935
+
1936
+
1937
+
1938
+ <!-- except gb -->
1874
1939
 
1875
1940
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1876
1941
 
@@ -1956,6 +2021,10 @@
1956
2021
 
1957
2022
 
1958
2023
 
2024
+ <!-- <xsl:if test="$namespace = 'bipm'">
2025
+ <xsl:attribute name="height">8mm</xsl:attribute>
2026
+ </xsl:if> -->
2027
+
1959
2028
  <xsl:apply-templates/>
1960
2029
  </fo:table-row>
1961
2030
  </xsl:template><xsl:template match="*[local-name()='th']">
@@ -2047,7 +2116,8 @@
2047
2116
  </xsl:attribute>
2048
2117
  </xsl:if>
2049
2118
  <xsl:call-template name="display-align"/>
2050
- <fo:block>
2119
+ <fo:block>
2120
+
2051
2121
  <xsl:apply-templates/>
2052
2122
  </fo:block>
2053
2123
  </fo:table-cell>
@@ -2275,7 +2345,13 @@
2275
2345
  <xsl:apply-templates/>
2276
2346
  </fo:inline>
2277
2347
  </xsl:template><xsl:template match="*[local-name()='dl']">
2278
- <fo:block-container margin-left="0mm">
2348
+ <fo:block-container>
2349
+
2350
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2351
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2352
+ </xsl:if>
2353
+
2354
+
2279
2355
  <xsl:if test="parent::*[local-name() = 'note']">
2280
2356
  <xsl:attribute name="margin-left">
2281
2357
  <xsl:choose>
@@ -2285,8 +2361,12 @@
2285
2361
  </xsl:attribute>
2286
2362
 
2287
2363
  </xsl:if>
2288
- <fo:block-container margin-left="0mm">
2289
-
2364
+ <fo:block-container>
2365
+
2366
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2367
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2368
+
2369
+
2290
2370
  <xsl:variable name="parent" select="local-name(..)"/>
2291
2371
 
2292
2372
  <xsl:variable name="key_iso">
@@ -2300,9 +2380,12 @@
2300
2380
  <fo:block margin-bottom="12pt" text-align="left">
2301
2381
 
2302
2382
  <xsl:variable name="title-where">
2303
- <xsl:call-template name="getTitle">
2304
- <xsl:with-param name="name" select="'title-where'"/>
2305
- </xsl:call-template>
2383
+
2384
+
2385
+ <xsl:call-template name="getTitle">
2386
+ <xsl:with-param name="name" select="'title-where'"/>
2387
+ </xsl:call-template>
2388
+
2306
2389
  </xsl:variable>
2307
2390
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2308
2391
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2318,9 +2401,12 @@
2318
2401
 
2319
2402
 
2320
2403
  <xsl:variable name="title-where">
2321
- <xsl:call-template name="getTitle">
2322
- <xsl:with-param name="name" select="'title-where'"/>
2323
- </xsl:call-template>
2404
+
2405
+
2406
+ <xsl:call-template name="getTitle">
2407
+ <xsl:with-param name="name" select="'title-where'"/>
2408
+ </xsl:call-template>
2409
+
2324
2410
  </xsl:variable>
2325
2411
  <xsl:value-of select="$title-where"/>
2326
2412
  </fo:block>
@@ -2331,9 +2417,12 @@
2331
2417
 
2332
2418
 
2333
2419
  <xsl:variable name="title-key">
2334
- <xsl:call-template name="getTitle">
2335
- <xsl:with-param name="name" select="'title-key'"/>
2336
- </xsl:call-template>
2420
+
2421
+
2422
+ <xsl:call-template name="getTitle">
2423
+ <xsl:with-param name="name" select="'title-key'"/>
2424
+ </xsl:call-template>
2425
+
2337
2426
  </xsl:variable>
2338
2427
  <xsl:value-of select="$title-key"/>
2339
2428
  </fo:block>
@@ -2459,12 +2548,32 @@
2459
2548
  </xsl:otherwise>
2460
2549
  </xsl:choose>
2461
2550
  </xsl:template><xsl:template name="getMaxLength_dt">
2462
- <xsl:for-each select="*[local-name()='dt']">
2463
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2464
- <xsl:if test="position() = 1">
2465
- <xsl:value-of select="string-length(normalize-space(.))"/>
2466
- </xsl:if>
2467
- </xsl:for-each>
2551
+ <xsl:variable name="lengths">
2552
+ <xsl:for-each select="*[local-name()='dt']">
2553
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2554
+ <xsl:variable name="attributes">
2555
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2556
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2557
+ </xsl:variable>
2558
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2559
+ </xsl:for-each>
2560
+ </xsl:variable>
2561
+ <xsl:variable name="maxLength">
2562
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2563
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2564
+ <xsl:if test="position() = 1">
2565
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2566
+ </xsl:if>
2567
+ </xsl:for-each> -->
2568
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2569
+ <xsl:sort select="." data-type="number" order="descending"/>
2570
+ <xsl:if test="position() = 1">
2571
+ <xsl:value-of select="."/>
2572
+ </xsl:if>
2573
+ </xsl:for-each>
2574
+ </xsl:variable>
2575
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2576
+ <xsl:value-of select="$maxLength"/>
2468
2577
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2469
2578
  <xsl:param name="key_iso"/>
2470
2579
 
@@ -2579,6 +2688,7 @@
2579
2688
  </fo:inline>
2580
2689
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2581
2690
  <fo:inline font-weight="bold">
2691
+
2582
2692
  <xsl:apply-templates/>
2583
2693
  </fo:inline>
2584
2694
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2907,7 +3017,18 @@
2907
3017
  <xsl:with-param name="previousRow" select="$newRow"/>
2908
3018
  </xsl:apply-templates>
2909
3019
  </xsl:template><xsl:template name="getLang">
2910
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3020
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3021
+ <xsl:variable name="language">
3022
+ <xsl:choose>
3023
+ <xsl:when test="$language_current != ''">
3024
+ <xsl:value-of select="$language_current"/>
3025
+ </xsl:when>
3026
+ <xsl:otherwise>
3027
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3028
+ </xsl:otherwise>
3029
+ </xsl:choose>
3030
+ </xsl:variable>
3031
+
2911
3032
  <xsl:choose>
2912
3033
  <xsl:when test="$language = 'English'">en</xsl:when>
2913
3034
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2942,6 +3063,7 @@
2942
3063
  <xsl:value-of select="substring($str, 2)"/>
2943
3064
  </xsl:template><xsl:template match="mathml:math">
2944
3065
  <fo:inline font-family="STIX Two Math"> <!-- -->
3066
+
2945
3067
  <xsl:variable name="mathml">
2946
3068
  <xsl:apply-templates select="." mode="mathml"/>
2947
3069
  </xsl:variable>
@@ -2971,6 +3093,7 @@
2971
3093
  </xsl:choose>
2972
3094
  </xsl:variable>
2973
3095
  <fo:inline xsl:use-attribute-sets="link-style">
3096
+
2974
3097
  <xsl:choose>
2975
3098
  <xsl:when test="$target = ''">
2976
3099
  <xsl:apply-templates/>
@@ -3024,10 +3147,14 @@
3024
3147
  </fo:inline>
3025
3148
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3026
3149
  <xsl:variable name="title-modified">
3027
- <xsl:call-template name="getTitle">
3028
- <xsl:with-param name="name" select="'title-modified'"/>
3029
- </xsl:call-template>
3150
+
3151
+
3152
+ <xsl:call-template name="getTitle">
3153
+ <xsl:with-param name="name" select="'title-modified'"/>
3154
+ </xsl:call-template>
3155
+
3030
3156
  </xsl:variable>
3157
+
3031
3158
  <xsl:choose>
3032
3159
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3033
3160
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -3092,6 +3219,8 @@
3092
3219
 
3093
3220
 
3094
3221
 
3222
+
3223
+
3095
3224
  <fo:inline xsl:use-attribute-sets="note-name-style">
3096
3225
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3097
3226
  </fo:inline>
@@ -3182,7 +3311,8 @@
3182
3311
  </fo:inline>
3183
3312
  </xsl:if>
3184
3313
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
3185
- <fo:block-container id="{@id}">
3314
+ <fo:block-container id="{@id}">
3315
+
3186
3316
  <fo:block>
3187
3317
  <xsl:apply-templates/>
3188
3318
  </fo:block>
@@ -3233,7 +3363,7 @@
3233
3363
  <xsl:apply-templates mode="bookmarks"/>
3234
3364
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3235
3365
  <xsl:apply-templates select="."/>
3236
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3366
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3237
3367
  <xsl:apply-templates mode="bookmarks"/>
3238
3368
  </xsl:template><xsl:template name="addBookmarks">
3239
3369
  <xsl:param name="contents"/>
@@ -3249,6 +3379,8 @@
3249
3379
  <xsl:variable name="bookmark-title_">
3250
3380
  <xsl:call-template name="getLangVersion">
3251
3381
  <xsl:with-param name="lang" select="@lang"/>
3382
+ <xsl:with-param name="doctype" select="@doctype"/>
3383
+ <xsl:with-param name="title" select="@title-part"/>
3252
3384
  </xsl:call-template>
3253
3385
  </xsl:variable>
3254
3386
  <xsl:choose>
@@ -3266,13 +3398,34 @@
3266
3398
  </xsl:choose>
3267
3399
  </fo:bookmark-title>
3268
3400
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3401
+
3402
+ <xsl:call-template name="insertFigureBookmarks">
3403
+ <xsl:with-param name="contents" select="contents"/>
3404
+ </xsl:call-template>
3405
+
3406
+ <xsl:call-template name="insertTableBookmarks">
3407
+ <xsl:with-param name="contents" select="contents"/>
3408
+ <xsl:with-param name="lang" select="@lang"/>
3409
+ </xsl:call-template>
3410
+
3269
3411
  </fo:bookmark>
3270
3412
 
3271
3413
  </xsl:for-each>
3272
3414
  </xsl:when>
3273
3415
  <xsl:otherwise>
3274
3416
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3417
+
3275
3418
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3419
+
3420
+ <xsl:call-template name="insertFigureBookmarks">
3421
+ <xsl:with-param name="contents" select="contents"/>
3422
+ </xsl:call-template>
3423
+
3424
+ <xsl:call-template name="insertTableBookmarks">
3425
+ <xsl:with-param name="contents" select="contents"/>
3426
+ <xsl:with-param name="lang" select="@lang"/>
3427
+ </xsl:call-template>
3428
+
3276
3429
  </xsl:for-each>
3277
3430
  </xsl:otherwise>
3278
3431
  </xsl:choose>
@@ -3302,8 +3455,44 @@
3302
3455
 
3303
3456
  </fo:bookmark-tree>
3304
3457
  </xsl:if>
3458
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3459
+ <xsl:param name="contents"/>
3460
+ <xsl:if test="xalan:nodeset($contents)/figure">
3461
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3462
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3463
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3464
+ <fo:bookmark internal-destination="{@id}">
3465
+ <fo:bookmark-title>
3466
+ <xsl:value-of select="normalize-space(title)"/>
3467
+ </fo:bookmark-title>
3468
+ </fo:bookmark>
3469
+ </xsl:for-each>
3470
+ </fo:bookmark>
3471
+ </xsl:if>
3472
+ </xsl:template><xsl:template name="insertTableBookmarks">
3473
+ <xsl:param name="contents"/>
3474
+ <xsl:param name="lang"/>
3475
+ <xsl:if test="xalan:nodeset($contents)/table">
3476
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3477
+ <fo:bookmark-title>
3478
+ <xsl:choose>
3479
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3480
+ <xsl:otherwise>Tables</xsl:otherwise>
3481
+ </xsl:choose>
3482
+ </fo:bookmark-title>
3483
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3484
+ <fo:bookmark internal-destination="{@id}">
3485
+ <fo:bookmark-title>
3486
+ <xsl:value-of select="normalize-space(title)"/>
3487
+ </fo:bookmark-title>
3488
+ </fo:bookmark>
3489
+ </xsl:for-each>
3490
+ </fo:bookmark>
3491
+ </xsl:if>
3305
3492
  </xsl:template><xsl:template name="getLangVersion">
3306
3493
  <xsl:param name="lang"/>
3494
+ <xsl:param name="doctype" select="''"/>
3495
+ <xsl:param name="title" select="''"/>
3307
3496
  <xsl:choose>
3308
3497
  <xsl:when test="$lang = 'en'">
3309
3498
 
@@ -3775,9 +3964,14 @@
3775
3964
 
3776
3965
  <fo:inline>
3777
3966
 
3778
- <xsl:call-template name="getTitle">
3779
- <xsl:with-param name="name" select="'title-source'"/>
3780
- </xsl:call-template>
3967
+
3968
+
3969
+
3970
+ <xsl:call-template name="getTitle">
3971
+ <xsl:with-param name="name" select="'title-source'"/>
3972
+ </xsl:call-template>
3973
+
3974
+
3781
3975
  <xsl:text>: </xsl:text>
3782
3976
  </fo:inline>
3783
3977
 
@@ -3802,7 +3996,8 @@
3802
3996
  <fo:block-container margin-left="0mm">
3803
3997
 
3804
3998
  <fo:block xsl:use-attribute-sets="quote-style">
3805
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3999
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4000
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3806
4001
  </fo:block>
3807
4002
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3808
4003
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -3933,9 +4128,12 @@
3933
4128
  </fo:block>
3934
4129
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3935
4130
  <xsl:variable name="title-deprecated">
3936
- <xsl:call-template name="getTitle">
3937
- <xsl:with-param name="name" select="'title-deprecated'"/>
3938
- </xsl:call-template>
4131
+
4132
+
4133
+ <xsl:call-template name="getTitle">
4134
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4135
+ </xsl:call-template>
4136
+
3939
4137
  </xsl:variable>
3940
4138
  <fo:block xsl:use-attribute-sets="deprecates-style">
3941
4139
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -3989,7 +4187,7 @@
3989
4187
  <fo:block id="{@id}">
3990
4188
  <xsl:apply-templates/>
3991
4189
  </fo:block>
3992
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4190
+ </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']">
3993
4191
 
3994
4192
  <fo:block id="{@id}">
3995
4193
  <xsl:apply-templates/>
@@ -4046,7 +4244,8 @@
4046
4244
  <fo:table-column column-width="107mm"/>
4047
4245
  <fo:table-column column-width="15mm"/>
4048
4246
  <fo:table-body>
4049
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4247
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4248
+
4050
4249
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
4051
4250
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
4052
4251
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -4065,6 +4264,10 @@
4065
4264
  </fo:table-cell>
4066
4265
  </xsl:template><xsl:template name="processBibitem">
4067
4266
 
4267
+
4268
+ <!-- end BIPM bibitem processing-->
4269
+
4270
+
4068
4271
  <!-- start OGC bibtem processing -->
4069
4272
  <xsl:choose>
4070
4273
  <xsl:when test="*[local-name() = 'formattedref']">
@@ -4441,13 +4644,22 @@
4441
4644
  </xsl:template><xsl:template name="split">
4442
4645
  <xsl:param name="pText" select="."/>
4443
4646
  <xsl:param name="sep" select="','"/>
4647
+ <xsl:param name="normalize-space" select="'true'"/>
4444
4648
  <xsl:if test="string-length($pText) &gt;0">
4445
4649
  <item>
4446
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4650
+ <xsl:choose>
4651
+ <xsl:when test="$normalize-space = 'true'">
4652
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4653
+ </xsl:when>
4654
+ <xsl:otherwise>
4655
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4656
+ </xsl:otherwise>
4657
+ </xsl:choose>
4447
4658
  </item>
4448
4659
  <xsl:call-template name="split">
4449
4660
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4450
4661
  <xsl:with-param name="sep" select="$sep"/>
4662
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4451
4663
  </xsl:call-template>
4452
4664
  </xsl:if>
4453
4665
  </xsl:template><xsl:template name="getDocumentId">
@@ -4513,4 +4725,23 @@
4513
4725
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4514
4726
  </xsl:call-template>
4515
4727
  </xsl:if>
4728
+ </xsl:template><xsl:template name="repeat">
4729
+ <xsl:param name="char" select="'*'"/>
4730
+ <xsl:param name="count"/>
4731
+ <xsl:if test="$count &gt; 0">
4732
+ <xsl:value-of select="$char"/>
4733
+ <xsl:call-template name="repeat">
4734
+ <xsl:with-param name="char" select="$char"/>
4735
+ <xsl:with-param name="count" select="$count - 1"/>
4736
+ </xsl:call-template>
4737
+ </xsl:if>
4738
+ </xsl:template><xsl:template name="getLocalizedString">
4739
+ <xsl:param name="key"/>
4740
+
4741
+ <xsl:variable name="curr_lang">
4742
+ <xsl:call-template name="getLang"/>
4743
+ </xsl:variable>
4744
+
4745
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4746
+
4516
4747
  </xsl:template></xsl:stylesheet>