metanorma-nist 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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +29 -8
  3. data/.github/workflows/release.yml +36 -0
  4. data/README.adoc +23 -7
  5. data/lib/asciidoctor/nist/basicdoc.rng +50 -3
  6. data/lib/asciidoctor/nist/boilerplate.rb +3 -1
  7. data/lib/asciidoctor/nist/cleanup.rb +2 -1
  8. data/lib/asciidoctor/nist/converter.rb +3 -0
  9. data/lib/asciidoctor/nist/front.rb +36 -45
  10. data/lib/asciidoctor/nist/front_id.rb +18 -7
  11. data/lib/asciidoctor/nist/isodoc.rng +61 -3
  12. data/lib/asciidoctor/nist/nist.rng +1 -0
  13. data/lib/asciidoctor/nist/validate.rb +17 -6
  14. data/lib/isodoc/nist/base_convert.rb +2 -3
  15. data/lib/isodoc/nist/fonts_manifest.yaml +4 -0
  16. data/lib/isodoc/nist/html/header_cswp.html +2 -3
  17. data/lib/isodoc/nist/html/htmlstyle.css +221 -221
  18. data/lib/isodoc/nist/html/htmlstyle.scss +5 -6
  19. data/lib/isodoc/nist/html/nist.css +49 -50
  20. data/lib/isodoc/nist/html/nist.scss +49 -50
  21. data/lib/isodoc/nist/html/nist_cswp.css +48 -49
  22. data/lib/isodoc/nist/html/nist_cswp.scss +48 -49
  23. data/lib/isodoc/nist/html/wordstyle.css +42 -42
  24. data/lib/isodoc/nist/html/wordstyle.scss +42 -42
  25. data/lib/isodoc/nist/html/wordstyle_cswp.css +52 -52
  26. data/lib/isodoc/nist/html/wordstyle_cswp.scss +52 -52
  27. data/lib/isodoc/nist/html_convert.rb +12 -1
  28. data/lib/isodoc/nist/metadata.rb +28 -40
  29. data/lib/isodoc/nist/metadata_id.rb +3 -7
  30. data/lib/isodoc/nist/nist.cswp.xsl +319 -154
  31. data/lib/isodoc/nist/nist.sp.xsl +316 -190
  32. data/lib/isodoc/nist/presentation_xml_convert.rb +30 -10
  33. data/lib/isodoc/nist/refs.rb +6 -20
  34. data/lib/isodoc/nist/render.rb +42 -40
  35. data/lib/isodoc/nist/render_dates.rb +8 -9
  36. data/lib/isodoc/nist/word_convert.rb +9 -3
  37. data/lib/isodoc/nist/xref.rb +11 -5
  38. data/lib/metanorma/nist/processor.rb +14 -8
  39. data/lib/metanorma/nist/version.rb +1 -1
  40. data/metanorma-nist.gemspec +2 -2
  41. 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
 
@@ -2558,6 +2474,7 @@
2558
2474
  </xsl:attribute-set><xsl:attribute-set name="term-style">
2559
2475
 
2560
2476
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2477
+
2561
2478
 
2562
2479
 
2563
2480
 
@@ -2677,7 +2594,9 @@
2677
2594
 
2678
2595
 
2679
2596
 
2680
-
2597
+ <!-- <xsl:if test="$namespace = 'bipm'">
2598
+ <fo:block>&#xA0;</fo:block>
2599
+ </xsl:if> -->
2681
2600
 
2682
2601
  <!-- $namespace = 'iso' or -->
2683
2602
 
@@ -2709,10 +2628,12 @@
2709
2628
 
2710
2629
 
2711
2630
  <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>
2631
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2632
+ <xsl:call-template name="calculate-column-widths">
2633
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2634
+ <xsl:with-param name="table" select="$simple-table"/>
2635
+ </xsl:call-template>
2636
+ </xsl:if>
2716
2637
  </xsl:variable>
2717
2638
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2718
2639
 
@@ -2763,7 +2684,12 @@
2763
2684
 
2764
2685
  <xsl:variable name="table_attributes">
2765
2686
  <attribute name="table-layout">fixed</attribute>
