metanorma-un 0.9.12 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -730,6 +730,8 @@
730
730
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAJkAAAAmCAYAAADXwDkaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA+lpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJNaWNyb3NvZnTCriBXb3JkIDIwMTYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzM0NUVBQ0U2RUMzMTFFQUIzQjg4RDg3OEE1NEI2QzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzM0NUVBQ0Y2RUMzMTFFQUIzQjg4RDg3OEE1NEI2QzAiPiA8ZGM6Y3JlYXRvcj4gPHJkZjpTZXE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0dAyI9sst1m7uTuL28gqwJBqfh8pTaWOTqTIvSblYxVtTe2RnbvHlzg/fsEofcLK4oasda9edCs9An49viDe3tm3sS2YHA/gAL39Le/tU2lGFS0mphWYsBlhI432690j5UQnnB0DjXjuv/Pkr/knwu5fQOx46PR+RzPKz5FG+vOtVFmJn08mQq/ix17K4bM722kS3f8O0J0IOnwddK6jo7zqrx5f7EdckzAOrK/5erFeIorlh4YH/pthHXfac7449A8DVAaRXYTgUQ4wdj/xgw8ytFk7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO8nXeWcqW3QOHeLyryF/Q4L3BoEhzW+fOO0A12vewbTZxj6/yWeCqz4J31WY1ny3/F6UYkeY68LIzhtsxa8myZailU1K6HlxN/x9kjcPp+HcBBgAS2JZd+kqHSQAAAABJRU5ErkJggg==</xsl:text>
731
731
  </xsl:variable>
732
732
 
733
+ <xsl:strip-space elements="un:xref"/>
734
+
733
735
  <!-- external parameters -->
734
736
 
735
737
  <xsl:param name="svg_images"/> <!-- svg images array -->
@@ -1142,6 +1144,14 @@
1142
1144
 
1143
1145
  </xsl:attribute-set>
1144
1146
 
1147
+ <xsl:attribute-set name="pre-style">
1148
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1149
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1150
+
1151
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1152
+
1153
+ </xsl:attribute-set>
1154
+
1145
1155
  <xsl:attribute-set name="permission-style">
1146
1156
 
1147
1157
  </xsl:attribute-set>
@@ -2097,17 +2107,22 @@
2097
2107
  </xsl:for-each>
2098
2108
  </xsl:template>
2099
2109
 
2110
+ <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2100
2111
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
2101
2112
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
2102
2113
  <xsl:template match="text()" name="text">
2103
2114
 
2104
- <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2105
- <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))"/>
2106
- <xsl:call-template name="replace_fo_inline_tags">
2107
- <xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/>
2108
- <xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/>
2109
- <xsl:with-param name="text" select="$text"/>
2110
- </xsl:call-template>
2115
+ <xsl:choose>
2116
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:value-of select="."/></xsl:when>
2117
+ <xsl:otherwise>
2118
+ <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))"/>
2119
+ <xsl:call-template name="replace_fo_inline_tags">
2120
+ <xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/>
2121
+ <xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/>
2122
+ <xsl:with-param name="text" select="$text"/>
2123
+ </xsl:call-template>
2124
+ </xsl:otherwise>
2125
+ </xsl:choose>
2111
2126
 
2112
2127
  </xsl:template>
2113
2128
 
@@ -3135,7 +3150,7 @@
3135
3150
  <xsl:template match="*[local-name()='tr']">
3136
3151
  <fo:table-row xsl:use-attribute-sets="table-body-row-style">
3137
3152
 
3138
- <xsl:if test="*[local-name() = 'th']">
3153
+ <xsl:if test="count(*) = count(*[local-name() = 'th'])"> <!-- row contains 'th' only -->
3139
3154
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3140
3155
  </xsl:if>
3141
3156
 
@@ -3305,6 +3320,10 @@
3305
3320
  <xsl:variable name="footnote_inline">
3306
3321
  <fo:inline xsl:use-attribute-sets="fn-num-style">
3307
3322
 
3323
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
3324
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
3325
+ </xsl:if>
3326
+
3308
3327
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3309
3328
  <xsl:value-of select="$current_fn_number_text"/>
3310
3329
  </fo:basic-link>
@@ -4102,7 +4121,8 @@
4102
4121
  <xsl:copy-of select="node()"/>
4103
4122
  </td>
4104
4123
  <td>
4105
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4124
+ <!-- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/> -->
4125
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]" mode="dl_if"/>
4106
4126
  <!-- get paragraphs from nested 'dl' -->
4107
4127
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4108
4128
  </td>
