metanorma-ogc 2.2.4 → 2.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/ogc/html/htmlstyle.css +7 -1
  3. data/lib/isodoc/ogc/html/htmlstyle.scss +1 -0
  4. data/lib/isodoc/ogc/metadata.rb +7 -6
  5. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +163 -29
  6. data/lib/isodoc/ogc/ogc.best-practice.xsl +163 -29
  7. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +163 -29
  8. data/lib/isodoc/ogc/ogc.community-practice.xsl +163 -29
  9. data/lib/isodoc/ogc/ogc.community-standard.xsl +163 -29
  10. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +163 -29
  11. data/lib/isodoc/ogc/ogc.draft-standard.xsl +10902 -0
  12. data/lib/isodoc/ogc/ogc.engineering-report.xsl +163 -29
  13. data/lib/isodoc/ogc/ogc.other.xsl +163 -29
  14. data/lib/isodoc/ogc/ogc.policy.xsl +163 -29
  15. data/lib/isodoc/ogc/ogc.reference-model.xsl +163 -29
  16. data/lib/isodoc/ogc/ogc.release-notes.xsl +163 -29
  17. data/lib/isodoc/ogc/ogc.standard.xsl +163 -29
  18. data/lib/isodoc/ogc/ogc.test-suite.xsl +163 -29
  19. data/lib/isodoc/ogc/ogc.user-guide.xsl +163 -29
  20. data/lib/isodoc/ogc/ogc.white-paper.xsl +145 -23
  21. data/lib/isodoc/ogc/pdf_convert.rb +5 -4
  22. data/lib/isodoc/ogc/presentation_xml_convert.rb +5 -5
  23. data/lib/isodoc/ogc/xref.rb +19 -19
  24. data/lib/metanorma/ogc/basicdoc.rng +0 -27
  25. data/lib/metanorma/ogc/biblio-standoc.rng +164 -0
  26. data/lib/metanorma/ogc/biblio.rng +50 -18
  27. data/lib/metanorma/ogc/cleanup.rb +14 -14
  28. data/lib/metanorma/ogc/converter.rb +2 -2
  29. data/lib/metanorma/ogc/front.rb +12 -8
  30. data/lib/metanorma/ogc/isodoc.rng +68 -206
  31. data/lib/metanorma/ogc/ogc.rng +1 -74
  32. data/lib/metanorma/ogc/relaton-ogc.rng +83 -0
  33. data/lib/metanorma/ogc/validate.rb +15 -15
  34. data/lib/metanorma/ogc/version.rb +1 -1
  35. data/metanorma-ogc.gemspec +3 -2
  36. metadata +7 -10
  37. data/.github/workflows/rake.yml +0 -15
  38. data/.github/workflows/release.yml +0 -24
  39. data/Rakefile +0 -8
  40. data/bin/console +0 -14
  41. data/bin/rspec +0 -17
  42. data/bin/setup +0 -8
@@ -1143,7 +1143,7 @@
1143
1143
  <xsl:template name="insertHeaderFooter">
1144
1144
  <xsl:param name="color" select="$color_blue"/>
1145
1145
  <fo:static-content flow-name="footer" role="artifact">
1146
- <fo:block-container font-size="8pt" height="100%" color="{$color}" padding-top="6mm">
1146
+ <fo:block-container font-size="8pt" color="{$color}" padding-top="6mm">
1147
1147
  <fo:table table-layout="fixed" width="100%">
1148
1148
  <fo:table-column column-width="90%"/>
1149
1149
  <fo:table-column column-width="10%"/>
@@ -1883,6 +1883,15 @@
1883
1883
 
1884
1884
  </xsl:attribute-set>
1885
1885
 
1886
+ <xsl:attribute-set name="pre-style">
1887
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1888
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1889
+
1890
+ <xsl:attribute name="font-family">Fira Code, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1891
+ <xsl:attribute name="line-height">113%</xsl:attribute>
1892
+
1893
+ </xsl:attribute-set>
1894
+
1886
1895
  <xsl:attribute-set name="permission-style">