2766
- <attribute name="width">100%</attribute>
2687
+ <attribute name="width">
2688
+ <xsl:choose>
2689
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
2690
+ <xsl:otherwise>100%</xsl:otherwise>
2691
+ </xsl:choose>
2692
+ </attribute>
2767
2693
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2768
2694
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2769
2695
 
@@ -2792,16 +2718,25 @@
2792
2718
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2793
2719
  </xsl:if>
2794
2720
 
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>
2721
+ <xsl:choose>
2722
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2723
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2724
+ <fo:table-column column-width="{@width}"/>
2725
+ </xsl:for-each>
2726
+ </xsl:when>
2727
+ <xsl:otherwise>
2728
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2729
+ <xsl:choose>
2730
+ <xsl:when test=". = 1 or . = 0">
2731
+ <fo:table-column column-width="proportional-column-width(2)"/>
2732
+ </xsl:when>
2733
+ <xsl:otherwise>
2734
+ <fo:table-column column-width="proportional-column-width({.})"/>
2735
+ </xsl:otherwise>
2736
+ </xsl:choose>
2737
+ </xsl:for-each>
2738
+ </xsl:otherwise>
2739
+ </xsl:choose>
2805
2740
 
2806
2741
  <xsl:choose>
2807
2742
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -2814,10 +2749,12 @@
2814
2749
 
2815
2750
  </fo:table>
2816
2751
 
2752
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2817
2753
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2818
2754
  <xsl:call-template name="insertTableFooterInSeparateTable">
2819
2755
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
2820
2756
  <xsl:with-param name="colwidths" select="$colwidths"/>
2757
+ <xsl:with-param name="colgroup" select="$colgroup"/>
2821
2758
  </xsl:call-template>
2822
2759
  </xsl:for-each>
2823
2760
 
@@ -2850,6 +2787,7 @@
2850
2787
  <xsl:if test="normalize-space() != ''">
2851
2788
  <fo:block xsl:use-attribute-sets="table-name-style">
2852
2789
 
2790
+
2853
2791
  <xsl:apply-templates/>
2854
2792
  </fo:block>
2855
2793
  </xsl:if>
@@ -3070,12 +3008,22 @@
3070
3008
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
3071
3009
  <xsl:param name="table_attributes"/>
3072
3010
  <xsl:param name="colwidths"/>
3011
+ <xsl:param name="colgroup"/>
3073
3012
 
3074
3013
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3075
3014
 
3076
3015
  <xsl:if test="$isNoteOrFnExist = 'true'">
3077
3016
 
3078
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
3017
+ <xsl:variable name="cols-count">
3018
+ <xsl:choose>
3019
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3020
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
3021
+ </xsl:when>
3022
+ <xsl:otherwise>
3023
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
3024
+ </xsl:otherwise>
3025
+ </xsl:choose>
3026
+ </xsl:variable>
3079
3027
 
3080
3028
  <fo:table keep-with-previous="always">
3081
3029
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -3093,16 +3041,25 @@
3093
3041
  </xsl:choose>
3094
3042
  </xsl:for-each>
3095
3043
 
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>
3044
+ <xsl:choose>
3045
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3046
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
3047
+ <fo:table-column column-width="{@width}"/>
3048
+ </xsl:for-each>
3049
+ </xsl:when>
3050
+ <xsl:otherwise>
3051
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3052
+ <xsl:choose>
3053
+ <xsl:when test=". = 1 or . = 0">
3054
+ <fo:table-column column-width="proportional-column-width(2)"/>
3055
+ </xsl:when>
3056
+ <xsl:otherwise>
3057
+ <fo:table-column column-width="proportional-column-width({.})"/>
3058
+ </xsl:otherwise>
3059
+ </xsl:choose>
3060
+ </xsl:for-each>
3061
+ </xsl:otherwise>
3062
+ </xsl:choose>
3106
3063
 
3107
3064
  <fo:table-body>
3108
3065
  <fo:table-row>
@@ -3206,6 +3163,7 @@
3206
3163
 
3207
3164
 
3208
3165
 
3166
+
3209
3167
  <!-- <xsl:if test="$namespace = 'bipm'">
3210
3168
  <xsl:attribute name="height">8mm</xsl:attribute>
3211
3169
  </xsl:if> -->
@@ -3299,7 +3257,8 @@
3299
3257
  </xsl:attribute>
3300
3258
  </xsl:if>
