metanorma-ogc 2.3.13 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/ogc/base_convert.rb +9 -18
  3. data/lib/isodoc/ogc/html/htmlstyle.css +9 -5
  4. data/lib/isodoc/ogc/html/htmlstyle.scss +2 -2
  5. data/lib/isodoc/ogc/html_convert.rb +2 -11
  6. data/lib/isodoc/ogc/i18n-en.yaml +11 -0
  7. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +121 -61
  8. data/lib/isodoc/ogc/ogc.best-practice.xsl +121 -61
  9. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +121 -61
  10. data/lib/isodoc/ogc/ogc.community-practice.xsl +121 -61
  11. data/lib/isodoc/ogc/ogc.community-standard.xsl +121 -61
  12. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +121 -61
  13. data/lib/isodoc/ogc/ogc.draft-standard.xsl +121 -61
  14. data/lib/isodoc/ogc/ogc.engineering-report.xsl +121 -61
  15. data/lib/isodoc/ogc/ogc.other.xsl +121 -61
  16. data/lib/isodoc/ogc/ogc.policy.xsl +121 -61
  17. data/lib/isodoc/ogc/ogc.reference-model.xsl +121 -61
  18. data/lib/isodoc/ogc/ogc.release-notes.xsl +121 -61
  19. data/lib/isodoc/ogc/ogc.standard.xsl +121 -61
  20. data/lib/isodoc/ogc/ogc.test-suite.xsl +121 -61
  21. data/lib/isodoc/ogc/ogc.user-guide.xsl +121 -61
  22. data/lib/isodoc/ogc/ogc.white-paper.xsl +84 -57
  23. data/lib/isodoc/ogc/presentation_xml_convert.rb +25 -18
  24. data/lib/isodoc/ogc/sections.rb +4 -27
  25. data/lib/isodoc/ogc/word_convert.rb +3 -22
  26. data/lib/isodoc/ogc/xref.rb +17 -6
  27. data/lib/metanorma/ogc/boilerplate.adoc +2 -2
  28. data/lib/metanorma/ogc/converter.rb +6 -2
  29. data/lib/metanorma/ogc/isodoc.rng +26 -4
  30. data/lib/metanorma/ogc/version.rb +1 -1
  31. data/metanorma-ogc.gemspec +1 -1
  32. metadata +4 -4
@@ -306,7 +306,12 @@
306
306
  <fo:block line-height="140%">
307
307
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:edition[normalize-space(@language) = '']"/>
308
308
  <fo:block>
309
- <fo:inline font-weight="bold">Submission Date: </fo:inline>
309
+ <fo:inline font-weight="bold">
310
+ <!-- Submission Date: -->
311
+ <xsl:call-template name="getLocalizedString">
312
+ <xsl:with-param name="key">submission_date</xsl:with-param>
313
+ </xsl:call-template><xsl:text>: </xsl:text>
314
+ </fo:inline>
310
315
  <xsl:choose>
311
316
  <xsl:when test="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'received']/ogc:on">
312
317
  <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'received']/ogc:on"/>
@@ -315,7 +320,12 @@
315
320
  </xsl:choose>
316
321
  </fo:block>
317
322
  <fo:block>
318
- <fo:inline font-weight="bold">Approval Date: </fo:inline>
323
+ <fo:inline font-weight="bold">
324
+ <!-- Approval Date: -->
325
+ <xsl:call-template name="getLocalizedString">
326
+ <xsl:with-param name="key">approval_date</xsl:with-param>
327
+ </xsl:call-template><xsl:text>: </xsl:text>
328
+ </fo:inline>
319
329
  <xsl:choose>
320
330
  <xsl:when test="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'issued']/ogc:on">
321
331
  <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'issued']/ogc:on"/>
@@ -324,14 +334,24 @@
324
334
  </xsl:choose>
325
335
  </fo:block>
326
336
  <fo:block>