1887
1896
 
1888
1897
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -2026,6 +2035,11 @@
2026
2035
  </xsl:variable>
2027
2036
  <xsl:variable name="table-border" select="normalize-space($table-border_)"/>
2028
2037
 
2038
+ <xsl:variable name="table-cell-border_">
2039
+
2040
+ </xsl:variable>
2041
+ <xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/>
2042
+
2029
2043
  <xsl:attribute-set name="table-container-style">
2030
2044
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2031
2045
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -2037,8 +2051,6 @@
2037
2051
  <xsl:attribute-set name="table-style">
2038
2052
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
2039
2053
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
2040
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2041
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2042
2054
 
2043
2055
  </xsl:attribute-set><!-- table-style -->
2044
2056
 
@@ -2083,6 +2095,8 @@
2083
2095
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2084
2096
  <xsl:attribute name="display-align">center</xsl:attribute>
2085
2097
 
2098
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
2099
+ <xsl:attribute name="padding-bottom">1mm</xsl:attribute>
2086
2100
  <xsl:attribute name="border">solid black 0pt</xsl:attribute>
2087
2101
 
2088
2102
  </xsl:attribute-set> <!-- table-header-cell-style -->
@@ -3184,9 +3198,9 @@
3184
3198
 
3185
3199
  <fo:block-container xsl:use-attribute-sets="table-container-style">
3186
3200
 
3187
- <xsl:if test="ancestor::*[local-name()='sections']">
3201
+ <!-- <xsl:if test="ancestor::*[local-name()='sections']"> -->
3188
3202
  <xsl:attribute name="font-size">9pt</xsl:attribute>
3189
- </xsl:if>
3203
+ <!-- </xsl:if> -->
3190
3204
 
3191
3205
  <!-- end table block-container attributes -->
3192
3206
 
@@ -3206,6 +3220,12 @@
3206
3220
  <xsl:variable name="table_attributes">
3207
3221
 
3208
3222
  <xsl:element name="table_attributes" use-attribute-sets="table-style">
3223
+
3224
+ <xsl:if test="$margin-side != 0">
3225
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3226
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3227
+ </xsl:if>
3228
+
3209
3229
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
3210
3230
 
3211
3231
  </xsl:element>
@@ -3959,10 +3979,17 @@
3959
3979
  <xsl:template match="*[local-name()='tr']">
3960
3980
  <fo:table-row xsl:use-attribute-sets="table-body-row-style">
3961
3981
 
3982
+ <xsl:if test="*[local-name() = 'th']">
3983
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
3984
+ </xsl:if>
3985
+
3962
3986
  <xsl:variable name="number"><xsl:number/></xsl:variable>
3963
- <xsl:if test="$number mod 2 = 0">
3964
- <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3965
- </xsl:if>
3987
+ <xsl:attribute name="background-color">
3988
+ <xsl:choose>
3989
+ <xsl:when test="$number mod 2 = 0">rgb(252, 246, 222)</xsl:when>
3990
+ <xsl:otherwise>rgb(254, 252, 245)</xsl:otherwise>
3991
+ </xsl:choose>
3992
+ </xsl:attribute>
3966
3993
 
3967
3994
  <xsl:call-template name="setTableRowAttributes"/>
3968
3995
  <xsl:apply-templates/>
@@ -3983,6 +4010,12 @@
3983
4010
  <xsl:with-param name="default">center</xsl:with-param>
3984
4011
  </xsl:call-template>
3985
4012
 
4013
+ <xsl:if test="starts-with(ancestor::*[local-name() = 'table'][1]/@type, 'recommend') and normalize-space(@align) = ''">
4014
+ <xsl:call-template name="setTextAlignment">
4015
+ <xsl:with-param name="default">left</xsl:with-param>
4016
+ </xsl:call-template>
4017
+ </xsl:if>
4018
+
3986
4019
  <xsl:if test="$lang = 'ar'">