@@ -4110,6 +4130,53 @@
4110
4130
  </xsl:template>
4111
4131
  <xsl:template match="*[local-name()='dd']" mode="dl_if"/>
4112
4132
 
4133
+ <xsl:template match="*" mode="dl_if">
4134
+ <xsl:copy-of select="."/>
4135
+ </xsl:template>
4136
+
4137
+ <xsl:template match="*[local-name() = 'p']" mode="dl_if">
4138
+ <xsl:param name="indent"/>
4139
+ <p>
4140
+ <xsl:copy-of select="@*"/>
4141
+ <xsl:value-of select="$indent"/>
4142
+ <xsl:copy-of select="node()"/>
4143
+ </p>
4144
+
4145
+ </xsl:template>
4146
+
4147
+ <xsl:template match="*[local-name() = 'ul' or local-name() = 'ol']" mode="dl_if">
4148
+ <xsl:variable name="list_rendered_">
4149
+ <xsl:apply-templates select="."/>
4150
+ </xsl:variable>
4151
+ <xsl:variable name="list_rendered" select="xalan:nodeset($list_rendered_)"/>
4152
+
4153
+ <xsl:variable name="indent">
4154
+ <xsl:for-each select="($list_rendered//fo:block[not(.//fo:block)])[1]">
4155
+ <xsl:apply-templates select="ancestor::*[@provisional-distance-between-starts]/@provisional-distance-between-starts" mode="dl_if"/>
4156
+ </xsl:for-each>
4157
+ </xsl:variable>
4158
+
4159
+ <xsl:apply-templates mode="dl_if">
4160
+ <xsl:with-param name="indent" select="$indent"/>
4161
+ </xsl:apply-templates>
4162
+ </xsl:template>
4163
+
4164
+ <xsl:template match="*[local-name() = 'li']" mode="dl_if">
4165
+ <xsl:param name="indent"/>
4166
+ <xsl:apply-templates mode="dl_if">
4167
+ <xsl:with-param name="indent" select="$indent"/>
4168
+ </xsl:apply-templates>
4169
+ </xsl:template>
4170
+
4171
+ <xsl:template match="@provisional-distance-between-starts" mode="dl_if">
4172
+ <xsl:variable name="value" select="round(substring-before(.,'mm'))"/>
4173
+ <!-- emulate left indent for list item -->
4174
+ <xsl:call-template name="repeat">
4175
+ <xsl:with-param name="char" select="'x'"/>
4176
+ <xsl:with-param name="count" select="$value"/>
4177
+ </xsl:call-template>
4178
+ </xsl:template>
4179
+
4113
4180
  <xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
4114
4181
  <xsl:for-each select="*[local-name() = 'dt']">
4115
4182
  <p>
@@ -4405,6 +4472,23 @@
4405
4472
  <xsl:apply-templates/>
4406
4473
  </xsl:template>
4407
4474
 
4475
+ <!-- Don't break standard's numbers -->
4476
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
4477
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
4478
+ <xsl:choose>
4479
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
4480
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
4481
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
4482
+ </xsl:when>
4483
+ <xsl:otherwise>
4484
+ <xsl:apply-templates/>
4485
+ </xsl:otherwise>
4486
+ </xsl:choose>
4487
+ </xsl:template>
4488
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'table']) and preceding-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear'] and following-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']]" priority="2">
4489
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
4490
+ </xsl:template>
4491
+
4408
4492
  <!-- ========================= -->
4409
4493
  <!-- END Rich text formatting -->
4410
4494
  <!-- ========================= -->
@@ -4503,6 +4587,7 @@
4503
4587
  </word>
4504
4588
  <xsl:call-template name="tokenize_with_tags">
4505
4589
  <xsl:with-param name="text" select="substring-after($text, $separator)"/>
4590
+ <xsl:with-param name="tags" select="$tags"/>
4506
4591
  </xsl:call-template>
4507
4592
  </xsl:otherwise>
4508
4593
  </xsl:choose>
@@ -4542,8 +4627,18 @@
4542
4627
 
4543
4628
  <xsl:template name="add-zero-spaces-java">
4544
4629
  <xsl:param name="text" select="."/>