327
- <fo:inline font-weight="bold">Publication Date: </fo:inline>
337
+ <fo:inline font-weight="bold">
338
+ <!-- Publication Date: -->
339
+ <xsl:call-template name="getLocalizedString">
340
+ <xsl:with-param name="key">publication_date</xsl:with-param>
341
+ </xsl:call-template><xsl:text>: </xsl:text>
342
+ </fo:inline>
328
343
  <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:date[@type = 'published']/ogc:on"/>
329
344
  </fo:block>
330
345
 
331
346
  <fo:block margin-bottom="12pt">
332
347
  <xsl:if test="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:person/ogc:name/ogc:completename">
333
348
  <fo:block>
334
- <fo:inline font-weight="bold">Author: </fo:inline>
349
+ <fo:inline font-weight="bold">
350
+ <!-- Author: -->
351
+ <xsl:call-template name="getLocalizedString">
352
+ <xsl:with-param name="key">author</xsl:with-param>
353
+ </xsl:call-template><xsl:text>: </xsl:text>
354
+ </fo:inline>
335
355
  <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:person/ogc:name/ogc:completename">
336
356
  <xsl:value-of select="."/>
337
357
  <xsl:if test="position() != last()">, </xsl:if>
@@ -340,7 +360,12 @@
340
360
  </xsl:if>
341
361
  <xsl:if test="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='editor']/ogc:person/ogc:name/ogc:completename">
342
362
  <fo:block>
343
- <fo:inline font-weight="bold">Editor: </fo:inline>
363
+ <fo:inline font-weight="bold">
364
+ <!-- Editor: -->
365
+ <xsl:call-template name="getLocalizedString">
366
+ <xsl:with-param name="key">editor</xsl:with-param>
367
+ </xsl:call-template><xsl:text>: </xsl:text>
368
+ </fo:inline>
344
369
  <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='editor']/ogc:person/ogc:name/ogc:completename">
345
370
  <xsl:value-of select="."/>
346
371
  <xsl:if test="position() != last()">, </xsl:if>
@@ -349,7 +374,12 @@
349
374
  </xsl:if>
350
375
  <xsl:if test="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='contributor']/ogc:person/ogc:name/ogc:completename">
351
376
  <fo:block>
352
- <fo:inline font-weight="bold">Contributor: </fo:inline>
377
+ <fo:inline font-weight="bold">
378
+ <!-- Contributor: -->
379
+ <xsl:call-template name="getLocalizedString">
380
+ <xsl:with-param name="key">contributor</xsl:with-param>
381
+ </xsl:call-template><xsl:text>: </xsl:text>
382
+ </fo:inline>
353
383
  <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='contributor']/ogc:person/ogc:name/ogc:completename">
354
384
  <xsl:value-of select="."/>
355
385
  <xsl:if test="position() != last()">, </xsl:if>