3301
3259
  <xsl:call-template name="display-align"/>
3302
- <fo:block>
3260
+ <fo:block>
3261
+
3303
3262
  <xsl:apply-templates/>
3304
3263
  </fo:block>
3305
3264
  </fo:table-cell>
@@ -3520,7 +3479,13 @@
3520
3479
  <xsl:apply-templates/>
3521
3480
  </fo:inline>
3522
3481
  </xsl:template><xsl:template match="*[local-name()='dl']">
3523
- <fo:block-container margin-left="0mm">
3482
+ <fo:block-container>
3483
+
3484
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3485
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3486
+ </xsl:if>
3487
+
3488
+
3524
3489
  <xsl:if test="parent::*[local-name() = 'note']">
3525
3490
  <xsl:attribute name="margin-left">
3526
3491
  <xsl:choose>
@@ -3530,8 +3495,12 @@
3530
3495
  </xsl:attribute>
3531
3496
 
3532
3497
  </xsl:if>
3533
- <fo:block-container margin-left="0mm">
3534
-
3498
+ <fo:block-container>
3499
+
3500
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3501
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3502
+
3503
+
3535
3504
  <xsl:variable name="parent" select="local-name(..)"/>
3536
3505
 
3537
3506
  <xsl:variable name="key_iso">
@@ -3545,9 +3514,12 @@
3545
3514
  <fo:block margin-bottom="12pt" text-align="left">
3546
3515
 
3547
3516
  <xsl:variable name="title-where">
3548
- <xsl:call-template name="getTitle">
3549
- <xsl:with-param name="name" select="'title-where'"/>
3550
- </xsl:call-template>
3517
+
3518
+
3519
+ <xsl:call-template name="getTitle">
3520
+ <xsl:with-param name="name" select="'title-where'"/>
3521
+ </xsl:call-template>
3522
+
3551
3523
  </xsl:variable>
3552
3524
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
3553
3525
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -3563,9 +3535,12 @@
3563
3535
 
3564
3536
 
3565
3537
  <xsl:variable name="title-where">
3566
- <xsl:call-template name="getTitle">
3567
- <xsl:with-param name="name" select="'title-where'"/>
3568
- </xsl:call-template>
3538
+
3539
+
3540
+ <xsl:call-template name="getTitle">
3541
+ <xsl:with-param name="name" select="'title-where'"/>
3542
+ </xsl:call-template>
3543
+
3569
3544
  </xsl:variable>
3570
3545
  <xsl:value-of select="$title-where"/>
3571
3546
  </fo:block>
@@ -3576,9 +3551,12 @@
3576
3551
 
3577
3552
 
3578
3553
  <xsl:variable name="title-key">
3579
- <xsl:call-template name="getTitle">
3580
- <xsl:with-param name="name" select="'title-key'"/>
3581
- </xsl:call-template>
3554
+
3555
+
3556
+ <xsl:call-template name="getTitle">
3557
+ <xsl:with-param name="name" select="'title-key'"/>
3558
+ </xsl:call-template>
3559
+
3582
3560
  </xsl:variable>
3583
3561
  <xsl:value-of select="$title-key"/>
3584
3562
  </fo:block>
@@ -3712,12 +3690,32 @@
3712
3690
  </xsl:otherwise>
3713
3691
  </xsl:choose>
3714
3692
  </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>
3693
+ <xsl:variable name="lengths">
3694
+ <xsl:for-each select="*[local-name()='dt']">
3695
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
3696
+ <xsl:variable name="attributes">
3697
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
3698
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
3699
+ </xsl:variable>
3700
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
3701
+ </xsl:for-each>
3702
+ </xsl:variable>
3703
+ <xsl:variable name="maxLength">
3704
+ <!-- <xsl:for-each select="*[local-name()='dt']">
3705
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3706
+ <xsl:if test="position() = 1">
3707
+ <xsl:value-of select="string-length(normalize-space(.))"/>
3708
+ </xsl:if>
3709
+ </xsl:for-each> -->
3710
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
3711
+ <xsl:sort select="." data-type="number" order="descending"/>
3712
+ <xsl:if test="position() = 1">
3713
+ <xsl:value-of select="."/>
3714
+ </xsl:if>
3715
+ </xsl:for-each>
3716
+ </xsl:variable>
3717
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
3718
+ <xsl:value-of select="$maxLength"/>
3721
3719
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
3722
3720
  <xsl:param name="key_iso"/>
