metanorma-ogc 2.7.2 → 2.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/ogc/base_convert.rb +3 -2
- data/lib/isodoc/ogc/html/htmlstyle.css +7 -0
- data/lib/isodoc/ogc/html_convert.rb +4 -2
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +323 -87
- data/lib/isodoc/ogc/ogc.best-practice.xsl +323 -87
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +323 -87
- data/lib/isodoc/ogc/ogc.community-practice.xsl +323 -87
- data/lib/isodoc/ogc/ogc.community-standard.xsl +323 -87
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +323 -87
- data/lib/isodoc/ogc/ogc.draft-standard.xsl +323 -87
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +323 -87
- data/lib/isodoc/ogc/ogc.other.xsl +323 -87
- data/lib/isodoc/ogc/ogc.policy.xsl +323 -87
- data/lib/isodoc/ogc/ogc.reference-model.xsl +323 -87
- data/lib/isodoc/ogc/ogc.release-notes.xsl +323 -87
- data/lib/isodoc/ogc/ogc.standard.xsl +323 -87
- data/lib/isodoc/ogc/ogc.test-suite.xsl +323 -87
- data/lib/isodoc/ogc/ogc.user-guide.xsl +323 -87
- data/lib/isodoc/ogc/ogc.white-paper.xsl +306 -72
- data/lib/isodoc/ogc/presentation_xml_convert.rb +18 -8
- data/lib/metanorma/ogc/basicdoc.rng +48 -35
- data/lib/metanorma/ogc/biblio-standoc.rng +37 -7
- data/lib/metanorma/ogc/biblio.rng +30 -18
- data/lib/metanorma/ogc/isodoc.rng +126 -80
- data/lib/metanorma/ogc/ogc.rng +0 -32
- data/lib/metanorma/ogc/relaton-ogc.rng +0 -16
- data/lib/metanorma/ogc/reqt.rng +7 -6
- data/lib/metanorma/ogc/validate.rb +15 -18
- data/lib/metanorma/ogc/version.rb +1 -1
- metadata +2 -2
@@ -1496,6 +1496,7 @@
|
|
1496
1496
|
</xsl:template> <!-- refine_table-style -->
|
1497
1497
|
|
1498
1498
|
<xsl:attribute-set name="table-name-style">
|
1499
|
+
<xsl:attribute name="role">Caption</xsl:attribute>
|
1499
1500
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1500
1501
|
|
1501
1502
|
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
@@ -1511,6 +1512,9 @@
|
|
1511
1512
|
|
1512
1513
|
<xsl:template name="refine_table-name-style">
|
1513
1514
|
<xsl:param name="continued"/>
|
1515
|
+
<xsl:if test="$continued = 'true'">
|
1516
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
1517
|
+
</xsl:if>
|
1514
1518
|
|
1515
1519
|
</xsl:template> <!-- refine_table-name-style -->
|
1516
1520
|
|
@@ -3344,7 +3348,7 @@
|
|
3344
3348
|
</xsl:if>
|
3345
3349
|
|
3346
3350
|
</fo:block-container>
|
3347
|
-
</xsl:variable>
|
3351
|
+
</xsl:variable> <!-- END: variable name="table" -->
|
3348
3352
|
|
3349
3353
|
<xsl:variable name="isAdded" select="@added"/>
|
3350
3354
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -3398,11 +3402,12 @@
|
|
3398
3402
|
|
3399
3403
|
</xsl:template>
|
3400
3404
|
|
3405
|
+
<!-- table/name-->
|
3401
3406
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
3402
3407
|
<xsl:param name="continued"/>
|
3403
3408
|
<xsl:if test="normalize-space() != ''">
|
3404
3409
|
|
3405
|
-
<fo:block xsl:use-attribute-sets="table-name-style"
|
3410
|
+
<fo:block xsl:use-attribute-sets="table-name-style">
|
3406
3411
|
|
3407
3412
|
<xsl:call-template name="refine_table-name-style">
|
3408
3413
|
<xsl:with-param name="continued" select="$continued"/>
|
@@ -3879,7 +3884,7 @@
|
|
3879
3884
|
|
3880
3885
|
<xsl:variable name="tableWithNotesAndFootnotes">
|
3881
3886
|
|
3882
|
-
<fo:table keep-with-previous="always">
|
3887
|
+
<fo:table keep-with-previous="always" role="SKIP">
|
3883
3888
|
<xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
|
3884
3889
|
<xsl:variable name="name" select="local-name()"/>
|
3885
3890
|
<xsl:choose>
|
@@ -3910,9 +3915,9 @@
|
|
3910
3915
|
</xsl:otherwise>
|
3911
3916
|
</xsl:choose>
|
3912
3917
|
|
3913
|
-
<fo:table-body>
|
3914
|
-
<fo:table-row>
|
3915
|
-
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
3918
|
+
<fo:table-body role="SKIP">
|
3919
|
+
<fo:table-row role="SKIP">
|
3920
|
+
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
|
3916
3921
|
|
3917
3922
|
<xsl:call-template name="refine_table-footer-cell-style"/>
|
3918
3923
|
|
@@ -4116,6 +4121,8 @@
|
|
4116
4121
|
|
4117
4122
|
<xsl:template name="setTableRowAttributes">
|
4118
4123
|
|
4124
|
+
<xsl:call-template name="setColors"/>
|
4125
|
+
|
4119
4126
|
</xsl:template> <!-- setTableRowAttributes -->
|
4120
4127
|
<!-- ===================== -->
|
4121
4128
|
<!-- END Table's row processing -->
|
@@ -4167,6 +4174,7 @@
|
|
4167
4174
|
</xsl:attribute>
|
4168
4175
|
</xsl:if>
|
4169
4176
|
<xsl:call-template name="display-align"/>
|
4177
|
+
<xsl:call-template name="setColors"/>
|
4170
4178
|
</xsl:template>
|
4171
4179
|
|
4172
4180
|
<xsl:template name="display-align">
|
@@ -4182,6 +4190,29 @@
|
|
4182
4190
|
</xsl:if>
|
4183
4191
|
</xsl:template>
|
4184
4192
|
|
4193
|
+
<xsl:template name="setColors">
|
4194
|
+
<xsl:variable name="styles__">
|
4195
|
+
<xsl:call-template name="split">
|
4196
|
+
<xsl:with-param name="pText" select="concat(@style,';')"/>
|
4197
|
+
<xsl:with-param name="sep" select="';'"/>
|
4198
|
+
</xsl:call-template>
|
4199
|
+
</xsl:variable>
|
4200
|
+
<xsl:variable name="quot">"</xsl:variable>
|
4201
|
+
<xsl:variable name="styles_">
|
4202
|
+
<xsl:for-each select="xalan:nodeset($styles__)/item">
|
4203
|
+
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
|
4204
|
+
<xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
|
4205
|
+
<xsl:if test="$key = 'color' or $key = 'background-color'">
|
4206
|
+
<style name="{$key}"><xsl:value-of select="$value"/></style>
|
4207
|
+
</xsl:if>
|
4208
|
+
</xsl:for-each>
|
4209
|
+
</xsl:variable>
|
4210
|
+
<xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
|
4211
|
+
<xsl:for-each select="$styles/style">
|
4212
|
+
<xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
|
4213
|
+
</xsl:for-each>
|
4214
|
+
</xsl:template>
|
4215
|
+
|
4185
4216
|
<!-- cell in table body, footer -->
|
4186
4217
|
<xsl:template match="*[local-name()='td']" name="td">
|
4187
4218
|
<fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
|
@@ -4193,12 +4224,12 @@
|
|
4193
4224
|
|
4194
4225
|
<xsl:call-template name="refine_table-cell-style"/>
|
4195
4226
|
|
4227
|
+
<xsl:call-template name="setTableCellAttributes"/>
|
4228
|
+
|
4196
4229
|
<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
|
4197
4230
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
4198
4231
|
</xsl:if>
|
4199
4232
|
|
4200
|
-
<xsl:call-template name="setTableCellAttributes"/>
|
4201
|
-
|
4202
4233
|
<xsl:if test="$isGenerateTableIF = 'true'">
|
4203
4234
|
<xsl:attribute name="border">1pt solid black</xsl:attribute> <!-- border is mandatory, to determine page width -->
|
4204
4235
|
<xsl:attribute name="text-align">left</xsl:attribute>
|
@@ -4283,6 +4314,7 @@
|
|
4283
4314
|
<!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
|
4284
4315
|
<!-- fn in text -->
|
4285
4316
|
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
|
4317
|
+
<xsl:param name="footnote_body_from_table">false</xsl:param>
|
4286
4318
|
|
4287
4319
|
<!-- list of unique footnotes -->
|
4288
4320
|
<xsl:variable name="p_fn_">
|
@@ -4348,7 +4380,7 @@
|
|
4348
4380
|
<xsl:copy-of select="$footnote_inline"/>
|
4349
4381
|
</xsl:when>
|
4350
4382
|
<!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
|
4351
|
-
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
4383
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
|
4352
4384
|
|
4353
4385
|
<fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
|
4354
4386
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -4757,39 +4789,51 @@
|
|
4757
4789
|
<!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
|
4758
4790
|
<!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
|
4759
4791
|
<xsl:template match="*[local-name()='fn']">
|
4760
|
-
<
|
4761
|
-
|
4762
|
-
|
4792
|
+
<xsl:variable name="target" select="@target"/>
|
4793
|
+
<xsl:choose>
|
4794
|
+
<!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
|
4795
|
+
<xsl:when test="not(ancestor::*[local-name() = 'table'][1]/*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body'][@id = $target]) and $footnotes/*[local-name() = 'fmt-fn-body'][@id = $target]">
|
4796
|
+
<xsl:call-template name="fn">
|
4797
|
+
<xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
|
4798
|
+
</xsl:call-template>
|
4799
|
+
</xsl:when>
|
4800
|
+
<xsl:otherwise>
|
4763
4801
|
|
4764
|
-
|
4765
|
-
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
4766
|
-
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
4767
|
-
<!-- <xsl:attribute name="internal-destination">
|
4768
|
-
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
4769
|
-
</xsl:attribute>
|
4770
|
-
</xsl:if>
|
4771
|
-
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
4772
|
-
<xsl:attribute name="internal-destination">
|
4773
|
-
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
4774
|
-
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
4775
|
-
</xsl:attribute>
|
4776
|
-
</xsl:if> -->
|
4777
|
-
<!-- <xsl:if test="$namespace = 'plateau'">
|
4778
|
-
<xsl:text>※</xsl:text>
|
4779
|
-
</xsl:if> -->
|
4780
|
-
<!-- <xsl:value-of select="@reference"/> -->
|
4802
|
+
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
4781
4803
|
|
4782
|
-
|
4804
|
+
<xsl:call-template name="refine_fn-reference-style"/>
|
4783
4805
|
|
4784
|
-
|
4785
|
-
<
|
4786
|
-
|
4787
|
-
|
4788
|
-
|
4789
|
-
|
4790
|
-
|
4791
|
-
|
4792
|
-
|
4806
|
+
<!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
4807
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
|
4808
|
+
<!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
|
4809
|
+
<!-- <xsl:attribute name="internal-destination">
|
4810
|
+
<xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
|
4811
|
+
</xsl:attribute>
|
4812
|
+
</xsl:if>
|
4813
|
+
<xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
|
4814
|
+
<xsl:attribute name="internal-destination">
|
4815
|
+
<xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
|
4816
|
+
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
4817
|
+
</xsl:attribute>
|
4818
|
+
</xsl:if> -->
|
4819
|
+
<!-- <xsl:if test="$namespace = 'plateau'">
|
4820
|
+
<xsl:text>※</xsl:text>
|
4821
|
+
</xsl:if> -->
|
4822
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
4823
|
+
|
4824
|
+
<xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
|
4825
|
+
|
4826
|
+
<!-- <xsl:if test="$namespace = 'bsi'">
|
4827
|
+
<xsl:text>)</xsl:text>
|
4828
|
+
</xsl:if> -->
|
4829
|
+
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
4830
|
+
<!-- <xsl:if test="$namespace = 'jis'">
|
4831
|
+
<fo:inline font-weight="normal">)</fo:inline>
|
4832
|
+
</xsl:if> -->
|
4833
|
+
</fo:basic-link>
|
4834
|
+
</fo:inline>
|
4835
|
+
</xsl:otherwise>
|
4836
|
+
</xsl:choose>
|
4793
4837
|
</xsl:template> <!-- fn -->
|
4794
4838
|
|
4795
4839
|
<!-- fn/text() -->
|
@@ -5985,7 +6029,7 @@
|
|
5985
6029
|
<xsl:choose>
|
5986
6030
|
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
|
5987
6031
|
<xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
|
5988
|
-
<fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
|
6032
|
+
<fo:inline keep-with-next.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
|
5989
6033
|
</xsl:when>
|
5990
6034
|
<xsl:otherwise>
|
5991
6035
|
<xsl:apply-templates/>
|
@@ -5993,7 +6037,7 @@
|
|
5993
6037
|
</xsl:choose>
|
5994
6038
|
</xsl:template>
|
5995
6039
|
<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">
|
5996
|
-
<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
|
6040
|
+
<fo:inline keep-with-next.within-line="always" role="SKIP"><xsl:value-of select="."/></fo:inline>
|
5997
6041
|
</xsl:template>
|
5998
6042
|
|
5999
6043
|
<xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
|
@@ -7033,24 +7077,26 @@
|
|
7033
7077
|
<xsl:apply-templates select="." mode="mathml"/>
|
7034
7078
|
</xsl:variable>
|
7035
7079
|
|
7036
|
-
<fo:instream-foreign-object fox:alt-text="Math">
|
7080
|
+
<fo:instream-foreign-object fox:alt-text="Math" fox:actual-text="Math">
|
7037
7081
|
|
7038
7082
|
<xsl:call-template name="refine_mathml_insteam_object_style"/>
|
7039
7083
|
|
7040
|
-
|
7041
|
-
|
7042
|
-
|
7043
|
-
<xsl:
|
7044
|
-
|
7045
|
-
|
7046
|
-
<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
|
7047
|
-
<xsl:if test="normalize-space($asciimath_text_) != ''">
|
7048
|
-
<!-- put Mathin Alternate Text -->
|
7049
|
-
<xsl:attribute name="fox:alt-text">
|
7050
|
-
<xsl:value-of select="$asciimath_text_"/>
|
7084
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
7085
|
+
<!-- put MathML in Actual Text -->
|
7086
|
+
<!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
|
7087
|
+
<xsl:attribute name="fox:actual-text">
|
7088
|
+
<xsl:value-of select="$mathml_content"/>
|
7051
7089
|
</xsl:attribute>
|
7090
|
+
|
7091
|
+
<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
|
7092
|
+
<xsl:if test="normalize-space($asciimath_text_) != ''">
|
7093
|
+
<!-- put Mathin Alternate Text -->
|
7094
|
+
<xsl:attribute name="fox:alt-text">
|
7095
|
+
<xsl:value-of select="$asciimath_text_"/>
|
7096
|
+
</xsl:attribute>
|
7097
|
+
</xsl:if>
|
7098
|
+
<!-- </xsl:if> -->
|
7052
7099
|
</xsl:if>
|
7053
|
-
<!-- </xsl:if> -->
|
7054
7100
|
|
7055
7101
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
7056
7102
|
|
@@ -8786,6 +8832,13 @@
|
|
8786
8832
|
<xsl:apply-templates select="."/>
|
8787
8833
|
</xsl:template>
|
8788
8834
|
|
8835
|
+
<!-- prevent missing stem for table and figures in ToC -->
|
8836
|
+
<xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
|
8837
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
|
8838
|
+
<xsl:apply-templates select="."/>
|
8839
|
+
</xsl:if>
|
8840
|
+
</xsl:template>
|
8841
|
+
|
8789
8842
|
<xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
|
8790
8843
|
|
8791
8844
|
<xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
|
@@ -8806,6 +8859,8 @@
|
|
8806
8859
|
<xsl:template match="*[local-name() = 'origin']" mode="contents"/>
|
8807
8860
|
<xsl:template match="*[local-name() = 'erefstack ']" mode="contents"/>
|
8808
8861
|
|
8862
|
+
<xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="contents" priority="3"/>
|
8863
|
+
|
8809
8864
|
<xsl:template match="*[local-name() = 'stem']" mode="bookmarks"/>
|
8810
8865
|
<xsl:template match="*[local-name() = 'fmt-stem']" mode="bookmarks">
|
8811
8866
|
<xsl:apply-templates mode="bookmarks"/>
|
@@ -8827,6 +8882,8 @@
|
|
8827
8882
|
<xsl:template match="*[local-name() = 'origin']" mode="bookmarks"/>
|
8828
8883
|
<xsl:template match="*[local-name() = 'erefstack ']" mode="bookmarks"/>
|
8829
8884
|
|
8885
|
+
<xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="bookmarks" priority="3"/>
|
8886
|
+
|
8830
8887
|
<!-- Bookmarks -->
|
8831
8888
|
<xsl:template name="addBookmarks">
|
8832
8889
|
<xsl:param name="contents"/>
|
@@ -8980,6 +9037,26 @@
|
|
8980
9037
|
</xsl:template> <!-- insertTableBookmarks -->
|
8981
9038
|
<!-- End Bookmarks -->
|
8982
9039
|
|
9040
|
+
<!-- ============================ -->
|
9041
|
+
<!-- mode="bookmark_clean" -->
|
9042
|
+
<!-- ============================ -->
|
9043
|
+
<xsl:template match="node()" mode="bookmark_clean">
|
9044
|
+
<xsl:apply-templates select="node()" mode="bookmark_clean"/>
|
9045
|
+
</xsl:template>
|
9046
|
+
|
9047
|
+
<xsl:template match="text()" mode="bookmark_clean">
|
9048
|
+
<xsl:value-of select="."/>
|
9049
|
+
</xsl:template>
|
9050
|
+
|
9051
|
+
<xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
|
9052
|
+
<xsl:value-of select="normalize-space(.)"/>
|
9053
|
+
</xsl:template>
|
9054
|
+
|
9055
|
+
<xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
|
9056
|
+
<!-- ============================ -->
|
9057
|
+
<!-- END: mode="bookmark_clean" -->
|
9058
|
+
<!-- ============================ -->
|
9059
|
+
|
8983
9060
|
<xsl:template name="getLangVersion">
|
8984
9061
|
<xsl:param name="lang"/>
|
8985
9062
|
<xsl:param name="doctype" select="''"/>
|
@@ -10706,21 +10783,32 @@
|
|
10706
10783
|
<!-- ========== -->
|
10707
10784
|
|
10708
10785
|
<xsl:variable name="reviews_">
|
10709
|
-
<xsl:for-each select="//*[local-name() = 'review'][@from]">
|
10786
|
+
<xsl:for-each select="//*[local-name() = 'review'][not(parent::*[local-name() = 'review-container'])][@from]">
|
10710
10787
|
<xsl:copy>
|
10711
10788
|
<xsl:copy-of select="@from"/>
|
10712
10789
|
<xsl:copy-of select="@id"/>
|
10713
10790
|
</xsl:copy>
|
10714
10791
|
</xsl:for-each>
|
10792
|
+
<xsl:for-each select="//*[local-name() = 'fmt-review-start'][@source]">
|
10793
|
+
<xsl:copy>
|
10794
|
+
<xsl:copy-of select="@source"/>
|
10795
|
+
<xsl:copy-of select="@id"/>
|
10796
|
+
</xsl:copy>
|
10797
|
+
</xsl:for-each>
|
10715
10798
|
</xsl:variable>
|
10716
10799
|
<xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
|
10717
10800
|
|
10718
10801
|
<xsl:template name="addReviewHelper">
|
10719
|
-
|
10720
|
-
|
10721
|
-
|
10722
|
-
|
10723
|
-
<
|
10802
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
10803
|
+
<!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
|
10804
|
+
<xsl:variable name="curr_id" select="@id"/>
|
10805
|
+
<!-- <xsl:variable name="review_id" select="normalize-space(/@id)"/> -->
|
10806
|
+
<xsl:for-each select="$reviews//*[local-name() = 'review'][@from = $curr_id]"> <!-- $reviews//*[local-name() = 'fmt-review-start'][@source = $curr_id] -->
|
10807
|
+
<xsl:variable name="review_id" select="normalize-space(@id)"/>
|
10808
|
+
<xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
|
10809
|
+
<fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
10810
|
+
</xsl:if>
|
10811
|
+
</xsl:for-each>
|
10724
10812
|
</xsl:if>
|
10725
10813
|
<!-- <fo:block>
|
10726
10814
|
<curr_id><xsl:value-of select="$curr_id"/></curr_id>
|
@@ -10862,14 +10950,61 @@
|
|
10862
10950
|
|
10863
10951
|
</xsl:template>
|
10864
10952
|
|
10865
|
-
|
10953
|
+
<!-- document text (not figures, or tables) footnotes -->
|
10954
|
+
<xsl:variable name="reviews_container_">
|
10955
|
+
<xsl:for-each select="//*[local-name() = 'review-container']/*[local-name() = 'fmt-review-body']">
|
10956
|
+
<xsl:variable name="update_xml_step1">
|
10957
|
+
<xsl:apply-templates select="." mode="update_xml_step1"/>
|
10958
|
+
</xsl:variable>
|
10959
|
+
<xsl:apply-templates select="xalan:nodeset($update_xml_step1)" mode="update_xml_enclose_keep-together_within-line"/>
|
10960
|
+
</xsl:for-each>
|
10961
|
+
</xsl:variable>
|
10962
|
+
<xsl:variable name="reviews_container" select="xalan:nodeset($reviews_container_)"/>
|
10963
|
+
|
10964
|
+
<xsl:template match="*[local-name() = 'review-container']"/>
|
10965
|
+
|
10966
|
+
<!-- for old Presentation XML (before https://github.com/metanorma/isodoc/issues/670) -->
|
10967
|
+
<xsl:template match="*[local-name() = 'review'][not(parent::*[local-name() = 'review-container'])]"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
|
10968
|
+
<xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
|
10969
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
10970
|
+
<xsl:choose>
|
10971
|
+
<!-- if there isn't the attribute '@from', then -->
|
10972
|
+
<xsl:when test="$id_from = ''">
|
10973
|
+
<fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
10974
|
+
</xsl:when>
|
10975
|
+
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
10976
|
+
<xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
|
10977
|
+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
10978
|
+
</xsl:when>
|
10979
|
+
<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
10980
|
+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
10981
|
+
</xsl:when>
|
10982
|
+
</xsl:choose>
|
10983
|
+
</xsl:if>
|
10984
|
+
</xsl:template>
|
10985
|
+
|
10986
|
+
<!-- for new Presentation XML (https://github.com/metanorma/isodoc/issues/670) -->
|
10987
|
+
<xsl:template match="*[local-name() = 'fmt-review-start']" name="fmt-review-start"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
|
10866
10988
|
<!-- comment 2019-11-29 -->
|
10867
10989
|
<!-- <fo:block font-weight="bold">Review:</fo:block>
|
10868
10990
|
<xsl:apply-templates /> -->
|
10869
10991
|
|
10870
|
-
<xsl:variable name="id_from" select="normalize-space(current()/@
|
10992
|
+
<xsl:variable name="id_from" select="normalize-space(current()/@source)"/>
|
10871
10993
|
|
10872
|
-
<xsl:
|
10994
|
+
<xsl:variable name="source" select="normalize-space(@source)"/>
|
10995
|
+
|
10996
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
10997
|
+
<!-- <xsl:variable name="id_from" select="normalize-space(current()/@from)"/> -->
|
10998
|
+
|
10999
|
+
<!-- <xsl:if test="@source = @end"> -->
|
11000
|
+
<!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
|
11001
|
+
following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
|
11002
|
+
<!-- <fo:block id="{$source}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$source}" fox:alt-text="Annot___{$source}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block> -->
|
11003
|
+
<fo:block id="{@id}" font-size="1pt" role="SKIP" keep-with-next="always" line-height="0.1"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11004
|
+
<!-- </xsl:if> -->
|
11005
|
+
</xsl:if>
|
11006
|
+
|
11007
|
+
<xsl:if test="1 = 2">
|
10873
11008
|
<xsl:choose>
|
10874
11009
|
<!-- if there isn't the attribute '@from', then -->
|
10875
11010
|
<xsl:when test="$id_from = ''">
|
@@ -10877,10 +11012,10 @@
|
|
10877
11012
|
</xsl:when>
|
10878
11013
|
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
10879
11014
|
<xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
|
10880
|
-
<fo:block id="{
|
11015
|
+
<fo:block id="{$id_from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$id_from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
10881
11016
|
</xsl:when>
|
10882
11017
|
<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
10883
|
-
<fo:block id="{
|
11018
|
+
<fo:block id="{$id_from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$id_from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
10884
11019
|
</xsl:when>
|
10885
11020
|
</xsl:choose>
|
10886
11021
|
</xsl:if>
|
@@ -10929,16 +11064,21 @@
|
|
10929
11064
|
<xsl:variable name="list_level">
|
10930
11065
|
<xsl:choose>
|
10931
11066
|
<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
|
10932
|
-
<xsl:
|
11067
|
+
<xsl:when test="$ul_labels/label[@level = 3]"><xsl:value-of select="$list_level_ mod 3"/></xsl:when>
|
11068
|
+
<xsl:when test="$list_level_ mod 2 = 0">2</xsl:when>
|
11069
|
+
<xsl:otherwise><xsl:value-of select="$list_level_ mod 2"/></xsl:otherwise>
|
10933
11070
|
</xsl:choose>
|
10934
11071
|
</xsl:variable>
|
10935
11072
|
<xsl:choose>
|
10936
11073
|
<xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
|
10937
11074
|
<xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
|
10938
11075
|
</xsl:when>
|
10939
|
-
<xsl:when test="$list_level mod 3 = 0">
|
11076
|
+
<xsl:when test="$list_level mod 3 = 0 and $ul_labels/label[@level = 3]">
|
10940
11077
|
<xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
|
10941
11078
|
</xsl:when>
|
11079
|
+
<xsl:when test="$list_level mod 3 = 0">
|
11080
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
|
11081
|
+
</xsl:when>
|
10942
11082
|
<xsl:when test="$list_level mod 2 = 0">
|
10943
11083
|
<xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
|
10944
11084
|
</xsl:when>
|
@@ -10959,9 +11099,15 @@
|
|
10959
11099
|
<xsl:when test="local-name(..) = 'ul'">
|
10960
11100
|
<xsl:choose>
|
10961
11101
|
<xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
|
11102
|
+
<!-- https://github.com/metanorma/isodoc/issues/675 -->
|
11103
|
+
<xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
|
10962
11104
|
<xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
|
10963
11105
|
</xsl:choose>
|
10964
11106
|
</xsl:when>
|
11107
|
+
<!-- https://github.com/metanorma/isodoc/issues/675 -->
|
11108
|
+
<xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
|
11109
|
+
<xsl:value-of select="@label"/>
|
11110
|
+
</xsl:when>
|
10965
11111
|
<xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
|
10966
11112
|
|
10967
11113
|
<xsl:variable name="type" select="../@type"/>
|
@@ -11086,7 +11232,7 @@
|
|
11086
11232
|
|
11087
11233
|
</xsl:otherwise>
|
11088
11234
|
</xsl:choose>
|
11089
|
-
</xsl:template>
|
11235
|
+
</xsl:template> <!-- getListItemFormat -->
|
11090
11236
|
|
11091
11237
|
<xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
11092
11238
|
<xsl:param name="indent">0</xsl:param>
|
@@ -11218,6 +11364,11 @@
|
|
11218
11364
|
|
11219
11365
|
<xsl:call-template name="refine_list-item-label-style"/>
|
11220
11366
|
|
11367
|
+
<xsl:if test="local-name(..) = 'ul'">
|
11368
|
+
<xsl:variable name="li_label" select="@label"/>
|
11369
|
+
<xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
|
11370
|
+
</xsl:if>
|
11371
|
+
|
11221
11372
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
11222
11373
|
<xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
|
11223
11374
|
<xsl:call-template name="append_add-style"/>
|
@@ -11481,10 +11632,22 @@
|
|
11481
11632
|
<xsl:template match="*[local-name() = 'table']/*[local-name() = 'bookmark']" priority="2"/>
|
11482
11633
|
|
11483
11634
|
<xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
11484
|
-
|
11485
|
-
<
|
11486
|
-
|
11487
|
-
|
11635
|
+
<xsl:variable name="bookmark_id" select="@id"/>
|
11636
|
+
<xsl:choose>
|
11637
|
+
<!-- Example:
|
11638
|
+
<fmt-review-start id="_7ef81cf7-3f6c-4ed4-9c1f-1ba092052bbd" source="_dda23915-8574-ef1e-29a1-822d465a5b97" target="_ecfb2210-3b1b-46a2-b63a-8b8505be6686" end="_dda23915-8574-ef1e-29a1-822d465a5b97" author="" date="2025-03-24T00:00:00Z"/>
|
11639
|
+
<bookmark id="_dda23915-8574-ef1e-29a1-822d465a5b97"/>
|
11640
|
+
<fmt-review-end id="_f336a8d0-08a8-4b7f-a1aa-b04688ed40c1" source="_dda23915-8574-ef1e-29a1-822d465a5b97" target="_ecfb2210-3b1b-46a2-b63a-8b8505be6686" start="_dda23915-8574-ef1e-29a1-822d465a5b97" author="" date="2025-03-24T00:00:00Z"/> -->
|
11641
|
+
<xsl:when test="1 = 2 and preceding-sibling::node()[local-name() = 'fmt-review-start'][@source = $bookmark_id] and following-sibling::node()[local-name() = 'fmt-review-end'][@source = $bookmark_id]">
|
11642
|
+
<!-- skip here, see the template 'fmt-review-start' -->
|
11643
|
+
</xsl:when>
|
11644
|
+
<xsl:otherwise>
|
11645
|
+
<!-- <fo:inline id="{@id}" font-size="1pt"/> -->
|
11646
|
+
<fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[local-name() = 'fmt-review-start'][@source = $bookmark_id] and following-sibling::node()[local-name() = 'fmt-review-end'][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
|
11647
|
+
<!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
|
11648
|
+
<xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
|
11649
|
+
</xsl:otherwise>
|
11650
|
+
</xsl:choose>
|
11488
11651
|
</xsl:template>
|
11489
11652
|
<!-- =================== -->
|
11490
11653
|
<!-- End of Index processing -->
|
@@ -12609,6 +12772,16 @@
|
|
12609
12772
|
</xsl:choose>
|
12610
12773
|
</xsl:template>
|
12611
12774
|
|
12775
|
+
<!-- li/fmt-name -->
|
12776
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
|
12777
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
12778
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
12779
|
+
</xsl:template>
|
12780
|
+
<xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
|
12781
|
+
<xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
|
12782
|
+
<xsl:attribute name="full">true</xsl:attribute>
|
12783
|
+
</xsl:template>
|
12784
|
+
|
12612
12785
|
<xsl:template match="*[local-name() = 'fmt-preferred']"/>
|
12613
12786
|
<xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
|
12614
12787
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -12838,6 +13011,9 @@
|
|
12838
13011
|
<xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_step1"/>
|
12839
13012
|
<xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_pres"/>
|
12840
13013
|
|
13014
|
+
<xsl:template match="*[local-name() = 'review-container']" mode="update_xml_step1"/>
|
13015
|
+
<xsl:template match="*[local-name() = 'review-container']" mode="update_xml_pres"/>
|
13016
|
+
|
12841
13017
|
<!-- END: update new Presentation XML -->
|
12842
13018
|
|
12843
13019
|
<!-- =========================================================================== -->
|
@@ -13420,6 +13596,64 @@
|
|
13420
13596
|
<fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
|
13421
13597
|
</xsl:template>
|
13422
13598
|
|
13599
|
+
<!-- ===================================== -->
|
13600
|
+
<!-- ===================================== -->
|
13601
|
+
<!-- Ruby text (CJK languages) rendering -->
|
13602
|
+
<!-- ===================================== -->
|
13603
|
+
<!-- ===================================== -->
|
13604
|
+
<xsl:template match="*[local-name() = 'ruby']">
|
13605
|
+
<fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
|
13606
|
+
<xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
|
13607
|
+
<xsl:attribute name="alignment-baseline">central</xsl:attribute>
|
13608
|
+
</xsl:if>
|
13609
|
+
<xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
|
13610
|
+
<xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
|
13611
|
+
<!-- Example: width="2em" -->
|
13612
|
+
<xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
|
13613
|
+
<xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
|
13614
|
+
<xsl:variable name="text_width">
|
13615
|
+
<xsl:choose>
|
13616
|
+
<xsl:when test="$text_rt_width >= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
|
13617
|
+
<xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
|
13618
|
+
</xsl:choose>
|
13619
|
+
</xsl:variable>
|
13620
|
+
<xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
|
13621
|
+
|
13622
|
+
<xsl:choose>
|
13623
|
+
<xsl:when test="ancestor::*[local-name() = 'ruby']">
|
13624
|
+
<xsl:apply-templates select="*[local-name() = 'rb']"/>
|
13625
|
+
<xsl:apply-templates select="*[local-name() = 'rt']"/>
|
13626
|
+
</xsl:when>
|
13627
|
+
<xsl:otherwise>
|
13628
|
+
<xsl:apply-templates select="*[local-name() = 'rt']"/>
|
13629
|
+
<xsl:apply-templates select="*[local-name() = 'rb']"/>
|
13630
|
+
</xsl:otherwise>
|
13631
|
+
</xsl:choose>
|
13632
|
+
|
13633
|
+
<xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
|
13634
|
+
</fo:inline-container>
|
13635
|
+
</xsl:template>
|
13636
|
+
|
13637
|
+
<xsl:template match="*[local-name() = 'rb']">
|
13638
|
+
<fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
|
13639
|
+
</xsl:template>
|
13640
|
+
|
13641
|
+
<xsl:template match="*[local-name() = 'rt']">
|
13642
|
+
<fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
|
13643
|
+
<xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
|
13644
|
+
<xsl:attribute name="space-before">0em</xsl:attribute>
|
13645
|
+
</xsl:if>
|
13646
|
+
<xsl:apply-templates/>
|
13647
|
+
</fo:block>
|
13648
|
+
|
13649
|
+
</xsl:template>
|
13650
|
+
|
13651
|
+
<!-- ===================================== -->
|
13652
|
+
<!-- ===================================== -->
|
13653
|
+
<!-- END: Ruby text (CJK languages) rendering -->
|
13654
|
+
<!-- ===================================== -->
|
13655
|
+
<!-- ===================================== -->
|
13656
|
+
|
13423
13657
|
<xsl:template name="printEdition">
|
13424
13658
|
<xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
13425
13659
|
|