metanorma-ogc 2.2.5 → 2.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/ogc/html/htmlstyle.css +15 -0
  3. data/lib/isodoc/ogc/html/htmlstyle.scss +1 -0
  4. data/lib/isodoc/ogc/html/wordstyle.css +150 -0
  5. data/lib/isodoc/ogc/html/wordstyle.scss +144 -0
  6. data/lib/isodoc/ogc/html/wordstyle_wp.css +126 -0
  7. data/lib/isodoc/ogc/html/wordstyle_wp.scss +121 -0
  8. data/lib/isodoc/ogc/metadata.rb +7 -6
  9. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +320 -80
  10. data/lib/isodoc/ogc/ogc.best-practice.xsl +320 -80
  11. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +320 -80
  12. data/lib/isodoc/ogc/ogc.community-practice.xsl +320 -80
  13. data/lib/isodoc/ogc/ogc.community-standard.xsl +320 -80
  14. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +320 -80
  15. data/lib/isodoc/ogc/ogc.draft-standard.xsl +11036 -0
  16. data/lib/isodoc/ogc/ogc.engineering-report.xsl +320 -80
  17. data/lib/isodoc/ogc/ogc.other.xsl +320 -80
  18. data/lib/isodoc/ogc/ogc.policy.xsl +320 -80
  19. data/lib/isodoc/ogc/ogc.reference-model.xsl +320 -80
  20. data/lib/isodoc/ogc/ogc.release-notes.xsl +320 -80
  21. data/lib/isodoc/ogc/ogc.standard.xsl +320 -80
  22. data/lib/isodoc/ogc/ogc.test-suite.xsl +320 -80
  23. data/lib/isodoc/ogc/ogc.user-guide.xsl +320 -80
  24. data/lib/isodoc/ogc/ogc.white-paper.xsl +308 -69
  25. data/lib/isodoc/ogc/pdf_convert.rb +5 -4
  26. data/lib/isodoc/ogc/presentation_xml_convert.rb +5 -5
  27. data/lib/metanorma/ogc/biblio.rng +5 -0
  28. data/lib/metanorma/ogc/cleanup.rb +14 -14
  29. data/lib/metanorma/ogc/converter.rb +2 -2
  30. data/lib/metanorma/ogc/front.rb +12 -8
  31. data/lib/metanorma/ogc/isodoc.rng +47 -13
  32. data/lib/metanorma/ogc/relaton-ogc.rng +1 -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 +5 -11
  37. data/.github/workflows/automerge.yml +0 -31
  38. data/.github/workflows/rake.yml +0 -15
  39. data/.github/workflows/release.yml +0 -24
  40. data/Rakefile +0 -8
  41. data/bin/console +0 -14
  42. data/bin/rspec +0 -17
  43. 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%"/>
@@ -1442,6 +1442,8 @@
1442
1442
  </fo:static-content>
1443
1443
  </xsl:template>
1444
1444
 
1445
+ <xsl:strip-space elements="ogc:xref"/>
1446
+
1445
1447
  <!-- external parameters -->
1446
1448
 
1447
1449
  <xsl:param name="svg_images"/> <!-- svg images array -->
@@ -1883,6 +1885,15 @@
1883
1885
 
1884
1886
  </xsl:attribute-set>
1885
1887
 
1888
+ <xsl:attribute-set name="pre-style">
1889
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1890
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1891
+
1892
+ <xsl:attribute name="font-family">Fira Code, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1893
+ <xsl:attribute name="line-height">113%</xsl:attribute>
1894
+
1895
+ </xsl:attribute-set>
1896
+
1886
1897
  <xsl:attribute-set name="permission-style">
1887
1898
 
1888
1899
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -2026,6 +2037,11 @@
2026
2037
  </xsl:variable>
2027
2038
  <xsl:variable name="table-border" select="normalize-space($table-border_)"/>
2028
2039
 
2040
+ <xsl:variable name="table-cell-border_">
2041
+
2042
+ </xsl:variable>
2043
+ <xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/>
2044
+
2029
2045
  <xsl:attribute-set name="table-container-style">
2030
2046
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2031
2047
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -2037,8 +2053,6 @@
2037
2053
  <xsl:attribute-set name="table-style">
2038
2054
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
2039
2055
  <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
2056
 
2043
2057
  </xsl:attribute-set><!-- table-style -->
