metanorma-un 0.9.11 → 0.9.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -212,7 +212,7 @@
212
212
  <xsl:variable name="charsToRemove" select="concat($upper, $lower, '.()~!@#$%^*-+:')"/>
213
213
  <xsl:variable name="code" select="translate(/un:un-standard/un:bibdata/un:docidentifier, $charsToRemove,'')"/>
214
214
 
215
- <fo:block-container absolute-position="fixed" left="20mm" top="258mm" width="30mm" text-align="center">
215
+ <fo:block-container absolute-position="fixed" left="20mm" top="258mm" width="30mm" text-align="center" id="__internal_layout__barcode_{generate-id()}">
216
216
  <fo:block font-size="10pt" text-align="left">
217
217
  <xsl:value-of select="/un:un-standard/un:bibdata/un:docidentifier"/>
218
218
  </fo:block>
@@ -284,7 +284,7 @@
284
284
  </xsl:if>
285
285
 
286
286
  <!-- Preface Pages (except Abstract, that showed in Summary on cover page`) -->
287
- <xsl:if test="/un:un-standard/un:preface/*[not(local-name() = 'abstract' or local-name() != 'note' or local-name() != 'admonition')]">
287
+ <xsl:if test="/un:un-standard/un:preface/*[not(local-name() = 'abstract' or local-name() = 'note' or local-name() = 'admonition')]">
288
288
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
289
289
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
290
290
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements' and local-name() != 'note' and local-name() != 'admonition']"/>
@@ -375,17 +375,11 @@
375
375
  <fo:table-column column-width="17mm"/>
376
376
  <fo:table-body>
377
377
  <fo:table-row>
378
- <fo:table-cell padding-left="6mm" padding-top="2.5mm">
378
+ <fo:table-cell padding-left="6mm" padding-top="2.5mm" number-columns-spanned="3">
379
379
  <fo:block font-size="12pt" font-style="italic" margin-bottom="6pt" role="H2">
380
380
  <xsl:apply-templates select="un:title/node()"/>
381
381
  </fo:block>
382
382
  </fo:table-cell>
383
- <fo:table-cell>
384
- <fo:block> </fo:block>
385
- </fo:table-cell>
386
- <fo:table-cell>
387
- <fo:block> </fo:block>
388
- </fo:table-cell>
389
383
  </fo:table-row>
390
384
  <fo:table-row>
391
385
  <fo:table-cell>
@@ -736,6 +730,8 @@
736
730
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAJkAAAAmCAYAAADXwDkaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA+lpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJNaWNyb3NvZnTCriBXb3JkIDIwMTYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzM0NUVBQ0U2RUMzMTFFQUIzQjg4RDg3OEE1NEI2QzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzM0NUVBQ0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AQpAwNJsRuT5xUAHrKK4IkCd9g6NQAQPIi8vz4f5o72tANZVgO/GMpe59RvrtQvt7JMQLS0dAyI9sst1m7uTuL28gqwJBqfh8pTaWOTqTIvSblYxVtTe2RnbvHlzg/fsEofcLK4oasda9edCs9An49viDe3tm3sS2YHA/gAL39Le/tU2lGFS0mphWYsBlhI432690j5UQnnB0DjXjuv/Pkr/knwu5fQOx46PR+RzPKz5FG+vOtVFmJn08mQq/ix17K4bM722kS3f8O0J0IOnwddK6jo7zqrx5f7EdckzAOrK/5erFeIorlh4YH/pthHXfac7449A8DVAaRXYTgUQ4wdj/xgw8ytFk7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO8nXeWcqW3QOHeLyryF/Q4L3BoEhzW+fOO0A12vewbTZxj6/yWeCqz4J31WY1ny3/F6UYkeY68LIzhtsxa8myZailU1K6HlxN/x9kjcPp+HcBBgAS2JZd+kqHSQAAAABJRU5ErkJggg==</xsl:text>
737
731
  </xsl:variable>
738
732
 
733
+ <xsl:strip-space elements="un:xref"/>
734
+
739
735
  <!-- external parameters -->
740
736
 
741
737
  <xsl:param name="svg_images"/> <!-- svg images array -->
@@ -1148,6 +1144,14 @@
1148
1144
 
1149
1145
  </xsl:attribute-set>
1150
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
+
1151
1155
  <xsl:attribute-set name="permission-style">
1152
1156
 
1153
1157
  </xsl:attribute-set>
@@ -1251,6 +1255,11 @@
1251
1255
  </xsl:variable>
1252
1256
  <xsl:variable name="table-border" select="normalize-space($table-border_)"/>
1253
1257
 
1258
+ <xsl:variable name="table-cell-border_">
1259
+
1260
+ </xsl:variable>
1261
+ <xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/>
1262
+
1254
1263
  <xsl:attribute-set name="table-container-style">
1255
1264
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
1256
1265
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -1263,8 +1272,6 @@
1263
1272
  <xsl:attribute-set name="table-style">
1264
1273
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
1265
1274
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
1266
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1267
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1268
1275
 
1269
1276
  <xsl:attribute name="border-top">0.5pt solid black</xsl:attribute>
1270
1277
 
@@ -2100,17 +2107,22 @@
2100
2107
  </xsl:for-each>
2101
2108
  </xsl:template>
2102
2109
 
2110
+ <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2103
2111
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
2104
2112
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
2105
2113
  <xsl:template match="text()" name="text">
2106
2114
 
2107
- <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2108
- <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))"/>
2109
- <xsl:call-template name="replace_fo_inline_tags">
2110
- <xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/>
2111
- <xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/>
2112
- <xsl:with-param name="text" select="$text"/>
2113
- </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>
2114
2126
 
2115
2127
  </xsl:template>
2116
2128
 
@@ -2374,10 +2386,18 @@
2374
2386
  <xsl:variable name="table_attributes">
2375
2387
 
2376
2388
  <xsl:element name="table_attributes" use-attribute-sets="table-style">
2389
+
2390
+ <xsl:if test="$margin-side != 0">
2391
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2392
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2393
+ </xsl:if>
2394
+
2377
2395
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
2378
2396
 
2379
- <xsl:attribute name="margin-left"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2380
- <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2397
+ <xsl:if test="$margin-side != 0">
2398
+ <xsl:attribute name="margin-left"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2399
+ <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2400
+ </xsl:if>
2381
2401
 
2382
2402
  </xsl:element>
2383
2403
  </xsl:variable>
@@ -3130,6 +3150,10 @@
3130
3150
  <xsl:template match="*[local-name()='tr']">
3131
3151
  <fo:table-row xsl:use-attribute-sets="table-body-row-style">
3132
3152
 
3153
+ <xsl:if test="count(*) = count(*[local-name() = 'th'])"> <!-- row contains 'th' only -->
3154
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
3155
+ </xsl:if>
3156
+
3133
3157
  <xsl:call-template name="setTableRowAttributes"/>
3134
3158
  <xsl:apply-templates/>
3135
3159
  </fo:table-row>
@@ -4093,7 +4117,8 @@
4093
4117
  <xsl:copy-of select="node()"/>
4094
4118
  </td>
4095
4119
  <td>
4096
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4120
+ <!-- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/> -->
4121
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]" mode="dl_if"/>
4097
4122
  <!-- get paragraphs from nested 'dl' -->
4098
4123
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4099
4124
  </td>
@@ -4101,6 +4126,53 @@
4101
4126
  </xsl:template>
4102
4127
  <xsl:template match="*[local-name()='dd']" mode="dl_if"/>
4103
4128
 
4129
+ <xsl:template match="*" mode="dl_if">
4130
+ <xsl:copy-of select="."/>
4131
+ </xsl:template>
4132
+
4133
+ <xsl:template match="*[local-name() = 'p']" mode="dl_if">
4134
+ <xsl:param name="indent"/>
4135
+ <p>
4136
+ <xsl:copy-of select="@*"/>
4137
+ <xsl:value-of select="$indent"/>
4138
+ <xsl:copy-of select="node()"/>
4139
+ </p>
4140
+
4141
+ </xsl:template>
4142
+
4143
+ <xsl:template match="*[local-name() = 'ul' or local-name() = 'ol']" mode="dl_if">
4144
+ <xsl:variable name="list_rendered_">
4145
+ <xsl:apply-templates select="."/>
4146
+ </xsl:variable>
4147
+ <xsl:variable name="list_rendered" select="xalan:nodeset($list_rendered_)"/>
4148
+
4149
+ <xsl:variable name="indent">
4150
+ <xsl:for-each select="($list_rendered//fo:block[not(.//fo:block)])[1]">
4151
+ <xsl:apply-templates select="ancestor::*[@provisional-distance-between-starts]/@provisional-distance-between-starts" mode="dl_if"/>
4152
+ </xsl:for-each>
4153
+ </xsl:variable>
4154
+
4155
+ <xsl:apply-templates mode="dl_if">
4156
+ <xsl:with-param name="indent" select="$indent"/>
4157
+ </xsl:apply-templates>
4158
+ </xsl:template>
4159
+
4160
+ <xsl:template match="*[local-name() = 'li']" mode="dl_if">
4161
+ <xsl:param name="indent"/>
4162
+ <xsl:apply-templates mode="dl_if">
4163
+ <xsl:with-param name="indent" select="$indent"/>
4164
+ </xsl:apply-templates>
4165
+ </xsl:template>
4166
+
4167
+ <xsl:template match="@provisional-distance-between-starts" mode="dl_if">
4168
+ <xsl:variable name="value" select="round(substring-before(.,'mm'))"/>
4169
+ <!-- emulate left indent for list item -->
4170
+ <xsl:call-template name="repeat">
4171
+ <xsl:with-param name="char" select="'x'"/>
4172
+ <xsl:with-param name="count" select="$value"/>
4173
+ </xsl:call-template>
4174
+ </xsl:template>
4175
+
4104
4176
  <xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
4105
4177
  <xsl:for-each select="*[local-name() = 'dt']">
4106
4178
  <p>
@@ -4494,6 +4566,7 @@
4494
4566
  </word>
4495
4567
  <xsl:call-template name="tokenize_with_tags">
4496
4568
  <xsl:with-param name="text" select="substring-after($text, $separator)"/>
4569
+ <xsl:with-param name="tags" select="$tags"/>
4497
4570
  </xsl:call-template>
4498
4571
  </xsl:otherwise>
4499
4572
  </xsl:choose>
@@ -4533,8 +4606,18 @@
4533
4606
 
4534
4607
  <xsl:template name="add-zero-spaces-java">
4535
4608
  <xsl:param name="text" select="."/>
4536
- <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4537
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
4609
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, arrow right -->
4610
+ <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |→)','$1​')"/>
4611
+ <!-- add zero-width space (#x200B) after characters: 'great than' -->
4612
+ <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' -->
4613
+ <!-- add zero-width space (#x200B) before characters: 'less than' -->
4614
+ <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' -->
4615
+ <!-- add zero-width space (#x200B) before character: { -->
4616
+ <xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
4617
+ <!-- add zero-width space (#x200B) after character: , -->
4618
+ <xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
4619
+
4620
+ <xsl:value-of select="$text5"/>
4538
4621
  </xsl:template>
4539
4622
 
4540
4623
  <xsl:template name="add-zero-spaces-link-java">
@@ -4680,7 +4763,7 @@
4680
4763
  </xsl:copy>
4681
4764
  </xsl:template>
4682
4765
 
4683
- <xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p'])]" mode="table-without-br">
4766
+ <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">
4684
4767
  <xsl:copy>
4685
4768
  <xsl:copy-of select="@*"/>
4686
4769
  <p>
@@ -4728,6 +4811,28 @@
4728
4811
  </xsl:for-each>
4729
4812
  </xsl:template>
4730
4813
 
4814
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'sourcecode']" mode="table-without-br">
4815
+ <xsl:apply-templates mode="table-without-br"/>
4816
+ </xsl:template>
4817
+
4818
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'sourcecode']/text()[contains(., '&#13;') or contains(., '&#10;')]" mode="table-without-br">
4819
+
4820
+ <xsl:variable name="sep">###SOURCECODE_NEWLINE###</xsl:variable>
4821
+ <xsl:variable name="sourcecode_text" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', $sep)"/>
4822
+ <xsl:variable name="items">
4823
+ <xsl:call-template name="split">
4824
+ <xsl:with-param name="pText" select="$sourcecode_text"/>
4825
+ <xsl:with-param name="sep" select="$sep"/>
4826
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
4827
+ </xsl:call-template>
4828
+ </xsl:variable>
4829
+ <xsl:for-each select="xalan:nodeset($items)/*">
4830
+ <p>
4831
+ <sourcecode><xsl:copy-of select="node()"/></sourcecode>
4832
+ </p>
4833
+ </xsl:for-each>
4834
+ </xsl:template>
4835
+
4731
4836
  <!-- remove redundant white spaces -->
4732
4837
  <xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br">
4733
4838
  <xsl:variable name="text" select="translate(.,'&#9;&#10;&#13;','')"/>
@@ -5038,6 +5143,7 @@
5038
5143
  <xsl:if test="ancestor::*[local-name() = 'sub']"><tag>sub</tag></xsl:if>
5039
5144
  <xsl:if test="ancestor::*[local-name() = 'sup']"><tag>sup</tag></xsl:if>
5040
5145
  <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
5146
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
5041
5147
  <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
5042
5148
  </tags>
5043
5149
  </xsl:template>
@@ -5100,6 +5206,9 @@
5100
5206
  <xsl:value-of select="substring($str, 2)"/>
5101
5207
  </xsl:template>
5102
5208
 
5209
+ <!-- ======================================= -->
5210
+ <!-- math -->
5211
+ <!-- ======================================= -->
5103
5212
  <xsl:template match="mathml:math">
5104
5213
  <xsl:variable name="isAdded" select="@added"/>
5105
5214
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -5150,14 +5259,57 @@
5150
5259
  <xsl:value-of select="$comment_text"/>
5151
5260
  </xsl:template>
5152
5261
 
5262
+ <xsl:template match="*[local-name() = 'asciimath']">
5263
+ <xsl:param name="process" select="'false'"/>
5264
+ <xsl:if test="$process = 'true'">
5265
+ <xsl:apply-templates/>
5266
+ </xsl:if>
5267
+ </xsl:template>
5268
+
5269
+ <xsl:template match="*[local-name() = 'latexmath']"/>
5270
+
5271
+ <xsl:template name="getMathml_asciimath_text">
5272
+ <xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/>
5273
+ <xsl:variable name="latexmath">
5274
+
5275
+ </xsl:variable>
5276
+ <xsl:variable name="asciimath_text_following">
5277
+ <xsl:choose>
5278
+ <xsl:when test="normalize-space($latexmath) != ''">
5279
+ <xsl:value-of select="$latexmath"/>
5280
+ </xsl:when>
5281
+ <xsl:when test="normalize-space($asciimath) != ''">
5282
+ <xsl:value-of select="$asciimath"/>
5283
+ </xsl:when>
5284
+ <xsl:otherwise>
5285
+ <xsl:value-of select="following-sibling::node()[1][self::comment()]"/>
5286
+ </xsl:otherwise>
5287
+ </xsl:choose>
5288
+ </xsl:variable>
5289
+ <xsl:variable name="asciimath_text_">
5290
+ <xsl:choose>
5291
+ <xsl:when test="normalize-space($asciimath_text_following) != ''">
5292
+ <xsl:value-of select="$asciimath_text_following"/>
5293
+ </xsl:when>
5294
+ <xsl:otherwise>
5295
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
5296
+ </xsl:otherwise>
5297
+ </xsl:choose>
5298
+ </xsl:variable>
5299
+ <xsl:variable name="asciimath_text_2" select="java:org.metanorma.fop.Util.unescape($asciimath_text_)"/>
5300
+ <xsl:variable name="asciimath_text" select="java:trim(java:java.lang.String.new($asciimath_text_2))"/>
5301
+ <xsl:value-of select="$asciimath_text"/>
5302
+ </xsl:template>
5303
+
5153
5304
  <xsl:template name="mathml_instream_object">
5154
- <xsl:param name="comment_text"/>
5305
+ <xsl:param name="asciimath_text"/>
5155
5306
  <xsl:param name="mathml_content"/>
5156
5307
 
5157
- <xsl:variable name="comment_text_">
5308
+ <xsl:variable name="asciimath_text_">
5158
5309
  <xsl:choose>
5159
- <xsl:when test="normalize-space($comment_text) != ''"><xsl:value-of select="$comment_text"/></xsl:when>
5160
- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
5310
+ <xsl:when test="normalize-space($asciimath_text) != ''"><xsl:value-of select="$asciimath_text"/></xsl:when>
5311
+ <!-- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> -->
5312
+ <xsl:otherwise><xsl:call-template name="getMathml_asciimath_text"/></xsl:otherwise>
5161
5313
  </xsl:choose>
5162
5314
  </xsl:variable>
5163
5315
 
@@ -5174,10 +5326,10 @@
5174
5326
  </xsl:attribute>
5175
5327
 
5176
5328
  <!-- <xsl:if test="$add_math_as_text = 'true'"> -->
5177
- <xsl:if test="normalize-space($comment_text_) != ''">
5329
+ <xsl:if test="normalize-space($asciimath_text_) != ''">
5178
5330
  <!-- put Mathin Alternate Text -->
5179
5331
  <xsl:attribute name="fox:alt-text">
5180
- <xsl:value-of select="$comment_text_"/>
5332
+ <xsl:value-of select="$asciimath_text_"/>
5181
5333
  </xsl:attribute>
5182
5334
  </xsl:if>
5183
5335
  <!-- </xsl:if> -->
@@ -5250,6 +5402,29 @@
5250
5402
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
5251
5403
  </xsl:template>
5252
5404
 
5405
+ <!-- Examples:
5406
+ <stem type="AsciiMath">x = 1</stem>
5407
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
5408
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
5409
+ -->
5410
+ <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
5411
+ <fo:inline xsl:use-attribute-sets="mathml-style">
5412
+
5413
+ <xsl:choose>
5414
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5415
+ <xsl:otherwise>
5416
+ <xsl:apply-templates>
5417
+ <xsl:with-param name="process">true</xsl:with-param>
5418
+ </xsl:apply-templates>
5419
+ </xsl:otherwise>
5420
+ </xsl:choose>
5421
+
5422
+ </fo:inline>
5423
+ </xsl:template>
5424
+ <!-- ======================================= -->
5425
+ <!-- END: math -->
5426
+ <!-- ======================================= -->
5427
+
5253
5428
  <xsl:template match="*[local-name()='localityStack']"/>
5254
5429
 
5255
5430
  <xsl:template match="*[local-name()='link']" name="link">
@@ -5457,6 +5632,12 @@
5457
5632
 
5458
5633
  <fo:block-container margin-left="0mm">
5459
5634
 
5635
+ <!-- <xsl:if test="$namespace = 'iho'">
5636
+ <xsl:if test="ancestor::iho:td">
5637
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
5638
+ </xsl:if>
5639
+ </xsl:if> -->
5640
+
5460
5641
  <fo:block>
5461
5642
 
5462
5643
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -6604,44 +6785,22 @@
6604
6785
  <xsl:apply-templates mode="contents_item"/>
6605
6786
  </xsl:template>
6606
6787
 
6607
- <!-- ====== -->
6608
- <!-- sourcecode -->
6609
- <!-- ====== -->
6788
+ <!-- =============== -->
6789
+ <!-- sourcecode -->
6790
+ <!-- =============== -->
6610
6791
  <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6611
6792
 
6612
- <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
6793
+ <xsl:variable name="sourcecode_attributes">
6794
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
6795
+ <xsl:variable name="_font-size">
6613
6796
 
6614
- <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
6615
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
6616
- </xsl:if>
6797
+ <!-- 9 -->
6617
6798
 
6618
- <xsl:if test="ancestor::*[local-name() = 'example']">
6619
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
6620
- </xsl:if>
6621
-
6622
- <xsl:copy-of select="@id"/>
6623
-
6624
- <xsl:if test="parent::*[local-name() = 'note']">
6625
- <xsl:attribute name="margin-left">
6626
- <xsl:choose>
6627
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
6628
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
6629
- </xsl:choose>
6630
- </xsl:attribute>
6631
-
6632
- </xsl:if>
6633
- <fo:block-container margin-left="0mm">
6634
-
6635
- <fo:block xsl:use-attribute-sets="sourcecode-style">
6636
- <xsl:variable name="_font-size">
6637
-
6638
- <!-- 9 -->
6639
-
6640
- <!-- <xsl:if test="$namespace = 'ieee'">
6641
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
6642
- </xsl:if> -->
6799
+ <!-- <xsl:if test="$namespace = 'ieee'">
6800
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
6801
+ </xsl:if> -->
6643
6802
 
6644
- 10
6803
+ 10
6645
6804
  </xsl:variable>
6646
6805
 
6647
6806
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -6655,14 +6814,60 @@
6655
6814
  </xsl:choose>
6656
6815
  </xsl:attribute>
6657
6816
  </xsl:if>
6817
+ </xsl:element>
6818
+ </xsl:variable>
6658
6819
 
6820
+ <xsl:choose>
6821
+ <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
6822
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
6823
+ <xsl:attribute name="{local-name()}">
6824
+ <xsl:value-of select="."/>
6825
+ </xsl:attribute>
6826
+ </xsl:for-each>
6659
6827
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6660
- </fo:block>
6828
+ </xsl:when>
6661
6829
 
6662
- <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
6830
+ <xsl:otherwise>
6831
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
6663
6832
 
6664
- </fo:block-container>
6665
- </fo:block-container>
6833
+ <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
6834
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
6835
+ </xsl:if>
6836
+
6837
+ <xsl:if test="ancestor::*[local-name() = 'example']">
6838
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
6839
+ </xsl:if>
6840
+
6841
+ <xsl:copy-of select="@id"/>
6842
+
6843
+ <xsl:if test="parent::*[local-name() = 'note']">
6844
+ <xsl:attribute name="margin-left">
6845
+ <xsl:choose>
6846
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
6847
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
6848
+ </xsl:choose>
6849
+ </xsl:attribute>
6850
+
6851
+ </xsl:if>
6852
+ <fo:block-container margin-left="0mm">
6853
+
6854
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
6855
+
6856
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
6857
+ <xsl:attribute name="{local-name()}">
6858
+ <xsl:value-of select="."/>
6859
+ </xsl:attribute>
6860
+ </xsl:for-each>
6861
+
6862
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6863
+ </fo:block>
6864
+
6865
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
6866
+
6867
+ </fo:block-container>
6868
+ </fo:block-container>
6869
+ </xsl:otherwise>
6870
+ </xsl:choose>
6666
6871
  </xsl:template>
6667
6872
 
6668
6873
  <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -6904,8 +7109,22 @@
6904
7109
  </fo:block>
6905
7110
  </xsl:if>
6906
7111
  </xsl:template>
6907
- <!-- ====== -->
6908
- <!-- ====== -->
7112
+ <!-- =============== -->
7113
+ <!-- END sourcecode -->
7114
+ <!-- =============== -->
7115
+
7116
+ <!-- =============== -->
7117
+ <!-- pre -->
7118
+ <!-- =============== -->
7119
+ <xsl:template match="*[local-name()='pre']" name="pre">
7120
+ <fo:block xsl:use-attribute-sets="pre-style">
7121
+ <xsl:copy-of select="@id"/>
7122
+ <xsl:apply-templates/>
7123
+ </fo:block>
7124
+ </xsl:template>
7125
+ <!-- =============== -->
7126
+ <!-- pre -->
7127
+ <!-- =============== -->
6909
7128
 
6910
7129
  <!-- ========== -->
6911
7130
  <!-- permission -->
@@ -7948,6 +8167,10 @@
7948
8167
 
7949
8168
  <fo:list-block xsl:use-attribute-sets="list-style">
7950
8169
 
8170
+ <xsl:if test="local-name() = 'ol'">
8171
+ <xsl:attribute name="provisional-distance-between-starts">6mm</xsl:attribute>
8172
+ </xsl:if>
8173
+
7951
8174
  <xsl:if test="*[local-name() = 'name']">
7952
8175
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
7953
8176
  </xsl:if>
@@ -8837,7 +9060,9 @@
8837
9060
  <!-- ===================================== -->
8838
9061
  <!-- Update xml -->
8839
9062
  <!-- ===================================== -->
9063
+ <!-- =========================================================================== -->
8840
9064
  <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9065
+ <!-- =========================================================================== -->
8841
9066
  <xsl:template match="@*|node()" mode="update_xml_step1">
8842
9067
  <xsl:copy>
8843
9068
  <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
@@ -8929,10 +9154,15 @@
8929
9154
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
8930
9155
  <xsl:apply-templates mode="update_xml_step1"/>
8931
9156
  </xsl:template>
8932
-
9157
+ <!-- =========================================================================== -->
8933
9158
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9159
+ <!-- =========================================================================== -->
8934
9160
 
9161
+ <!-- =========================================================================== -->
8935
9162
  <!-- XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
9163
+ <!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
9164
+ <!-- keep-together_within-line for: a.b, aaa.b, a.bbb, .b in table's cell ONLY -->
9165
+ <!-- =========================================================================== -->
8936
9166
  <!-- Example: <keep-together_within-line>ISO 10303-51</keep-together_within-line> -->
8937
9167
  <xsl:template match="@*|node()" mode="update_xml_enclose_keep-together_within-line">
8938
9168
  <xsl:copy>
@@ -8948,10 +9178,15 @@
8948
9178
  <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">
8949
9179
 
8950
9180
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
8951
- <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
8952
9181
  <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
8953
9182
  <xsl:variable name="tag_keep-together_within-line_close">###/<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
8954
- <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))"/>
9183
+ <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))"/>
9184
+ <xsl:variable name="text_">
9185
+ <xsl:choose>
9186
+ <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 -->
9187
+ <xsl:otherwise><xsl:value-of select="$text__"/></xsl:otherwise>
9188
+ </xsl:choose>
9189
+ </xsl:variable>
8955
9190
  <xsl:variable name="text"><text><xsl:call-template name="replace_text_tags">
8956
9191
  <xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
8957
9192
  <xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
@@ -8967,7 +9202,11 @@
8967
9202
  </xsl:variable>
8968
9203
 
8969
9204
  <!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
8970
- <xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable>
9205
+ <!-- \S matches any non-whitespace character (equivalent to [^\r\n\t\f\v ]) -->
9206
+ <!-- <xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable> -->
9207
+ <!-- add &lt; and &gt; to \S -->
9208
+ <xsl:variable name="regex_S">[^\r\n\t\f\v \&lt;&gt;]</xsl:variable>
9209
+ <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>
8971
9210
  <xsl:variable name="text3">
8972
9211
  <text><xsl:for-each select="xalan:nodeset($text2)/text/node()">
8973
9212
  <xsl:choose>
@@ -9031,9 +9270,8 @@
9031
9270
  <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
9032
9271
  </xsl:choose>
9033
9272
  </xsl:template>
9034
-
9035
9273
  <!-- ===================================== -->
9036
- <!-- End Update xml -->
9274
+ <!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
9037
9275
  <!-- ===================================== -->
9038
9276
 
9039
9277
  <!-- for correct rendering combining chars -->
@@ -9421,13 +9659,14 @@
9421
9659
  </xsl:template>
9422
9660
 
9423
9661
  <xsl:template name="setId">
9662
+ <xsl:param name="prefix"/>
9424
9663
  <xsl:attribute name="id">
9425
9664
  <xsl:choose>
9426
9665
  <xsl:when test="@id">
9427
- <xsl:value-of select="@id"/>
9666
+ <xsl:value-of select="concat($prefix, @id)"/>
9428
9667
  </xsl:when>
9429
9668
  <xsl:otherwise>
9430
- <xsl:value-of select="generate-id()"/>
9669
+ <xsl:value-of select="concat($prefix, generate-id())"/>
9431
9670
  </xsl:otherwise>
9432
9671
  </xsl:choose>
9433
9672
  </xsl:attribute>