4545
- <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4546
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
4630
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, arrow right -->
4631
+ <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |→)','$1​')"/>
4632
+ <!-- add zero-width space (#x200B) after characters: 'great than' -->
4633
+ <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' -->
4634
+ <!-- add zero-width space (#x200B) before characters: 'less than' -->
4635
+ <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' -->
4636
+ <!-- add zero-width space (#x200B) before character: { -->
4637
+ <xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
4638
+ <!-- add zero-width space (#x200B) after character: , -->
4639
+ <xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
4640
+
4641
+ <xsl:value-of select="$text5"/>
4547
4642
  </xsl:template>
4548
4643
 
4549
4644
  <xsl:template name="add-zero-spaces-link-java">
@@ -4689,7 +4784,7 @@
4689
4784
  </xsl:copy>
4690
4785
  </xsl:template>
4691
4786
 
4692
- <xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p'])]" mode="table-without-br">
4787
+ <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">
4693
4788
  <xsl:copy>
4694
4789
  <xsl:copy-of select="@*"/>
4695
4790
  <p>
@@ -4737,6 +4832,28 @@
4737
4832
  </xsl:for-each>
4738
4833
  </xsl:template>
4739
4834
 
4835
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'sourcecode']" mode="table-without-br">
4836
+ <xsl:apply-templates mode="table-without-br"/>
4837
+ </xsl:template>
4838
+
4839
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'sourcecode']/text()[contains(., '&#13;') or contains(., '&#10;')]" mode="table-without-br">
4840
+
4841
+ <xsl:variable name="sep">###SOURCECODE_NEWLINE###</xsl:variable>
4842
+ <xsl:variable name="sourcecode_text" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', $sep)"/>
4843
+ <xsl:variable name="items">
4844
+ <xsl:call-template name="split">
4845
+ <xsl:with-param name="pText" select="$sourcecode_text"/>
4846
+ <xsl:with-param name="sep" select="$sep"/>
4847
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
4848
+ </xsl:call-template>
4849
+ </xsl:variable>
4850
+ <xsl:for-each select="xalan:nodeset($items)/*">
4851
+ <p>
4852
+ <sourcecode><xsl:copy-of select="node()"/></sourcecode>
4853
+ </p>
4854
+ </xsl:for-each>
4855
+ </xsl:template>
4856
+
4740
4857
  <!-- remove redundant white spaces -->
4741
4858
  <xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br">
4742
4859
  <xsl:variable name="text" select="translate(.,'&#9;&#10;&#13;','')"/>
@@ -4767,7 +4884,7 @@
4767
4884
  <xsl:choose>
4768
4885
  <xsl:when test="@colspan">
4769
4886
  <xsl:variable name="td">
4770
- <xsl:element name="td">
4887
+ <xsl:element name="{local-name()}">
4771
4888
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
4772
4889
  <xsl:if test="local-name()='th'">
4773
4890
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -4782,7 +4899,7 @@
4782
4899
  </xsl:call-template>
4783
4900
  </xsl:when>
4784
4901
  <xsl:otherwise>
4785
- <xsl:element name="td">
4902
+ <xsl:element name="{local-name()}">
4786
4903
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
4787
4904
  <xsl:if test="local-name()='th'">
4788
4905
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -4849,7 +4966,7 @@
4849
4966
  <xsl:variable name="currentRow" select="."/>
4850
4967
 
4851
4968
  <xsl:variable name="normalizedTDs">
4852
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
4969
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
4853
4970
  <xsl:choose>
4854
4971
  <xsl:when test="@rowspan &gt; 1">
4855
4972
  <xsl:copy>
@@ -4861,7 +4978,7 @@
4861
4978
  </xsl:copy>
4862
4979
  </xsl:when>
4863
4980
  <xsl:otherwise>
4864
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
4981
+ <xsl:copy-of select="$currentRow/*[self::td or self::th][1 + count(current()/preceding-sibling::*[self::td or self::th][not(@rowspan) or (@rowspan = 1)])]"/>
4865
4982
  </xsl:otherwise>
4866
4983
  </xsl:choose>
4867
4984
  </xsl:for-each>
@@ -5047,6 +5164,7 @@
5047
5164
  <xsl:if test="ancestor::*[local-name() = 'sub']"><tag>sub</tag></xsl:if>
5048
5165
  <xsl:if test="ancestor::*[local-name() = 'sup']"><tag>sup</tag></xsl:if>
5049
5166
  <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
5167
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
5050
5168
  <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
5051
5169
  </tags>
5052
5170
  </xsl:template>
@@ -6049,6 +6167,31 @@
6049
6167
  <xsl:apply-templates mode="svg_update"/>
6050
6168
  </xsl:copy>
6051
6169
  </xsl:template>
6170
+
6171
+ <!-- regex for 'display: inline-block;' -->
6172
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
6173
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
6174
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
6175
+ </xsl:template>
6176
+
6177
+ <!-- replace
6178
+ stroke="rgba(r, g, b, alpha)" to
6179
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
6180
+ fill="rgba(r, g, b, alpha)" to
6181
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
6182
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
6183
+ <xsl:variable name="components_">
6184
+ <xsl:call-template name="split">
6185
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
6186
+ <xsl:with-param name="sep" select="','"/>
6187
+ </xsl:call-template>
6188
+ </xsl:variable>
6189
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
6190
+ <xsl:variable name="att_name" select="local-name()"/>
6191
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
6192
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
6193
+ </xsl:template>
6194
+
6052
6195
  <!-- ============== -->
6053
6196
  <!-- END: svg_update -->
6054
6197
  <!-- ============== -->
@@ -6682,44 +6825,22 @@
6682
6825
  <xsl:apply-templates mode="contents_item"/>
6683
6826
  </xsl:template>
6684
6827
 
6685
- <!-- ====== -->
6686
- <!-- sourcecode -->
6687
- <!-- ====== -->
6828
+ <!-- =============== -->
6829
+ <!-- sourcecode -->
6830
+ <!-- =============== -->
6688
6831
  <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6689
6832
 
6690
- <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
6691
-
6692
- <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
6693
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
6694
- </xsl:if>
6695
-
6696
- <xsl:if test="ancestor::*[local-name() = 'example']">
6697
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
6698
- </xsl:if>
6699
-
6700
- <xsl:copy-of select="@id"/>
6701
-
6702
- <xsl:if test="parent::*[local-name() = 'note']">
6703
- <xsl:attribute name="margin-left">
6704
- <xsl:choose>
6705
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
6706
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
6707
- </xsl:choose>
6708
- </xsl:attribute>
6833
+ <xsl:variable name="sourcecode_attributes">
6834
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
6835
+ <xsl:variable name="_font-size">
6709
6836
 
6710
- </xsl:if>
6711
- <fo:block-container margin-left="0mm">
6837
+ <!-- 9 -->
6712
6838
 
6713
- <fo:block xsl:use-attribute-sets="sourcecode-style">
6714
- <xsl:variable name="_font-size">
6715
-
6716
- <!-- 9 -->
6717
-
6718
- <!-- <xsl:if test="$namespace = 'ieee'">
6719
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
6720
- </xsl:if> -->
6839
+ <!-- <xsl:if test="$namespace = 'ieee'">
6840
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
6841
+ </xsl:if> -->
6721
6842
 
6722
- 10
6843
+ 10
6723
6844
  </xsl:variable>
6724
6845
 
6725
6846
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -6733,14 +6854,60 @@
6733
6854
  </xsl:choose>
6734
6855
  </xsl:attribute>
6735
6856
  </xsl:if>
6857
+ </xsl:element>
6858
+ </xsl:variable>
6736
6859
 
6860
+ <xsl:choose>
6861
+ <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
6862
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
6863
+ <xsl:attribute name="{local-name()}">
6864
+ <xsl:value-of select="."/>
6865
+ </xsl:attribute>
6866
+ </xsl:for-each>
6737
6867
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6738
- </fo:block>
6868
+ </xsl:when>
6739
6869
 
6740
- <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
6870
+ <xsl:otherwise>
6871
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
6741
6872
 
6742
- </fo:block-container>
6743
- </fo:block-container>
6873
+ <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
6874
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
6875
+ </xsl:if>
6876
+
6877
+ <xsl:if test="ancestor::*[local-name() = 'example']">
6878
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
6879
+ </xsl:if>
6880
+
6881
+ <xsl:copy-of select="@id"/>
6882
+
6883
+ <xsl:if test="parent::*[local-name() = 'note']">
6884
+ <xsl:attribute name="margin-left">
6885
+ <xsl:choose>
6886
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
6887
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
6888
+ </xsl:choose>
6889
+ </xsl:attribute>
6890
+
6891
+ </xsl:if>
6892
+ <fo:block-container margin-left="0mm">
6893
+
6894
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
6895
+
6896
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
6897
+ <xsl:attribute name="{local-name()}">
6898
+ <xsl:value-of select="."/>
6899
+ </xsl:attribute>
6900
+ </xsl:for-each>
6901
+
6902
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6903
+ </fo:block>
6904
+
6905
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
6906
+
6907
+ </fo:block-container>
6908
+ </fo:block-container>
6909
+ </xsl:otherwise>
6910
+ </xsl:choose>
6744
6911
  </xsl:template>
6745
6912
 
6746
6913
  <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -6982,8 +7149,22 @@
6982
7149
  </fo:block>
6983
7150
  </xsl:if>
6984
7151
  </xsl:template>
6985
- <!-- ====== -->
6986
- <!-- ====== -->
7152
+ <!-- =============== -->
7153
+ <!-- END sourcecode -->
7154
+ <!-- =============== -->
7155
+
7156
+ <!-- =============== -->
7157
+ <!-- pre -->
7158
+ <!-- =============== -->
7159
+ <xsl:template match="*[local-name()='pre']" name="pre">
7160
+ <fo:block xsl:use-attribute-sets="pre-style">
7161
+ <xsl:copy-of select="@id"/>
7162
+ <xsl:apply-templates/>
7163
+ </fo:block>
7164
+ </xsl:template>
7165
+ <!-- =============== -->
7166
+ <!-- pre -->
7167
+ <!-- =============== -->
6987
7168
 
6988
7169
  <!-- ========== -->
6989
7170
  <!-- permission -->
@@ -8919,7 +9100,11 @@
8919
9100
  <!-- ===================================== -->
8920
9101
  <!-- Update xml -->
8921
9102
  <!-- ===================================== -->
8922
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9103
+ <!-- =========================================================================== -->
9104
+ <!-- STEP1: -->
9105
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
9106
+ <!-- - Ignore 'span' without style -->
9107
+ <!-- =========================================================================== -->
8923
9108
  <xsl:template match="@*|node()" mode="update_xml_step1">
8924
9109
  <xsl:copy>
8925
9110
  <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
@@ -9001,7 +9186,8 @@
9001
9186
  </xsl:copy>
9002
9187
  </xsl:template>
9003
9188
 
9004
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
9189
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
9190
+ <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
9005
9191
  <xsl:copy>
9006
9192
  <xsl:copy-of select="@*"/>
9007
9193
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -9011,10 +9197,15 @@
9011
9197
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
9012
9198
  <xsl:apply-templates mode="update_xml_step1"/>
9013
9199
  </xsl:template>
9014
-
9200
+ <!-- =========================================================================== -->
9015
9201
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9202
+ <!-- =========================================================================== -->
9016
9203
 
9204
+ <!-- =========================================================================== -->
9017
9205
  <!-- XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
9206
+ <!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
9207
+ <!-- keep-together_within-line for: a.b, aaa.b, a.bbb, .b in table's cell ONLY -->
9208
+ <!-- =========================================================================== -->
9018
9209
  <!-- Example: <keep-together_within-line>ISO 10303-51</keep-together_within-line> -->
9019
9210
  <xsl:template match="@*|node()" mode="update_xml_enclose_keep-together_within-line">
9020
9211
  <xsl:copy>
@@ -9030,10 +9221,15 @@
9030
9221
  <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">
9031
9222
 
9032
9223
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
9033
- <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
9034
9224
  <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
9035
9225
  <xsl:variable name="tag_keep-together_within-line_close">###/<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
9036
- <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))"/>
9226
+ <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))"/>
9227
+ <xsl:variable name="text_">
9228
+ <xsl:choose>
9229
+ <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 -->
9230
+ <xsl:otherwise><xsl:value-of select="$text__"/></xsl:otherwise>
9231
+ </xsl:choose>
9232
+ </xsl:variable>
9037
9233
  <xsl:variable name="text"><text><xsl:call-template name="replace_text_tags">
9038
9234
  <xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
9039
9235
  <xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
@@ -9049,7 +9245,11 @@
9049
9245
  </xsl:variable>
9050
9246
 
9051
9247
  <!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
9052
- <xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable>
9248
+ <!-- \S matches any non-whitespace character (equivalent to [^\r\n\t\f\v ]) -->
9249
+ <!-- <xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable> -->
9250
+ <!-- add &lt; and &gt; to \S -->
9251
+ <xsl:variable name="regex_S">[^\r\n\t\f\v \&lt;&gt;]</xsl:variable>
9252
+ <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>
9053
9253
  <xsl:variable name="text3">
9054
9254
  <text><xsl:for-each select="xalan:nodeset($text2)/text/node()">
9055
9255
  <xsl:choose>
@@ -9113,9 +9313,8 @@
9113
9313
  <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
9114
9314
  </xsl:choose>
9115
9315
  </xsl:template>
9116
-
9117
9316
  <!-- ===================================== -->
9118
- <!-- End Update xml -->
9317
+ <!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
9119
9318
  <!-- ===================================== -->
9120
9319
 
9121
9320
  <!-- for correct rendering combining chars -->