2044
2058
 
@@ -2920,17 +2934,22 @@
2920
2934
  </xsl:for-each>
2921
2935
  </xsl:template>
2922
2936
 
2937
+ <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2923
2938
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
2924
2939
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
2925
2940
  <xsl:template match="text()" name="text">
2926
2941
 
2927
- <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2928
- <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_fo_inline_keep-together_within-line_open,'$1',$tag_fo_inline_keep-together_within-line_close))"/>
2929
- <xsl:call-template name="replace_fo_inline_tags">
2930
- <xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/>
2931
- <xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/>
2932
- <xsl:with-param name="text" select="$text"/>
2933
- </xsl:call-template>
2942
+ <xsl:choose>
2943
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:value-of select="."/></xsl:when>
2944
+ <xsl:otherwise>
2945
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_fo_inline_keep-together_within-line_open,'$1',$tag_fo_inline_keep-together_within-line_close))"/>
2946
+ <xsl:call-template name="replace_fo_inline_tags">
2947
+ <xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/>
2948
+ <xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/>
2949
+ <xsl:with-param name="text" select="$text"/>
2950
+ </xsl:call-template>
2951
+ </xsl:otherwise>
2952
+ </xsl:choose>
2934
2953
 
2935
2954
  </xsl:template>
2936
2955
 
@@ -3208,6 +3227,12 @@
3208
3227
  <xsl:variable name="table_attributes">
3209
3228
 
3210
3229
  <xsl:element name="table_attributes" use-attribute-sets="table-style">
3230
+
3231
+ <xsl:if test="$margin-side != 0">
3232
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3233
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3234
+ </xsl:if>
3235
+
3211
3236
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
3212
3237
 
3213
3238
  </xsl:element>
@@ -3961,6 +3986,10 @@
3961
3986
  <xsl:template match="*[local-name()='tr']">
3962
3987
  <fo:table-row xsl:use-attribute-sets="table-body-row-style">
3963
3988
 
3989
+ <xsl:if test="count(*) = count(*[local-name() = 'th'])"> <!-- row contains 'th' only -->
3990
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
3991
+ </xsl:if>
3992
+
3964
3993
  <xsl:variable name="number"><xsl:number/></xsl:variable>
3965
3994
  <xsl:attribute name="background-color">
3966
3995
  <xsl:choose>
@@ -4941,7 +4970,8 @@
4941
4970
  <xsl:copy-of select="node()"/>
4942
4971
  </td>
4943
4972
  <td>
4944
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4973
+ <!-- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/> -->
4974
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]" mode="dl_if"/>
4945
4975
  <!-- get paragraphs from nested 'dl' -->
4946
4976
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4947
4977
  </td>
@@ -4949,6 +4979,53 @@
4949
4979
  </xsl:template>
4950
4980
  <xsl:template match="*[local-name()='dd']" mode="dl_if"/>
4951
4981
 
4982
+ <xsl:template match="*" mode="dl_if">
4983
+ <xsl:copy-of select="."/>
4984
+ </xsl:template>
4985
+
4986
+ <xsl:template match="*[local-name() = 'p']" mode="dl_if">
4987
+ <xsl:param name="indent"/>
4988
+ <p>
4989
+ <xsl:copy-of select="@*"/>
4990
+ <xsl:value-of select="$indent"/>
4991
+ <xsl:copy-of select="node()"/>
4992
+ </p>
4993
+
4994
+ </xsl:template>
4995
+
4996
+ <xsl:template match="*[local-name() = 'ul' or local-name() = 'ol']" mode="dl_if">
4997
+ <xsl:variable name="list_rendered_">
4998
+ <xsl:apply-templates select="."/>
4999
+ </xsl:variable>
5000
+ <xsl:variable name="list_rendered" select="xalan:nodeset($list_rendered_)"/>
5001
+
5002
+ <xsl:variable name="indent">
5003
+ <xsl:for-each select="($list_rendered//fo:block[not(.//fo:block)])[1]">
5004
+ <xsl:apply-templates select="ancestor::*[@provisional-distance-between-starts]/@provisional-distance-between-starts" mode="dl_if"/>
5005
+ </xsl:for-each>
5006
+ </xsl:variable>
5007
+
5008
+ <xsl:apply-templates mode="dl_if">
5009
+ <xsl:with-param name="indent" select="$indent"/>
5010
+ </xsl:apply-templates>
5011
+ </xsl:template>
5012
+
5013
+ <xsl:template match="*[local-name() = 'li']" mode="dl_if">
5014
+ <xsl:param name="indent"/>
5015
+ <xsl:apply-templates mode="dl_if">
5016
+ <xsl:with-param name="indent" select="$indent"/>
5017
+ </xsl:apply-templates>
5018
+ </xsl:template>
5019
+
5020
+ <xsl:template match="@provisional-distance-between-starts" mode="dl_if">
5021
+ <xsl:variable name="value" select="round(substring-before(.,'mm'))"/>
5022
+ <!-- emulate left indent for list item -->
5023
+ <xsl:call-template name="repeat">
5024
+ <xsl:with-param name="char" select="'x'"/>
5025
+ <xsl:with-param name="count" select="$value"/>
5026
+ </xsl:call-template>
5027
+ </xsl:template>
5028
+
4952
5029
  <xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