3723
3721
 
@@ -3845,6 +3843,7 @@
3845
3843
  </fo:inline>
3846
3844
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
3847
3845
  <fo:inline font-weight="bold">
3846
+
3848
3847
  <xsl:apply-templates/>
3849
3848
  </fo:inline>
3850
3849
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -3884,6 +3883,10 @@
3884
3883
  </xsl:if>
3885
3884
  <xsl:apply-templates/>
3886
3885
  </fo:inline>
3886
+ </xsl:template><xsl:template match="*[local-name()='underline']">
3887
+ <fo:inline text-decoration="underline">
3888
+ <xsl:apply-templates/>
3889
+ </fo:inline>
3887
3890
  </xsl:template><xsl:template match="*[local-name()='del']">
3888
3891
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3889
3892
  <xsl:apply-templates/>
@@ -4173,7 +4176,18 @@
4173
4176
  <xsl:with-param name="previousRow" select="$newRow"/>
4174
4177
  </xsl:apply-templates>
4175
4178
  </xsl:template><xsl:template name="getLang">
4176
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4179
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4180
+ <xsl:variable name="language">
4181
+ <xsl:choose>
4182
+ <xsl:when test="$language_current != ''">
4183
+ <xsl:value-of select="$language_current"/>
4184
+ </xsl:when>
4185
+ <xsl:otherwise>
4186
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4187
+ </xsl:otherwise>
4188
+ </xsl:choose>
4189
+ </xsl:variable>
4190
+
4177
4191
  <xsl:choose>
4178
4192
  <xsl:when test="$language = 'English'">en</xsl:when>
4179
4193
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -4208,6 +4222,7 @@
4208
4222
  <xsl:value-of select="substring($str, 2)"/>
4209
4223
  </xsl:template><xsl:template match="mathml:math">
4210
4224
  <fo:inline font-family="STIX Two Math"> <!-- -->
4225
+
4211
4226
  <xsl:variable name="mathml">
4212
4227
  <xsl:apply-templates select="." mode="mathml"/>
4213
4228
  </xsl:variable>
@@ -4237,6 +4252,7 @@
4237
4252
  </xsl:choose>
4238
4253
  </xsl:variable>
4239
4254
  <fo:inline xsl:use-attribute-sets="link-style">
4255
+
4240
4256
  <xsl:choose>
4241
4257
  <xsl:when test="$target = ''">
4242
4258
  <xsl:apply-templates/>
@@ -4290,10 +4306,14 @@
4290
4306
  </fo:inline>
4291
4307
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
4292
4308
  <xsl:variable name="title-modified">
4293
- <xsl:call-template name="getTitle">
4294
- <xsl:with-param name="name" select="'title-modified'"/>
4295
- </xsl:call-template>
4309
+
4310
+
4311
+ <xsl:call-template name="getTitle">
4312
+ <xsl:with-param name="name" select="'title-modified'"/>
4313
+ </xsl:call-template>
4314
+
4296
4315
  </xsl:variable>
4316
+
4297
4317
  <xsl:choose>
4298
4318
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
4299
4319
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -4448,7 +4468,8 @@
4448
4468
  </fo:inline>
4449
4469
  </xsl:if>
4450
4470
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
4451
- <fo:block-container id="{@id}">
4471
+ <fo:block-container id="{@id}">
4472
+
4452
4473
  <fo:block>
4453
4474
  <xsl:apply-templates/>
4454
4475
  </fo:block>
@@ -4499,7 +4520,7 @@
4499
4520
  <xsl:apply-templates mode="bookmarks"/>
4500
4521
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4501
4522
  <xsl:apply-templates select="."/>
4502
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4523
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4503
4524
  <xsl:apply-templates mode="bookmarks"/>
4504
4525
  </xsl:template><xsl:template name="addBookmarks">
4505
4526
  <xsl:param name="contents"/>
@@ -4515,6 +4536,8 @@
4515
4536
  <xsl:variable name="bookmark-title_">
4516
4537
  <xsl:call-template name="getLangVersion">
4517
4538
  <xsl:with-param name="lang" select="@lang"/>