3987
4020
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
3988
4021
  </xsl:if>
@@ -4994,8 +5027,10 @@
4994
5027
 
4995
5028
  <!-- 10 -->
4996
5029
 
4997
- 9.5
4998
-
5030
+ <xsl:choose>
5031
+ <xsl:when test="ancestor::*[local-name() = 'table']">8.5</xsl:when>
5032
+ <xsl:otherwise>9.5</xsl:otherwise>
5033
+ </xsl:choose>
4999
5034
 
5000
5035
  </xsl:variable>
5001
5036
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -5013,8 +5048,17 @@
5013
5048
  </fo:inline>
5014
5049
  </xsl:template> <!-- tt -->
5015
5050
 
5051
+ <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
5016
5052
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
5017
- <xsl:call-template name="add_spaces_to_sourcecode"/>
5053
+ <xsl:choose>
5054
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
5055
+ <!-- url -->
5056
+ <xsl:call-template name="add-zero-spaces-link-java"/>
5057
+ </xsl:when>
5058
+ <xsl:otherwise>
5059
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
5060
+ </xsl:otherwise>
5061
+ </xsl:choose>
5018
5062
  </xsl:template>
5019
5063
 
5020
5064
  <xsl:template match="*[local-name()='underline']">
@@ -5370,8 +5414,11 @@
5370
5414
 
5371
5415
  <xsl:template name="add-zero-spaces-link-java">
5372
5416
  <xsl:param name="text" select="."/>
5417
+
5418
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
5419
+ <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5373
5420
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
5374
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
5421
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
5375
5422
  </xsl:template>
5376
5423
 