4953
5030
  <xsl:for-each select="*[local-name() = 'dt']">
4954
5031
  <p>
@@ -5347,6 +5424,7 @@
5347
5424
  </word>
5348
5425
  <xsl:call-template name="tokenize_with_tags">
5349
5426
  <xsl:with-param name="text" select="substring-after($text, $separator)"/>
5427
+ <xsl:with-param name="tags" select="$tags"/>
5350
5428
  </xsl:call-template>
5351
5429
  </xsl:otherwise>
5352
5430
  </xsl:choose>
@@ -5386,8 +5464,18 @@
5386
5464
 
5387
5465
  <xsl:template name="add-zero-spaces-java">
5388
5466
  <xsl:param name="text" select="."/>
5389
- <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
5390
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
5467
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, arrow right -->
5468
+ <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |→)','$1​')"/>
5469
+ <!-- add zero-width space (#x200B) after characters: 'great than' -->
5470
+ <xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1), '(\u003e)(?!\u003e)', '$1​')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
5471
+ <!-- add zero-width space (#x200B) before characters: 'less than' -->
5472
+ <xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2), '(?&lt;!\u003c)(\u003c)', '​$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
5473
+ <!-- add zero-width space (#x200B) before character: { -->
5474
+ <xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
5475
+ <!-- add zero-width space (#x200B) after character: , -->
5476
+ <xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
5477
+
5478
+ <xsl:value-of select="$text5"/>
5391
5479
  </xsl:template>
5392
5480
 
5393
5481
  <xsl:template name="add-zero-spaces-link-java">
@@ -5533,7 +5621,7 @@
5533
5621
  </xsl:copy>
5534
5622
  </xsl:template>
5535
5623
 
5536
- <xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p'])]" mode="table-without-br">
5624
+ <xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode'])]" mode="table-without-br">
5537
5625
  <xsl:copy>
5538
5626
  <xsl:copy-of select="@*"/>
5539
5627
  <p>
@@ -5581,6 +5669,28 @@
5581
5669
  </xsl:for-each>
5582
5670
  </xsl:template>
5583
5671
 
5672
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'sourcecode']" mode="table-without-br">
5673
+ <xsl:apply-templates mode="table-without-br"/>
5674
+ </xsl:template>
5675
+
5676
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'sourcecode']/text()[contains(., '&#13;') or contains(., '&#10;')]" mode="table-without-br">
5677
+
5678
+ <xsl:variable name="sep">###SOURCECODE_NEWLINE###</xsl:variable>
5679
+ <xsl:variable name="sourcecode_text" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', $sep)"/>
5680
+ <xsl:variable name="items">
5681
+ <xsl:call-template name="split">
5682
+ <xsl:with-param name="pText" select="$sourcecode_text"/>
5683
+ <xsl:with-param name="sep" select="$sep"/>
5684
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
5685
+ </xsl:call-template>
5686
+ </xsl:variable>
5687
+ <xsl:for-each select="xalan:nodeset($items)/*">
5688
+ <p>
5689
+ <sourcecode><xsl:copy-of select="node()"/></sourcecode>
5690
+ </p>
5691
+ </xsl:for-each>
5692
+ </xsl:template>
5693
+
5584
5694
  <!-- remove redundant white spaces -->
5585
5695
  <xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br">