4539
+ <xsl:with-param name="doctype" select="@doctype"/>
4540
+ <xsl:with-param name="title" select="@title-part"/>
4518
4541
  </xsl:call-template>
4519
4542
  </xsl:variable>
4520
4543
  <xsl:choose>
@@ -4532,13 +4555,34 @@
4532
4555
  </xsl:choose>
4533
4556
  </fo:bookmark-title>
4534
4557
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4558
+
4559
+ <xsl:call-template name="insertFigureBookmarks">
4560
+ <xsl:with-param name="contents" select="contents"/>
4561
+ </xsl:call-template>
4562
+
4563
+ <xsl:call-template name="insertTableBookmarks">
4564
+ <xsl:with-param name="contents" select="contents"/>
4565
+ <xsl:with-param name="lang" select="@lang"/>
4566
+ </xsl:call-template>
4567
+
4535
4568
  </fo:bookmark>
4536
4569
 
4537
4570
  </xsl:for-each>
4538
4571
  </xsl:when>
4539
4572
  <xsl:otherwise>
4540
4573
  <xsl:for-each select="xalan:nodeset($contents)/doc">
4574
+
4541
4575
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4576
+
4577
+ <xsl:call-template name="insertFigureBookmarks">
4578
+ <xsl:with-param name="contents" select="contents"/>
4579
+ </xsl:call-template>
4580
+
4581
+ <xsl:call-template name="insertTableBookmarks">
4582
+ <xsl:with-param name="contents" select="contents"/>
4583
+ <xsl:with-param name="lang" select="@lang"/>
4584
+ </xsl:call-template>
4585
+
4542
4586
  </xsl:for-each>
4543
4587
  </xsl:otherwise>
4544
4588
  </xsl:choose>
@@ -4584,8 +4628,44 @@
4584
4628
 
4585
4629
  </fo:bookmark-tree>
4586
4630
  </xsl:if>
4631
+ </xsl:template><xsl:template name="insertFigureBookmarks">
4632
+ <xsl:param name="contents"/>
4633
+ <xsl:if test="xalan:nodeset($contents)/figure">
4634
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
4635
+ <fo:bookmark-title>Figures</fo:bookmark-title>
4636
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
4637
+ <fo:bookmark internal-destination="{@id}">
4638
+ <fo:bookmark-title>
4639
+ <xsl:value-of select="normalize-space(title)"/>
4640
+ </fo:bookmark-title>
4641
+ </fo:bookmark>
4642
+ </xsl:for-each>
4643
+ </fo:bookmark>
4644
+ </xsl:if>
4645
+ </xsl:template><xsl:template name="insertTableBookmarks">
4646
+ <xsl:param name="contents"/>
4647
+ <xsl:param name="lang"/>
4648
+ <xsl:if test="xalan:nodeset($contents)/table">
4649
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
4650
+ <fo:bookmark-title>
4651
+ <xsl:choose>
4652
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
4653
+ <xsl:otherwise>Tables</xsl:otherwise>
4654
+ </xsl:choose>
4655
+ </fo:bookmark-title>
4656
+ <xsl:for-each select="xalan:nodeset($contents)/table">
4657
+ <fo:bookmark internal-destination="{@id}">
4658
+ <fo:bookmark-title>
4659
+ <xsl:value-of select="normalize-space(title)"/>
4660
+ </fo:bookmark-title>
4661
+ </fo:bookmark>
4662
+ </xsl:for-each>
4663
+ </fo:bookmark>
4664
+ </xsl:if>
4587
4665
  </xsl:template><xsl:template name="getLangVersion">
4588
4666
  <xsl:param name="lang"/>
4667
+ <xsl:param name="doctype" select="''"/>
4668
+ <xsl:param name="title" select="''"/>
4589
4669
  <xsl:choose>
4590
4670
  <xsl:when test="$lang = 'en'">
4591
4671
 
@@ -5074,7 +5154,8 @@
5074
5154
  <fo:block-container margin-left="0mm">
5075
5155
 
5076
5156
  <fo:block xsl:use-attribute-sets="quote-style">
5077
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
5157
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
5158
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5078
5159
  </fo:block>
5079
5160
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5080
5161
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -5201,9 +5282,12 @@
5201
5282
  </fo:block>