@@ -689,7 +719,10 @@
689
719
  <!-- add zero-width space (#x200B) before character '(' if preceding and following are word chars -->
690
720
  <xsl:variable name="content3" select="java:replaceAll(java:java.lang.String.new($content2), '(\w)(\()(\w)', '$1​$2$3')"/>
691
721
 
692
- <xsl:value-of select="translate($content3, $thin_space, ' ')"/>
722
+ <!-- replace sequence #x200B to one &#x200B -->
723
+ <xsl:variable name="content4" select="java:replaceAll(java:java.lang.String.new($content3), '\u200b{2,}', '​')"/>
724
+
725
+ <xsl:value-of select="translate($content4, $thin_space, ' ')"/>
693
726
  </xsl:template>
694
727
 
695
728
  <xsl:template match="node()" mode="sections">
@@ -1151,7 +1184,7 @@
1151
1184
  </xsl:if>
1152
1185
  </xsl:template>
1153
1186
 
1154
- <xsl:template match="*[local-name()='th']//text()" priority="2">
1187
+ <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1155
1188
  <xsl:variable name="text">
1156
1189
  <xsl:call-template name="add-zero-spaces-java"/>
1157
1190
  </xsl:variable>
@@ -1613,21 +1646,32 @@
1613
1646
  <xsl:variable name="titles_">
1614
1647
 
1615
1648
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
1616
- <title-toc lang="en">
1617
-
1649
+ <!-- <title-toc lang="en">
1650
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
1618
1651
  <xsl:text>Contents</xsl:text>
1619
-
1620
- </title-toc>
1621
- <title-toc lang="fr">
1652
+ </xsl:if>
1653
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
1654
+ <xsl:text>Table of Contents</xsl:text>
1655
+ </xsl:if>
1656
+ <xsl:if test="$namespace = 'gb'">
1657
+ <xsl:text>Table of contents</xsl:text>
1658
+ </xsl:if>
1659
+ </title-toc> -->
1660
+ <title-toc lang="en">Table of contents</title-toc>
1661
+ <!-- <title-toc lang="fr">
1622
1662
  <xsl:text>Sommaire</xsl:text>
1623
- </title-toc>
1624
- <title-toc lang="zh">
1625
-
1663
+ </title-toc> -->
1664
+ <!-- <title-toc lang="zh">
1665
+ <xsl:choose>
1666
+ <xsl:when test="$namespace = 'gb'">
1667
+ <xsl:text>目次</xsl:text>
1668
+ </xsl:when>
1669
+ <xsl:otherwise>
1626
1670
  <xsl:text>Contents</xsl:text>
1627
-
1628
- </title-toc>
1629
-
1630
- <title-descriptors lang="en">Descriptors</title-descriptors>
1671
+ </xsl:otherwise>
1672
+ </xsl:choose>
1673
+ </title-toc> -->
1674
+ <title-toc lang="zh">目次</title-toc>
1631
1675
 
1632
1676
  <title-part lang="en">
1633
1677
 
@@ -1643,20 +1687,6 @@
1643
1687
  <title-subpart lang="en">Sub-part #</title-subpart>
1644
1688
  <title-subpart lang="fr">Partie de sub #</title-subpart>
1645
1689
 
1646
- <title-list-tables lang="en">List of Tables</title-list-tables>
1647
-
1648
- <title-list-figures lang="en">List of Figures</title-list-figures>
1649
-
1650
- <title-table-figures lang="en">Table of Figures</title-table-figures>
1651
-
1652
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1653
-
1654
- <title-summary lang="en">Summary</title-summary>
1655
-
1656
- <title-continued lang="ru">(продолжение)</title-continued>
1657
- <title-continued lang="en">(continued)</title-continued>
1658
- <title-continued lang="fr">(continué)</title-continued>
1659
-
1660
1690
  </xsl:variable>
1661
1691
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
1662
1692
 
@@ -1664,8 +1694,8 @@
1664
1694
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1665
1695
  <xsl:value-of select="$toc_table_title"/>
1666
1696
  <xsl:if test="normalize-space($toc_table_title) = ''">
1667
- <xsl:call-template name="getTitle">
1668
- <xsl:with-param name="name" select="'title-list-tables'"/>
1697
+ <xsl:call-template name="getLocalizedString">
1698
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
1669
1699
  </xsl:call-template>
1670
1700
  </xsl:if>
1671
1701
  </xsl:variable>
@@ -1674,8 +1704,8 @@
1674
1704
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1675
1705
  <xsl:value-of select="$toc_figure_title"/>
1676
1706
  <xsl:if test="normalize-space($toc_figure_title) = ''">
1677
- <xsl:call-template name="getTitle">
1678
- <xsl:with-param name="name" select="'title-list-figures'"/>
1707
+ <xsl:call-template name="getLocalizedString">
1708
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
1679
1709
  </xsl:call-template>
1680
1710
  </xsl:if>
1681
1711
  </xsl:variable>
@@ -1684,8 +1714,8 @@
1684
1714
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1685
1715
  <xsl:value-of select="$toc_requirement_title"/>
1686
1716
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
1687
- <xsl:call-template name="getTitle">
1688
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
1717
+ <xsl:call-template name="getLocalizedString">
1718
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
1689
1719
  </xsl:call-template>
1690
1720
  </xsl:if>
1691
1721
  </xsl:variable>
@@ -5547,6 +5577,9 @@
5547
5577
  <!-- END Definition List -->
5548
5578
  <!-- ===================== -->
5549
5579
 
5580
+ <!-- default: ignore title in sections/p -->
5581
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
5582
+
5550
5583
  <!-- ========================= -->
5551
5584
  <!-- Rich text formatting -->
5552
5585
  <!-- ========================= -->
@@ -5627,7 +5660,7 @@
5627
5660
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
5628
5661
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
5629
5662
  <xsl:choose>
5630
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
5663
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
5631
5664
  <!-- url -->
5632
5665
  <xsl:call-template name="add-zero-spaces-link-java"/>
5633
5666
  </xsl:when>
@@ -6089,10 +6122,13 @@
6089
6122
  </xsl:choose>
6090
6123
  </xsl:variable>
6091
6124
 
6125
+ <!-- replace sequence #x200B to one &#x200B -->
6126
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
6127
+
6092
6128
  <!-- replace sequence #x200B and space TO space -->
6093
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
6129
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
6094
6130
 
6095
- <xsl:value-of select="$text10"/>
6131
+ <xsl:value-of select="$text11"/>
6096
6132
  </xsl:template>
6097
6133
 
6098
6134
  <xsl:template name="add-zero-spaces-link-java">
@@ -6102,8 +6138,12 @@
6102
6138
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
6103
6139
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
6104
6140
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
6141
+
6142
+ <!-- replace sequence #x200B to one &#x200B -->
6143
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
6144
+
6105
6145
  <!-- remove zero-width space at the end -->
6106
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
6146
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
6107
6147
  </xsl:template>
6108
6148
 
6109
6149
  <!-- add zero space after dash character (for table's entries) -->
@@ -7370,7 +7410,7 @@
7370
7410
 
7371
7411
  <xsl:call-template name="refine_note_block_style"/>
7372
7412
 
7373
- <fo:inline xsl:use-attribute-sets="note-name-style">
7413
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
7374
7414
 
7375
7415
  <xsl:call-template name="refine_note-name-style"/>
7376
7416
 
@@ -7407,12 +7447,12 @@
7407
7447
  <xsl:variable name="num"><xsl:number/></xsl:variable>
7408
7448
  <xsl:choose>
7409
7449
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
7410
- <fo:inline xsl:use-attribute-sets="note-p-style">
7450
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
7411
7451
  <xsl:apply-templates/>
7412
7452
  </fo:inline>
7413
7453
  </xsl:when>
7414
7454
  <xsl:otherwise>
7415
- <fo:block xsl:use-attribute-sets="note-p-style">
7455
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
7416
7456
  <xsl:apply-templates/>
7417
7457
  </fo:block>
7418
7458
  </xsl:otherwise>
@@ -7631,25 +7671,45 @@
7631
7671
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7632
7672
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7633
7673
 
7634
- <xsl:variable name="img_src">
7635
- <xsl:choose>
7636
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7637
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7638
- </xsl:choose>
7639
- </xsl:variable>
7674
+ <xsl:if test="@width != '' and @width != 'auto'">
7675
+ <xsl:attribute name="width">
7676
+ <xsl:value-of select="@width"/>
7677
+ </xsl:attribute>
7678
+ </xsl:if>
7679
+
7680
+ <xsl:if test="@height != '' and @height != 'auto'">
7681
+ <xsl:attribute name="height">
7682
+ <xsl:value-of select="@height"/>
7683
+ </xsl:attribute>
7684
+ </xsl:if>
7640
7685
 
7641
- <xsl:variable name="image_width_effective">
7686
+ <xsl:choose>
7687
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
7688
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
7689
+ </xsl:when>
7690
+ <xsl:otherwise>
7642
7691
 
7643
- <xsl:value-of select="$width_effective"/>
7692
+ <xsl:variable name="img_src">
7693
+ <xsl:choose>
7694
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7695
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7696
+ </xsl:choose>
7697
+ </xsl:variable>
7644
7698
 
7645
- </xsl:variable>
7699
+ <xsl:variable name="image_width_effective">
7646
7700
 
7647
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7648
- <xsl:if test="number($scale) &lt; 100">
7701
+ <xsl:value-of select="$width_effective"/>
7649
7702
 
7650
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7703
+ </xsl:variable>
7651
7704
 
7652
- </xsl:if>
7705
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7706
+ <xsl:if test="number($scale) &lt; 100">
7707
+
7708
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7709
+
7710
+ </xsl:if>
7711
+ </xsl:otherwise>
7712
+ </xsl:choose>
7653
7713
 
7654
7714
  </xsl:if>
7655
7715
 
@@ -11350,7 +11410,7 @@
11350
11410
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
11351
11411
  <xsl:apply-templates mode="update_xml_step1"/>
11352
11412
  </xsl:template>
11353
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11413
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11354
11414
  <xsl:copy>
11355
11415
  <xsl:copy-of select="@*"/>
11356
11416
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -268,8 +268,8 @@
268
268
  <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
269
269
  <fo:block xsl:use-attribute-sets="title-toc-style">
270
270
  <!-- <xsl:text>Table of Figures</xsl:text> -->
271
- <xsl:call-template name="getTitle">
272
- <xsl:with-param name="name" select="'title-table-figures'"/>
271
+ <xsl:call-template name="getLocalizedString">
272
+ <xsl:with-param name="key">table_of_figures</xsl:with-param>
273
273
  </xsl:call-template>
274
274
  </fo:block>
275
275
  <xsl:for-each select="//ogc:figure[@id and ogc:name] | //ogc:table[@id and ogc:name]">
@@ -781,21 +781,32 @@
781
781
  <xsl:variable name="titles_">
782
782
 
783
783
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
784
- <title-toc lang="en">
785
-
784
+ <!-- <title-toc lang="en">
785
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
786
+ <xsl:text>Contents</xsl:text>
787
+ </xsl:if>
788
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
786
789
  <xsl:text>Table of Contents</xsl:text>
787
-
788
- </title-toc>
789
- <title-toc lang="fr">
790
+ </xsl:if>
791
+ <xsl:if test="$namespace = 'gb'">
792
+ <xsl:text>Table of contents</xsl:text>
793
+ </xsl:if>
794
+ </title-toc> -->
795
+ <title-toc lang="en">Table of contents</title-toc>
796
+ <!-- <title-toc lang="fr">
790
797
  <xsl:text>Sommaire</xsl:text>
791
- </title-toc>
792
- <title-toc lang="zh">
793
-
798
+ </title-toc> -->
799
+ <!-- <title-toc lang="zh">
800
+ <xsl:choose>
801
+ <xsl:when test="$namespace = 'gb'">
802
+ <xsl:text>目次</xsl:text>
803
+ </xsl:when>
804
+ <xsl:otherwise>
794
805
  <xsl:text>Contents</xsl:text>
795
-
796
- </title-toc>
797
-
798
- <title-descriptors lang="en">Descriptors</title-descriptors>
806
+ </xsl:otherwise>
807
+ </xsl:choose>
808
+ </title-toc> -->
809
+ <title-toc lang="zh">目次</title-toc>
799
810
 
800
811
  <title-part lang="en">
801
812
 
@@ -811,20 +822,6 @@
811
822
  <title-subpart lang="en">Sub-part #</title-subpart>
812
823
  <title-subpart lang="fr">Partie de sub #</title-subpart>
813
824
 
814
- <title-list-tables lang="en">List of Tables</title-list-tables>
815
-
816
- <title-list-figures lang="en">List of Figures</title-list-figures>
817
-
818
- <title-table-figures lang="en">Table of Figures</title-table-figures>
819
-
820
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
821
-
822
- <title-summary lang="en">Summary</title-summary>
823
-
824
- <title-continued lang="ru">(продолжение)</title-continued>
825
- <title-continued lang="en">(continued)</title-continued>
826
- <title-continued lang="fr">(continué)</title-continued>
827
-
828
825
  </xsl:variable>
829
826
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
830
827
 
@@ -832,8 +829,8 @@
832
829
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
833
830
  <xsl:value-of select="$toc_table_title"/>
834
831
  <xsl:if test="normalize-space($toc_table_title) = ''">
835
- <xsl:call-template name="getTitle">
836
- <xsl:with-param name="name" select="'title-list-tables'"/>
832
+ <xsl:call-template name="getLocalizedString">
833
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
837
834
  </xsl:call-template>
838
835
  </xsl:if>
839
836
  </xsl:variable>
@@ -842,8 +839,8 @@
842
839
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
843
840
  <xsl:value-of select="$toc_figure_title"/>
844
841
  <xsl:if test="normalize-space($toc_figure_title) = ''">
845
- <xsl:call-template name="getTitle">
846
- <xsl:with-param name="name" select="'title-list-figures'"/>
842
+ <xsl:call-template name="getLocalizedString">
843
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
847
844
  </xsl:call-template>
848
845
  </xsl:if>
849
846
  </xsl:variable>
@@ -852,8 +849,8 @@
852
849
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
853
850
  <xsl:value-of select="$toc_requirement_title"/>
854
851
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
855
- <xsl:call-template name="getTitle">
856
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
852
+ <xsl:call-template name="getLocalizedString">
853
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
857
854
  </xsl:call-template>
858
855
  </xsl:if>
859
856
  </xsl:variable>
@@ -4680,6 +4677,9 @@
4680
4677
  <!-- END Definition List -->
4681
4678
  <!-- ===================== -->
4682
4679
 
4680
+ <!-- default: ignore title in sections/p -->
4681
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
4682
+
4683
4683
  <!-- ========================= -->
4684
4684
  <!-- Rich text formatting -->
4685
4685
  <!-- ========================= -->
@@ -4760,7 +4760,7 @@
4760
4760
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4761
4761
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4762
4762
  <xsl:choose>
4763
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4763
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
4764
4764
  <!-- url -->
4765
4765
  <xsl:call-template name="add-zero-spaces-link-java"/>
4766
4766
  </xsl:when>
@@ -5222,10 +5222,13 @@
5222
5222
  </xsl:choose>
5223
5223
  </xsl:variable>
5224
5224
 
5225
+ <!-- replace sequence #x200B to one &#x200B -->
5226
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
5227
+
5225
5228
  <!-- replace sequence #x200B and space TO space -->
5226
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5229
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
5227
5230
 
5228
- <xsl:value-of select="$text10"/>
5231
+ <xsl:value-of select="$text11"/>
5229
5232
  </xsl:template>
5230
5233
 
5231
5234
  <xsl:template name="add-zero-spaces-link-java">
@@ -5235,8 +5238,12 @@
5235
5238
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5236
5239
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
5237
5240
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
5241
+
5242
+ <!-- replace sequence #x200B to one &#x200B -->
5243
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
5244
+
5238
5245
  <!-- remove zero-width space at the end -->
5239
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5246
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
5240
5247
  </xsl:template>
5241
5248
 
5242
5249
  <!-- add zero space after dash character (for table's entries) -->
@@ -6499,7 +6506,7 @@
6499
6506
 
6500
6507
  <xsl:call-template name="refine_note_block_style"/>
6501
6508
 
6502
- <fo:inline xsl:use-attribute-sets="note-name-style">
6509
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6503
6510
 
6504
6511
  <xsl:call-template name="refine_note-name-style"/>
6505
6512
 
@@ -6536,12 +6543,12 @@
6536
6543
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6537
6544
  <xsl:choose>
6538
6545
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
6539
- <fo:inline xsl:use-attribute-sets="note-p-style">
6546
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
6540
6547
  <xsl:apply-templates/>
6541
6548
  </fo:inline>
6542
6549
  </xsl:when>
6543
6550
  <xsl:otherwise>
6544
- <fo:block xsl:use-attribute-sets="note-p-style">
6551
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
6545
6552
  <xsl:apply-templates/>
6546
6553
  </fo:block>
6547
6554
  </xsl:otherwise>
@@ -6758,25 +6765,45 @@
6758
6765
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6759
6766
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6760
6767
 
6761
- <xsl:variable name="img_src">
6762
- <xsl:choose>
6763
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6764
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6765
- </xsl:choose>
6766
- </xsl:variable>
6768
+ <xsl:if test="@width != '' and @width != 'auto'">
6769
+ <xsl:attribute name="width">
6770
+ <xsl:value-of select="@width"/>
6771
+ </xsl:attribute>
6772
+ </xsl:if>
6767
6773
 
6768
- <xsl:variable name="image_width_effective">
6774
+ <xsl:if test="@height != '' and @height != 'auto'">
6775
+ <xsl:attribute name="height">
6776
+ <xsl:value-of select="@height"/>
6777
+ </xsl:attribute>
6778
+ </xsl:if>
6769
6779
 
6770
- <xsl:value-of select="$width_effective"/>
6780
+ <xsl:choose>
6781
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
6782
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
6783
+ </xsl:when>
6784
+ <xsl:otherwise>
6771
6785
 
6772
- </xsl:variable>
6786
+ <xsl:variable name="img_src">
6787
+ <xsl:choose>
6788
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6789
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6790
+ </xsl:choose>
6791
+ </xsl:variable>
6773
6792
 
6774
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6775
- <xsl:if test="number($scale) &lt; 100">
6793
+ <xsl:variable name="image_width_effective">
6776
6794
 
6777
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6795
+ <xsl:value-of select="$width_effective"/>
6778
6796
 
6779
- </xsl:if>
6797
+ </xsl:variable>
6798
+
6799
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6800
+ <xsl:if test="number($scale) &lt; 100">
6801
+
6802
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6803
+
6804
+ </xsl:if>
6805
+ </xsl:otherwise>
6806
+ </xsl:choose>
6780
6807
 
6781
6808
  </xsl:if>
6782
6809
 
@@ -7468,8 +7495,8 @@
7468
7495
  <xsl:if test="$list_of_tables_figures//table_figure">
7469
7496
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
7470
7497
  <fo:bookmark-title>
7471
- <xsl:call-template name="getTitle">
7472
- <xsl:with-param name="name" select="'title-table-figures'"/>
7498
+ <xsl:call-template name="getLocalizedString">
7499
+ <xsl:with-param name="key">table_of_figures</xsl:with-param>
7473
7500
  </xsl:call-template>
7474
7501
  </fo:bookmark-title>
7475
7502
  <xsl:for-each select="$list_of_tables_figures//table_figure">
@@ -10458,7 +10485,7 @@
10458
10485
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10459
10486
  <xsl:apply-templates mode="update_xml_step1"/>
10460
10487
  </xsl:template>
10461
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10488
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10462
10489
  <xsl:copy>
10463
10490
  <xsl:copy-of select="@*"/>
10464
10491
  <xsl:apply-templates mode="update_xml_step1"/>