5586
5696
  <xsl:variable name="text" select="translate(.,'&#9;&#10;&#13;','')"/>
@@ -5891,6 +6001,7 @@
5891
6001
  <xsl:if test="ancestor::*[local-name() = 'sub']"><tag>sub</tag></xsl:if>
5892
6002
  <xsl:if test="ancestor::*[local-name() = 'sup']"><tag>sup</tag></xsl:if>
5893
6003
  <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
6004
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
5894
6005
  <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
5895
6006
  </tags>
5896
6007
  </xsl:template>
@@ -5953,6 +6064,9 @@
5953
6064
  <xsl:value-of select="substring($str, 2)"/>
5954
6065
  </xsl:template>
5955
6066
 
6067
+ <!-- ======================================= -->
6068
+ <!-- math -->
6069
+ <!-- ======================================= -->
5956
6070
  <xsl:template match="mathml:math">
5957
6071
  <xsl:variable name="isAdded" select="@added"/>
5958
6072
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -6003,14 +6117,57 @@
6003
6117
  <xsl:value-of select="$comment_text"/>
6004
6118
  </xsl:template>
6005
6119
 
6120
+ <xsl:template match="*[local-name() = 'asciimath']">
6121
+ <xsl:param name="process" select="'false'"/>
6122
+ <xsl:if test="$process = 'true'">
6123
+ <xsl:apply-templates/>
6124
+ </xsl:if>
6125
+ </xsl:template>
6126
+
6127
+ <xsl:template match="*[local-name() = 'latexmath']"/>
6128
+
6129
+ <xsl:template name="getMathml_asciimath_text">
6130
+ <xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/>
6131
+ <xsl:variable name="latexmath">
6132
+
6133
+ </xsl:variable>
6134
+ <xsl:variable name="asciimath_text_following">
6135
+ <xsl:choose>
6136
+ <xsl:when test="normalize-space($latexmath) != ''">
6137
+ <xsl:value-of select="$latexmath"/>
6138
+ </xsl:when>
6139
+ <xsl:when test="normalize-space($asciimath) != ''">
6140
+ <xsl:value-of select="$asciimath"/>
6141
+ </xsl:when>
6142
+ <xsl:otherwise>
6143
+ <xsl:value-of select="following-sibling::node()[1][self::comment()]"/>
6144
+ </xsl:otherwise>
6145
+ </xsl:choose>
6146
+ </xsl:variable>
6147
+ <xsl:variable name="asciimath_text_">
6148
+ <xsl:choose>
6149
+ <xsl:when test="normalize-space($asciimath_text_following) != ''">
6150
+ <xsl:value-of select="$asciimath_text_following"/>
6151
+ </xsl:when>
6152
+ <xsl:otherwise>
6153
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
6154
+ </xsl:otherwise>
6155
+ </xsl:choose>
6156
+ </xsl:variable>
6157
+ <xsl:variable name="asciimath_text_2" select="java:org.metanorma.fop.Util.unescape($asciimath_text_)"/>
6158
+ <xsl:variable name="asciimath_text" select="java:trim(java:java.lang.String.new($asciimath_text_2))"/>
6159
+ <xsl:value-of select="$asciimath_text"/>
6160
+ </xsl:template>
6161
+
6006
6162
  <xsl:template name="mathml_instream_object">
6007
- <xsl:param name="comment_text"/>
6163
+ <xsl:param name="asciimath_text"/>
6008
6164
  <xsl:param name="mathml_content"/>
6009
6165
 
6010
- <xsl:variable name="comment_text_">
6166
+ <xsl:variable name="asciimath_text_">
6011
6167
  <xsl:choose>
6012
- <xsl:when test="normalize-space($comment_text) != ''"><xsl:value-of select="$comment_text"/></xsl:when>
6013
- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
6168
+ <xsl:when test="normalize-space($asciimath_text) != ''"><xsl:value-of select="$asciimath_text"/></xsl:when>
6169
+ <!-- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> -->
6170
+ <xsl:otherwise><xsl:call-template name="getMathml_asciimath_text"/></xsl:otherwise>
6014
6171
  </xsl:choose>
6015
6172
  </xsl:variable>
6016
6173
 
@@ -6027,10 +6184,10 @@
6027
6184
  </xsl:attribute>
6028
6185
 
6029
6186
  <!-- <xsl:if test="$add_math_as_text = 'true'"> -->