5202
5283
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5203
5284
  <xsl:variable name="title-deprecated">
5204
- <xsl:call-template name="getTitle">
5205
- <xsl:with-param name="name" select="'title-deprecated'"/>
5206
- </xsl:call-template>
5285
+
5286
+
5287
+ <xsl:call-template name="getTitle">
5288
+ <xsl:with-param name="name" select="'title-deprecated'"/>
5289
+ </xsl:call-template>
5290
+
5207
5291
  </xsl:variable>
5208
5292
  <fo:block xsl:use-attribute-sets="deprecates-style">
5209
5293
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -5256,7 +5340,7 @@
5256
5340
  <fo:block id="{@id}">
5257
5341
  <xsl:apply-templates/>
5258
5342
  </fo:block>
5259
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5343
+ </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
5344
 
5261
5345
  <fo:block break-after="page"/>
5262
5346
 
@@ -5315,7 +5399,10 @@
5315
5399
  <fo:table-column column-width="107mm"/>
5316
5400
  <fo:table-column column-width="15mm"/>
5317
5401
  <fo:table-body>
5318
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
5402
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
5403
+
5404
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
5405
+
5319
5406
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
5320
5407
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
5321
5408
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -5333,6 +5420,10 @@
5333
5420
  <fo:block><xsl:apply-templates/></fo:block>
5334
5421
  </fo:table-cell>
5335
5422
  </xsl:template><xsl:template name="processBibitem">
5423
+
5424
+
5425
+ <!-- end BIPM bibitem processing-->
5426
+
5336
5427
 
5337
5428
 
5338
5429
 
@@ -5391,6 +5482,8 @@
5391
5482
  <xsl:value-of select="translate(.,'. ','')"/>
5392
5483
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
5393
5484
  <xsl:value-of select="substring(.,1,1)"/>
5485
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5486
+ <fo:inline><xsl:apply-templates/></fo:inline>
5394
5487
  </xsl:template><xsl:template name="convertDate">
5395
5488
  <xsl:param name="date"/>
5396
5489
  <xsl:param name="format" select="'short'"/>
@@ -5575,13 +5668,22 @@
5575
5668
  </xsl:template><xsl:template name="split">
5576
5669
  <xsl:param name="pText" select="."/>
5577
5670
  <xsl:param name="sep" select="','"/>
5671
+ <xsl:param name="normalize-space" select="'true'"/>
5578
5672
  <xsl:if test="string-length($pText) &gt;0">
5579
5673
  <item>
5580
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
5674
+ <xsl:choose>
5675
+ <xsl:when test="$normalize-space = 'true'">
5676
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
5677
+ </xsl:when>
5678
+ <xsl:otherwise>
5679
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
5680
+ </xsl:otherwise>
5681
+ </xsl:choose>
5581
5682
  </item>
5582
5683
  <xsl:call-template name="split">
5583
5684
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
5584
5685
  <xsl:with-param name="sep" select="$sep"/>
5686
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
5585
5687
  </xsl:call-template>
5586
5688
  </xsl:if>
5587
5689
  </xsl:template><xsl:template name="getDocumentId">
@@ -5647,4 +5749,28 @@
5647
5749
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
5648
5750
  </xsl:call-template>
5649
5751
  </xsl:if>
5752
+ </xsl:template><xsl:template name="repeat">
5753
+ <xsl:param name="char" select="'*'"/>
5754
+ <xsl:param name="count"/>
5755
+ <xsl:if test="$count &gt; 0">
5756
+ <xsl:value-of select="$char"/>
5757
+ <xsl:call-template name="repeat">
5758
+ <xsl:with-param name="char" select="$char"/>
5759
+ <xsl:with-param name="count" select="$count - 1"/>
5760
+ </xsl:call-template>
5761
+ </xsl:if>
5762
+ </xsl:template><xsl:template name="getLocalizedString">
5763
+ <xsl:param name="key"/>
5764
+
5765
+ <xsl:variable name="curr_lang">
5766
+ <xsl:call-template name="getLang"/>
5767
+ </xsl:variable>
5768
+
5769
+ <xsl:choose>
5770
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5771
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5772
+ </xsl:when>
5773
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
5774
+ </xsl:choose>
5775
+
5650
5776
  </xsl:template></xsl:stylesheet>