5377
5424
  <!-- add zero space after dash character (for table's entries) -->
@@ -5928,6 +5975,9 @@
5928
5975
  <xsl:value-of select="substring($str, 2)"/>
5929
5976
  </xsl:template>
5930
5977
 
5978
+ <!-- ======================================= -->
5979
+ <!-- math -->
5980
+ <!-- ======================================= -->
5931
5981
  <xsl:template match="mathml:math">
5932
5982
  <xsl:variable name="isAdded" select="@added"/>
5933
5983
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -5978,14 +6028,57 @@
5978
6028
  <xsl:value-of select="$comment_text"/>
5979
6029
  </xsl:template>
5980
6030
 
6031
+ <xsl:template match="*[local-name() = 'asciimath']">
6032
+ <xsl:param name="process" select="'false'"/>
6033
+ <xsl:if test="$process = 'true'">
6034
+ <xsl:apply-templates/>
6035
+ </xsl:if>
6036
+ </xsl:template>
6037
+
6038
+ <xsl:template match="*[local-name() = 'latexmath']"/>
6039
+
6040
+ <xsl:template name="getMathml_asciimath_text">
6041
+ <xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/>
6042
+ <xsl:variable name="latexmath">
6043
+
6044
+ </xsl:variable>
6045
+ <xsl:variable name="asciimath_text_following">
6046
+ <xsl:choose>
6047
+ <xsl:when test="normalize-space($latexmath) != ''">
6048
+ <xsl:value-of select="$latexmath"/>
6049
+ </xsl:when>
6050
+ <xsl:when test="normalize-space($asciimath) != ''">
6051
+ <xsl:value-of select="$asciimath"/>
6052
+ </xsl:when>
6053
+ <xsl:otherwise>
6054
+ <xsl:value-of select="following-sibling::node()[1][self::comment()]"/>
6055
+ </xsl:otherwise>
6056
+ </xsl:choose>
6057
+ </xsl:variable>
6058
+ <xsl:variable name="asciimath_text_">
6059
+ <xsl:choose>
6060
+ <xsl:when test="normalize-space($asciimath_text_following) != ''">
6061
+ <xsl:value-of select="$asciimath_text_following"/>
6062
+ </xsl:when>
6063
+ <xsl:otherwise>
6064
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
6065
+ </xsl:otherwise>
6066
+ </xsl:choose>
6067
+ </xsl:variable>
6068
+ <xsl:variable name="asciimath_text_2" select="java:org.metanorma.fop.Util.unescape($asciimath_text_)"/>
6069
+ <xsl:variable name="asciimath_text" select="java:trim(java:java.lang.String.new($asciimath_text_2))"/>
6070
+ <xsl:value-of select="$asciimath_text"/>
6071
+ </xsl:template>
6072
+
5981
6073
  <xsl:template name="mathml_instream_object">
5982
- <xsl:param name="comment_text"/>
6074
+ <xsl:param name="asciimath_text"/>
5983
6075
  <xsl:param name="mathml_content"/>
5984
6076
 
5985
- <xsl:variable name="comment_text_">
6077
+ <xsl:variable name="asciimath_text_">
5986
6078
  <xsl:choose>
5987
- <xsl:when test="normalize-space($comment_text) != ''"><xsl:value-of select="$comment_text"/></xsl:when>
5988
- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
6079
+ <xsl:when test="normalize-space($asciimath_text) != ''"><xsl:value-of select="$asciimath_text"/></xsl:when>
6080
+ <!-- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> -->
6081
+ <xsl:otherwise><xsl:call-template name="getMathml_asciimath_text"/></xsl:otherwise>
5989
6082
  </xsl:choose>
5990
6083
  </xsl:variable>
5991
6084
 
@@ -6002,10 +6095,10 @@
6002
6095
  </xsl:attribute>
6003
6096
 
6004
6097
  <!-- <xsl:if test="$add_math_as_text = 'true'"> -->
6005
- <xsl:if test="normalize-space($comment_text_) != ''">
6098
+ <xsl:if test="normalize-space($asciimath_text_) != ''">
6006
6099
  <!-- put Mathin Alternate Text -->
6007
6100
  <xsl:attribute name="fox:alt-text">
6008
- <xsl:value-of select="$comment_text_"/>
6101
+ <xsl:value-of select="$asciimath_text_"/>
6009
6102
  </xsl:attribute>
6010
6103
  </xsl:if>
6011
6104
  <!-- </xsl:if> -->
@@ -6078,6 +6171,29 @@
6078
6171
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
6079
6172
  </xsl:template>
6080
6173
 
6174
+ <!-- Examples:
6175
+ <stem type="AsciiMath">x = 1</stem>
6176
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
6177
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
6178
+ -->
6179
+ <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
6180
+ <fo:inline xsl:use-attribute-sets="mathml-style">
6181
+
6182
+ <xsl:choose>
6183
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
6184
+ <xsl:otherwise>
6185
+ <xsl:apply-templates>
6186
+ <xsl:with-param name="process">true</xsl:with-param>
6187
+ </xsl:apply-templates>
6188
+ </xsl:otherwise>
6189
+ </xsl:choose>
6190
+
6191
+ </fo:inline>
6192
+ </xsl:template>
6193
+ <!-- ======================================= -->
6194
+ <!-- END: math -->
6195
+ <!-- ======================================= -->
6196
+
6081
6197
  <xsl:template match="*[local-name()='localityStack']"/>
6082
6198
 
6083
6199
  <xsl:template match="*[local-name()='link']" name="link">
@@ -7442,9 +7558,9 @@
7442
7558
  <xsl:apply-templates mode="contents_item"/>
7443
7559
  </xsl:template>
7444
7560
 
7445
- <!-- ====== -->
7446
- <!-- sourcecode -->
7447
- <!-- ====== -->
7561
+ <!-- =============== -->
7562
+ <!-- sourcecode -->
7563
+ <!-- =============== -->
7448
7564
  <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
7449
7565
 
7450
7566
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
@@ -7483,8 +7599,10 @@
7483
7599
  <xsl:if test="$current_template = 'standard'">8</xsl:if>
7484
7600
  </xsl:if> -->
7485
7601
 
7486
- 9.5
7487
-
7602
+ <xsl:choose>
7603
+ <xsl:when test="ancestor::*[local-name() = 'table']">8.5</xsl:when>
7604
+ <xsl:otherwise>9.5</xsl:otherwise>
7605
+ </xsl:choose>
7488
7606
 
7489
7607
  </xsl:variable>
7490
7608
 
@@ -7756,8 +7874,22 @@
7756
7874
  </fo:block>
7757
7875
  </xsl:if>
7758
7876
  </xsl:template>
7759
- <!-- ====== -->
7760
- <!-- ====== -->
7877
+ <!-- =============== -->
7878
+ <!-- END sourcecode -->
7879
+ <!-- =============== -->
7880
+
7881
+ <!-- =============== -->
7882
+ <!-- pre -->
7883
+ <!-- =============== -->
7884
+ <xsl:template match="*[local-name()='pre']" name="pre">
7885
+ <fo:block xsl:use-attribute-sets="pre-style">
7886
+ <xsl:copy-of select="@id"/>
7887
+ <xsl:apply-templates/>
7888
+ </fo:block>
7889
+ </xsl:template>
7890
+ <!-- =============== -->
7891
+ <!-- pre -->
7892
+ <!-- =============== -->
7761
7893
 
7762
7894
  <!-- ========== -->
7763
7895
  <!-- permission -->
@@ -8031,7 +8163,8 @@
8031
8163
  <xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
8032
8164
  <fo:block font-size="11pt">
8033
8165
 
8034
- <xsl:attribute name="color"><xsl:value-of select="$color_design"/></xsl:attribute>
8166
+ <!-- <xsl:attribute name="color"><xsl:value-of select="$color_design"/></xsl:attribute> -->
8167
+ <xsl:attribute name="color">white</xsl:attribute>
8035
8168
 
8036
8169
  <xsl:apply-templates/>
8037
8170
  </fo:block>
@@ -9837,7 +9970,7 @@
9837
9970
 
9838
9971
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
9839
9972
 
9840
- <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'])]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
9973
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
9841
9974
 
9842
9975
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
9843
9976
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
@@ -10313,13 +10446,14 @@
10313
10446
  </xsl:template>
10314
10447
 
10315
10448
  <xsl:template name="setId">
10449
+ <xsl:param name="prefix"/>
10316
10450
  <xsl:attribute name="id">
10317
10451
  <xsl:choose>
10318
10452
  <xsl:when test="@id">
10319
- <xsl:value-of select="@id"/>
10453
+ <xsl:value-of select="concat($prefix, @id)"/>
10320
10454
  </xsl:when>
10321
10455
  <xsl:otherwise>
10322
- <xsl:value-of select="generate-id()"/>
10456
+ <xsl:value-of select="concat($prefix, generate-id())"/>
10323
10457
  </xsl:otherwise>
10324
10458
  </xsl:choose>
10325
10459
  </xsl:attribute>
@@ -1060,6 +1060,14 @@
1060
1060
 
1061
1061
  </xsl:attribute-set>
1062
1062
 
1063
+ <xsl:attribute-set name="pre-style">
1064
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1065
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1066
+
1067
+ <xsl:attribute name="line-height">113%</xsl:attribute>
1068
+
1069
+ </xsl:attribute-set>
1070
+
1063
1071
  <xsl:attribute-set name="permission-style">
1064
1072
 
1065
1073
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -1208,6 +1216,11 @@
1208
1216
  </xsl:variable>
1209
1217
  <xsl:variable name="table-border" select="normalize-space($table-border_)"/>
1210
1218
 
1219
+ <xsl:variable name="table-cell-border_">
1220
+
1221
+ </xsl:variable>
1222
+ <xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/>
1223
+
1211
1224
  <xsl:attribute-set name="table-container-style">
1212
1225
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
1213
1226
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -1220,8 +1233,6 @@
1220
1233
  <xsl:attribute-set name="table-style">
1221
1234
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
1222
1235
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
1223
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1224
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1225
1236
 
1226
1237
  </xsl:attribute-set><!-- table-style -->
1227
1238
 
@@ -2407,6 +2418,12 @@
2407
2418
  <xsl:variable name="table_attributes">
2408
2419
 
2409
2420
  <xsl:element name="table_attributes" use-attribute-sets="table-style">
2421
+
2422
+ <xsl:if test="$margin-side != 0">
2423
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2424
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2425
+ </xsl:if>
2426
+
2410
2427
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
2411
2428
 
2412
2429
  </xsl:element>
@@ -3162,6 +3179,10 @@
3162
3179
  <xsl:template match="*[local-name()='tr']">
3163
3180
  <fo:table-row xsl:use-attribute-sets="table-body-row-style">
3164
3181
 
3182
+ <xsl:if test="*[local-name() = 'th']">
3183
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
3184
+ </xsl:if>
3185
+
3165
3186
  <xsl:call-template name="setTableRowAttributes"/>
3166
3187
  <xsl:apply-templates/>
3167
3188
  </fo:table-row>
@@ -4192,8 +4213,10 @@
4192
4213
 
4193
4214
  <!-- 10 -->
4194
4215
 
4195
- 9.5
4196
-
4216
+ <xsl:choose>
4217
+ <xsl:when test="ancestor::*[local-name() = 'table']">8.5</xsl:when>
4218
+ <xsl:otherwise>9.5</xsl:otherwise>
4219
+ </xsl:choose>
4197
4220
 
4198
4221
  </xsl:variable>
4199
4222
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -4211,8 +4234,17 @@
4211
4234
  </fo:inline>
4212
4235
  </xsl:template> <!-- tt -->
4213
4236
 
4237
+ <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4214
4238
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4215
- <xsl:call-template name="add_spaces_to_sourcecode"/>
4239
+ <xsl:choose>
4240
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4241
+ <!-- url -->
4242
+ <xsl:call-template name="add-zero-spaces-link-java"/>
4243
+ </xsl:when>
4244
+ <xsl:otherwise>
4245
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
4246
+ </xsl:otherwise>
4247
+ </xsl:choose>
4216
4248
  </xsl:template>
4217
4249
 
4218
4250
  <xsl:template match="*[local-name()='underline']">
@@ -4568,8 +4600,11 @@
4568
4600
 
4569
4601
  <xsl:template name="add-zero-spaces-link-java">
4570
4602
  <xsl:param name="text" select="."/>
4603
+
4604
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
4605
+ <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
4571
4606
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4572
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
4607
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
4573
4608
  </xsl:template>
4574
4609
 
4575
4610
  <!-- add zero space after dash character (for table's entries) -->
@@ -5126,6 +5161,9 @@
5126
5161
  <xsl:value-of select="substring($str, 2)"/>
5127
5162
  </xsl:template>
5128
5163
 
5164
+ <!-- ======================================= -->
5165
+ <!-- math -->
5166
+ <!-- ======================================= -->
5129
5167
  <xsl:template match="mathml:math">
5130
5168
  <xsl:variable name="isAdded" select="@added"/>
5131
5169
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -5176,14 +5214,57 @@
5176
5214
  <xsl:value-of select="$comment_text"/>
5177
5215
  </xsl:template>
5178
5216
 
5217
+ <xsl:template match="*[local-name() = 'asciimath']">
5218
+ <xsl:param name="process" select="'false'"/>
5219
+ <xsl:if test="$process = 'true'">
5220
+ <xsl:apply-templates/>
5221
+ </xsl:if>
5222
+ </xsl:template>
5223
+
5224
+ <xsl:template match="*[local-name() = 'latexmath']"/>
5225
+
5226
+ <xsl:template name="getMathml_asciimath_text">
5227
+ <xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/>
5228
+ <xsl:variable name="latexmath">
5229
+
5230
+ </xsl:variable>
5231
+ <xsl:variable name="asciimath_text_following">
5232
+ <xsl:choose>
5233
+ <xsl:when test="normalize-space($latexmath) != ''">
5234
+ <xsl:value-of select="$latexmath"/>
5235
+ </xsl:when>
5236
+ <xsl:when test="normalize-space($asciimath) != ''">
5237
+ <xsl:value-of select="$asciimath"/>
5238
+ </xsl:when>
5239
+ <xsl:otherwise>
5240
+ <xsl:value-of select="following-sibling::node()[1][self::comment()]"/>
5241
+ </xsl:otherwise>
5242
+ </xsl:choose>
5243
+ </xsl:variable>
5244
+ <xsl:variable name="asciimath_text_">
5245
+ <xsl:choose>
5246
+ <xsl:when test="normalize-space($asciimath_text_following) != ''">
5247
+ <xsl:value-of select="$asciimath_text_following"/>
5248
+ </xsl:when>
5249
+ <xsl:otherwise>
5250
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
5251
+ </xsl:otherwise>
5252
+ </xsl:choose>
5253
+ </xsl:variable>
5254
+ <xsl:variable name="asciimath_text_2" select="java:org.metanorma.fop.Util.unescape($asciimath_text_)"/>
5255
+ <xsl:variable name="asciimath_text" select="java:trim(java:java.lang.String.new($asciimath_text_2))"/>
5256
+ <xsl:value-of select="$asciimath_text"/>
5257
+ </xsl:template>
5258
+
5179
5259
  <xsl:template name="mathml_instream_object">
5180
- <xsl:param name="comment_text"/>
5260
+ <xsl:param name="asciimath_text"/>
5181
5261
  <xsl:param name="mathml_content"/>
5182
5262
 
5183
- <xsl:variable name="comment_text_">
5263
+ <xsl:variable name="asciimath_text_">
5184
5264
  <xsl:choose>
5185
- <xsl:when test="normalize-space($comment_text) != ''"><xsl:value-of select="$comment_text"/></xsl:when>
5186
- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
5265
+ <xsl:when test="normalize-space($asciimath_text) != ''"><xsl:value-of select="$asciimath_text"/></xsl:when>
5266
+ <!-- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> -->
5267
+ <xsl:otherwise><xsl:call-template name="getMathml_asciimath_text"/></xsl:otherwise>
5187
5268
  </xsl:choose>
5188
5269
  </xsl:variable>
5189
5270
 
@@ -5200,10 +5281,10 @@
5200
5281
  </xsl:attribute>
5201
5282
 
5202
5283
  <!-- <xsl:if test="$add_math_as_text = 'true'"> -->
5203
- <xsl:if test="normalize-space($comment_text_) != ''">
5284
+ <xsl:if test="normalize-space($asciimath_text_) != ''">
5204
5285
  <!-- put Mathin Alternate Text -->
5205
5286
  <xsl:attribute name="fox:alt-text">
5206
- <xsl:value-of select="$comment_text_"/>
5287
+ <xsl:value-of select="$asciimath_text_"/>
5207
5288
  </xsl:attribute>
5208
5289
  </xsl:if>
5209
5290
  <!-- </xsl:if> -->
@@ -5276,6 +5357,29 @@
5276
5357
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
5277
5358
  </xsl:template>
5278
5359
 
5360
+ <!-- Examples:
5361
+ <stem type="AsciiMath">x = 1</stem>
5362
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
5363
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
5364
+ -->
5365
+ <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
5366
+ <fo:inline xsl:use-attribute-sets="mathml-style">
5367
+
5368
+ <xsl:choose>
5369
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5370
+ <xsl:otherwise>
5371
+ <xsl:apply-templates>
5372
+ <xsl:with-param name="process">true</xsl:with-param>
5373
+ </xsl:apply-templates>
5374
+ </xsl:otherwise>
5375
+ </xsl:choose>
5376
+
5377
+ </fo:inline>
5378
+ </xsl:template>
5379
+ <!-- ======================================= -->
5380
+ <!-- END: math -->
5381
+ <!-- ======================================= -->
5382
+
5279
5383
  <xsl:template match="*[local-name()='localityStack']"/>
5280
5384
 
5281
5385
  <xsl:template match="*[local-name()='link']" name="link">
@@ -6613,9 +6717,9 @@
6613
6717
  <xsl:apply-templates mode="contents_item"/>
6614
6718
  </xsl:template>
6615
6719
 
6616
- <!-- ====== -->
6617
- <!-- sourcecode -->
6618
- <!-- ====== -->
6720
+ <!-- =============== -->
6721
+ <!-- sourcecode -->
6722
+ <!-- =============== -->
6619
6723
  <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6620
6724
 
6621
6725
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
@@ -6650,8 +6754,10 @@
6650
6754
  <xsl:if test="$current_template = 'standard'">8</xsl:if>
6651
6755
  </xsl:if> -->
6652
6756
 
6653
- 9.5
6654
-
6757
+ <xsl:choose>
6758
+ <xsl:when test="ancestor::*[local-name() = 'table']">8.5</xsl:when>
6759
+ <xsl:otherwise>9.5</xsl:otherwise>
6760
+ </xsl:choose>
6655
6761
 
6656
6762
  </xsl:variable>
6657
6763
 
@@ -6915,8 +7021,22 @@
6915
7021
  </fo:block>
6916
7022
  </xsl:if>
6917
7023
  </xsl:template>
6918
- <!-- ====== -->
6919
- <!-- ====== -->
7024
+ <!-- =============== -->
7025
+ <!-- END sourcecode -->
7026
+ <!-- =============== -->
7027
+
7028
+ <!-- =============== -->
7029
+ <!-- pre -->
7030
+ <!-- =============== -->
7031
+ <xsl:template match="*[local-name()='pre']" name="pre">
7032
+ <fo:block xsl:use-attribute-sets="pre-style">
7033
+ <xsl:copy-of select="@id"/>
7034
+ <xsl:apply-templates/>
7035
+ </fo:block>
7036
+ </xsl:template>
7037
+ <!-- =============== -->
7038
+ <!-- pre -->
7039
+ <!-- =============== -->
6920
7040
 
6921
7041
  <!-- ========== -->
6922
7042
  <!-- permission -->
@@ -7190,7 +7310,8 @@
7190
7310
  <xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
7191
7311
  <fo:block font-size="11pt">
7192
7312
 
7193
- <xsl:attribute name="color"><xsl:value-of select="$color_design"/></xsl:attribute>
7313
+ <!-- <xsl:attribute name="color"><xsl:value-of select="$color_design"/></xsl:attribute> -->
7314
+ <xsl:attribute name="color">white</xsl:attribute>
7194
7315
 
7195
7316
  <xsl:apply-templates/>
7196
7317
  </fo:block>
@@ -9003,7 +9124,7 @@
9003
9124
 
9004
9125
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
9005
9126
 
9006
- <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'])]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
9127
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
9007
9128
 
9008
9129
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
9009
9130
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
@@ -9479,13 +9600,14 @@
9479
9600
  </xsl:template>
9480
9601
 
9481
9602
  <xsl:template name="setId">
9603
+ <xsl:param name="prefix"/>
9482
9604
  <xsl:attribute name="id">
9483
9605
  <xsl:choose>
9484
9606
  <xsl:when test="@id">
9485
- <xsl:value-of select="@id"/>
9607
+ <xsl:value-of select="concat($prefix, @id)"/>
9486
9608
  </xsl:when>
9487
9609
  <xsl:otherwise>
9488
- <xsl:value-of select="generate-id()"/>
9610
+ <xsl:value-of select="concat($prefix, generate-id())"/>
9489
9611
  </xsl:otherwise>
9490
9612
  </xsl:choose>
9491
9613
  </xsl:attribute>