6030
- <xsl:if test="normalize-space($comment_text_) != ''">
6187
+ <xsl:if test="normalize-space($asciimath_text_) != ''">
6031
6188
  <!-- put Mathin Alternate Text -->
6032
6189
  <xsl:attribute name="fox:alt-text">
6033
- <xsl:value-of select="$comment_text_"/>
6190
+ <xsl:value-of select="$asciimath_text_"/>
6034
6191
  </xsl:attribute>
6035
6192
  </xsl:if>
6036
6193
  <!-- </xsl:if> -->
@@ -6103,6 +6260,29 @@
6103
6260
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
6104
6261
  </xsl:template>
6105
6262
 
6263
+ <!-- Examples:
6264
+ <stem type="AsciiMath">x = 1</stem>
6265
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
6266
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
6267
+ -->
6268
+ <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
6269
+ <fo:inline xsl:use-attribute-sets="mathml-style">
6270
+
6271
+ <xsl:choose>
6272
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
6273
+ <xsl:otherwise>
6274
+ <xsl:apply-templates>
6275
+ <xsl:with-param name="process">true</xsl:with-param>
6276
+ </xsl:apply-templates>
6277
+ </xsl:otherwise>
6278
+ </xsl:choose>
6279
+
6280
+ </fo:inline>
6281
+ </xsl:template>
6282
+ <!-- ======================================= -->
6283
+ <!-- END: math -->
6284
+ <!-- ======================================= -->
6285
+
6106
6286
  <xsl:template match="*[local-name()='localityStack']"/>
6107
6287
 
6108
6288
  <xsl:template match="*[local-name()='link']" name="link">
@@ -6309,6 +6489,12 @@
6309
6489
 
6310
6490
  <fo:block-container margin-left="0mm">
6311
6491
 
6492
+ <!-- <xsl:if test="$namespace = 'iho'">
6493
+ <xsl:if test="ancestor::iho:td">
6494
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
6495
+ </xsl:if>
6496
+ </xsl:if> -->
6497
+
6312
6498
  <fo:block>
6313
6499
 
6314
6500
  <fo:inline xsl:use-attribute-sets="note-name-style">
@@ -7467,51 +7653,25 @@
7467
7653
  <xsl:apply-templates mode="contents_item"/>
7468
7654
  </xsl:template>
7469
7655
 
7470
- <!-- ====== -->
7471
- <!-- sourcecode -->
7472
- <!-- ====== -->
7656
+ <!-- =============== -->
7657
+ <!-- sourcecode -->
7658
+ <!-- =============== -->
7473
7659
  <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
7474
7660
 
7475
- <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
7476
-
7477
- <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
7478
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
7479
- </xsl:if>
7480
-
7481
- <xsl:if test="ancestor::*[local-name() = 'example']">
7482
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
7483
- </xsl:if>
7484
-
7485
- <xsl:copy-of select="@id"/>
7486
-
7487
- <xsl:if test="parent::*[local-name() = 'note']">
7488
- <xsl:attribute name="margin-left">
7489
- <xsl:choose>
7490
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
7491
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
7492
- </xsl:choose>
7493
- </xsl:attribute>
7494
-
7495
- </xsl:if>
7496
- <fo:block-container margin-left="0mm">
7497
-
7498
- <xsl:if test="parent::*[local-name() = 'example']">
7499
- <fo:block font-size="1pt" line-height="10%" space-after="4pt"> </fo:block>
7500
- </xsl:if>
7501
-
7502
- <fo:block xsl:use-attribute-sets="sourcecode-style">
7503
- <xsl:variable name="_font-size">
7661
+ <xsl:variable name="sourcecode_attributes">
7662
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
7663
+ <xsl:variable name="_font-size">
7504
7664
 
7505
- <!-- 9 -->
7665
+ <!-- 9 -->
7506
7666
 
7507
- <!-- <xsl:if test="$namespace = 'ieee'">
7508
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
7509
- </xsl:if> -->
7667
+ <!-- <xsl:if test="$namespace = 'ieee'">
7668
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
7669
+ </xsl:if> -->
7510
7670
 
7511
- <xsl:choose>
7512
- <xsl:when test="ancestor::*[local-name() = 'table']">8.5</xsl:when>
7513
- <xsl:otherwise>9.5</xsl:otherwise>
7514
- </xsl:choose>
7671
+ <xsl:choose>
7672
+ <xsl:when test="ancestor::*[local-name() = 'table']">8.5</xsl:when>
7673
+ <xsl:otherwise>9.5</xsl:otherwise>
7674
+ </xsl:choose>
7515
7675
 
7516
7676
  </xsl:variable>
7517
7677
 
@@ -7526,22 +7686,72 @@
7526
7686
  </xsl:choose>
7527
7687
  </xsl:attribute>
7528
7688
  </xsl:if>
7689
+ </xsl:element>
7690
+ </xsl:variable>
7529
7691
 
7530
- <xsl:if test="parent::*[local-name() = 'example']">
7531
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7692
+ <xsl:choose>
7693
+ <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
7694
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
7695
+ <xsl:attribute name="{local-name()}">
7696
+ <xsl:value-of select="."/>
7697
+ </xsl:attribute>
7698
+ </xsl:for-each>
7699
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7700
+ </xsl:when>
7701
+
7702
+ <xsl:otherwise>
7703
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
7704
+
7705
+ <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
7706
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
7532
7707
  </xsl:if>
7533
7708
 
7534
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7535
- </fo:block>
7709
+ <xsl:if test="ancestor::*[local-name() = 'example']">
7710
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
7711
+ </xsl:if>
7536
7712
 
7537
- <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
7713
+ <xsl:copy-of select="@id"/>
7538
7714
 
7539
- <xsl:if test="parent::*[local-name() = 'example']">
7540
- <fo:block font-size="1pt" line-height="10%" space-before="6pt"> </fo:block>
7541
- </xsl:if>
7715
+ <xsl:if test="parent::*[local-name() = 'note']">
7716
+ <xsl:attribute name="margin-left">
7717
+ <xsl:choose>
7718
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
7719
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
7720
+ </xsl:choose>
7721
+ </xsl:attribute>
7542
7722
 
7543
- </fo:block-container>
7544
- </fo:block-container>
7723
+ </xsl:if>
7724
+ <fo:block-container margin-left="0mm">
7725
+
7726
+ <xsl:if test="parent::*[local-name() = 'example']">
7727
+ <fo:block font-size="1pt" line-height="10%" space-after="4pt"> </fo:block>
7728
+ </xsl:if>
7729
+
7730
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
7731
+
7732
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
7733
+ <xsl:attribute name="{local-name()}">
7734
+ <xsl:value-of select="."/>
7735
+ </xsl:attribute>
7736
+ </xsl:for-each>
7737
+
7738
+ <xsl:if test="parent::*[local-name() = 'example']">
7739
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7740
+ </xsl:if>
7741
+
7742
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7743
+ </fo:block>
7744
+
7745
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
7746
+
7747
+ <xsl:if test="parent::*[local-name() = 'example']">
7748
+ <fo:block font-size="1pt" line-height="10%" space-before="6pt"> </fo:block>
7749
+ </xsl:if>
7750
+
7751
+ </fo:block-container>
7752
+ </fo:block-container>
7753
+ </xsl:otherwise>
7754
+ </xsl:choose>
7545
7755
  </xsl:template>
7546
7756
 
7547
7757
  <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -7783,8 +7993,22 @@
7783
7993
  </fo:block>
7784
7994
  </xsl:if>
7785
7995
  </xsl:template>
7786
- <!-- ====== -->
7787
- <!-- ====== -->
7996
+ <!-- =============== -->
7997
+ <!-- END sourcecode -->
7998
+ <!-- =============== -->
7999
+
8000
+ <!-- =============== -->
8001
+ <!-- pre -->
8002
+ <!-- =============== -->
8003
+ <xsl:template match="*[local-name()='pre']" name="pre">
8004
+ <fo:block xsl:use-attribute-sets="pre-style">
8005
+ <xsl:copy-of select="@id"/>
8006
+ <xsl:apply-templates/>
8007
+ </fo:block>
8008
+ </xsl:template>
8009
+ <!-- =============== -->
8010
+ <!-- pre -->
8011
+ <!-- =============== -->
7788
8012
 
7789
8013
  <!-- ========== -->
7790
8014
  <!-- permission -->
@@ -9757,7 +9981,9 @@
9757
9981
  <!-- ===================================== -->
9758
9982
  <!-- Update xml -->
9759
9983
  <!-- ===================================== -->
9984
+ <!-- =========================================================================== -->
9760
9985
  <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9986
+ <!-- =========================================================================== -->
9761
9987
  <xsl:template match="@*|node()" mode="update_xml_step1">
9762
9988
  <xsl:copy>
9763
9989
  <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
@@ -9849,10 +10075,15 @@
9849
10075
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
9850
10076
  <xsl:apply-templates mode="update_xml_step1"/>
9851
10077
  </xsl:template>
9852
-
10078
+ <!-- =========================================================================== -->
9853
10079
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10080
+ <!-- =========================================================================== -->
9854
10081
 
10082
+ <!-- =========================================================================== -->
9855
10083
  <!-- XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
10084
+ <!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
10085
+ <!-- keep-together_within-line for: a.b, aaa.b, a.bbb, .b in table's cell ONLY -->
10086
+ <!-- =========================================================================== -->
9856
10087
  <!-- Example: <keep-together_within-line>ISO 10303-51</keep-together_within-line> -->
9857
10088
  <xsl:template match="@*|node()" mode="update_xml_enclose_keep-together_within-line">
9858
10089
  <xsl:copy>
@@ -9868,10 +10099,15 @@
9868
10099
  <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">
9869
10100
 
9870
10101
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
9871
- <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
9872
10102
  <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
9873
10103
  <xsl:variable name="tag_keep-together_within-line_close">###/<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
9874
- <xsl:variable name="text_" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
10104
+ <xsl:variable name="text__" select="java:replaceAll(java:java.lang.String.new(.), $regex_standard_reference, concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
10105
+ <xsl:variable name="text_">
10106
+ <xsl:choose>
10107
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
10108
+ <xsl:otherwise><xsl:value-of select="$text__"/></xsl:otherwise>
10109
+ </xsl:choose>
10110
+ </xsl:variable>
9875
10111
  <xsl:variable name="text"><text><xsl:call-template name="replace_text_tags">
9876
10112
  <xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
9877
10113
  <xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
@@ -9887,7 +10123,11 @@
9887
10123
  </xsl:variable>
9888
10124
 
9889
10125
  <!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
9890
- <xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable>
10126
+ <!-- \S matches any non-whitespace character (equivalent to [^\r\n\t\f\v ]) -->
10127
+ <!-- <xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable> -->
10128
+ <!-- add &lt; and &gt; to \S -->
10129
+ <xsl:variable name="regex_S">[^\r\n\t\f\v \&lt;&gt;]</xsl:variable>
10130
+ <xsl:variable name="regex_solidus_units">((\b((<xsl:value-of select="$regex_S"/>{1,3}\/<xsl:value-of select="$regex_S"/>+)|(<xsl:value-of select="$regex_S"/>+\/<xsl:value-of select="$regex_S"/>{1,3}))\b)|(\/<xsl:value-of select="$regex_S"/>{1,3})\b)</xsl:variable>
9891
10131
  <xsl:variable name="text3">
9892
10132
  <text><xsl:for-each select="xalan:nodeset($text2)/text/node()">
9893
10133
  <xsl:choose>
@@ -9951,9 +10191,8 @@
9951
10191
  <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
9952
10192
  </xsl:choose>
9953
10193
  </xsl:template>
9954
-
9955
10194
  <!-- ===================================== -->
9956
- <!-- End Update xml -->
10195
+ <!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
9957
10196
  <!-- ===================================== -->
9958
10197
 
9959
10198
  <!-- for correct rendering combining chars -->
@@ -10341,13 +10580,14 @@
10341
10580
  </xsl:template>
10342
10581
 
10343
10582
  <xsl:template name="setId">
10583
+ <xsl:param name="prefix"/>
10344
10584
  <xsl:attribute name="id">
10345
10585
  <xsl:choose>
10346
10586
  <xsl:when test="@id">
10347
- <xsl:value-of select="@id"/>
10587
+ <xsl:value-of select="concat($prefix, @id)"/>
10348
10588
  </xsl:when>
10349
10589
  <xsl:otherwise>
10350
- <xsl:value-of select="generate-id()"/>
10590
+ <xsl:value-of select="concat($prefix, generate-id())"/>
10351
10591
  </xsl:otherwise>
10352
10592
  </xsl:choose>
10353
10593
  </xsl:attribute>