metanorma-ogc 2.4.9 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ogc/html/htmlstyle.css +12 -0
- data/lib/isodoc/ogc/html/htmlstyle.scss +2 -0
- data/lib/isodoc/ogc/html_convert.rb +52 -5
- data/lib/isodoc/ogc/i18n-en.yaml +1 -0
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +116 -21
- data/lib/isodoc/ogc/ogc.best-practice.xsl +116 -21
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +116 -21
- data/lib/isodoc/ogc/ogc.community-practice.xsl +116 -21
- data/lib/isodoc/ogc/ogc.community-standard.xsl +116 -21
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +116 -21
- data/lib/isodoc/ogc/ogc.draft-standard.xsl +116 -21
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +116 -21
- data/lib/isodoc/ogc/ogc.other.xsl +116 -21
- data/lib/isodoc/ogc/ogc.policy.xsl +116 -21
- data/lib/isodoc/ogc/ogc.reference-model.xsl +116 -21
- data/lib/isodoc/ogc/ogc.release-notes.xsl +116 -21
- data/lib/isodoc/ogc/ogc.standard.xsl +116 -21
- data/lib/isodoc/ogc/ogc.test-suite.xsl +116 -21
- data/lib/isodoc/ogc/ogc.user-guide.xsl +116 -21
- data/lib/isodoc/ogc/ogc.white-paper.xsl +63 -12
- data/lib/isodoc/ogc/presentation_sections.rb +112 -0
- data/lib/isodoc/ogc/presentation_xml_convert.rb +79 -104
- data/lib/metanorma/ogc/basicdoc.rng +94 -8
- data/lib/metanorma/ogc/biblio-standoc.rng +44 -1
- data/lib/metanorma/ogc/biblio.rng +11 -0
- data/lib/metanorma/ogc/boilerplate.adoc +29 -1
- data/lib/metanorma/ogc/cleanup.rb +9 -8
- data/lib/metanorma/ogc/converter.rb +5 -2
- data/lib/metanorma/ogc/isodoc.rng +13 -64
- data/lib/metanorma/ogc/reqt.rng +0 -16
- data/lib/metanorma/ogc/version.rb +1 -1
- data/metanorma-ogc.gemspec +1 -1
- metadata +5 -4
@@ -49,6 +49,7 @@
|
|
49
49
|
<xsl:variable name="color_dl_dt">rgb(215,243,255)</xsl:variable>
|
50
50
|
<xsl:variable name="color_dl_dd">rgb(242,251,255)</xsl:variable>
|
51
51
|
<xsl:variable name="color_blue">rgb(33, 55, 92)</xsl:variable>
|
52
|
+
<xsl:variable name="color_background_blue">rgb(33,60,107)</xsl:variable>
|
52
53
|
|
53
54
|
<xsl:variable name="toc_recommendations_">
|
54
55
|
<xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]">
|
@@ -192,6 +193,10 @@
|
|
192
193
|
|
193
194
|
<fo:flow flow-name="xsl-region-body" color="white">
|
194
195
|
|
196
|
+
<xsl:variable name="curr_lang" select="/ogc:ogc-standard/ogc:bibdata/ogc:language[@current = 'true']"/>
|
197
|
+
<xsl:variable name="stage" select="/ogc:ogc-standard/ogc:bibdata/ogc:status/ogc:stage[@language = $curr_lang] | /ogc:ogc-standard/ogc:bibdata/ogc:status/ogc:stage[not(@language)]"/>
|
198
|
+
<xsl:variable name="isLegacy" select="normalize-space($stage = 'deprecated' or $stage = 'legacy' or $stage = 'retired' or $stage = 'rescinded')"/>
|
199
|
+
|
195
200
|
<!-- background image -->
|
196
201
|
<fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0">
|
197
202
|
<fo:block>
|
@@ -267,7 +272,7 @@
|
|
267
272
|
<fo:block margin-top="4pt"> </fo:block>
|
268
273
|
</fo:block-container>
|
269
274
|
<fo:block color="{$color_design}">
|
270
|
-
<fo:block font-size="17pt"
|
275
|
+
<fo:block font-size="17pt">
|
271
276
|
<xsl:call-template name="addLetterSpacing">
|
272
277
|
<xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($doctype))"/>
|
273
278
|
</xsl:call-template>
|
@@ -291,13 +296,31 @@
|
|
291
296
|
<xsl:with-param name="letter-spacing" select="0.25"/>
|
292
297
|
</xsl:call-template>
|
293
298
|
</fo:block>
|
294
|
-
<
|
295
|
-
|
296
|
-
|
297
|
-
<xsl:
|
298
|
-
<
|
299
|
-
|
300
|
-
|
299
|
+
<xsl:variable name="stage_uc" select="java:toUpperCase(java:java.lang.String.new($stage))"/>
|
300
|
+
|
301
|
+
<xsl:choose>
|
302
|
+
<xsl:when test="$isLegacy = 'true'">
|
303
|
+
<fo:block-container font-size="17pt" background-color="{$color_background_blue}" margin-left="-2.5mm" height="11.5mm" width="56mm" display-align="center" margin-top="0.5mm">
|
304
|
+
<fo:block-container margin-left="2.5mm">
|
305
|
+
<fo:block-container margin-left="0mm">
|
306
|
+
<fo:block margin-top="1mm">
|
307
|
+
<xsl:call-template name="addLetterSpacing">
|
308
|
+
<xsl:with-param name="text" select="$stage_uc"/>
|
309
|
+
</xsl:call-template>
|
310
|
+
</fo:block>
|
311
|
+
</fo:block-container>
|
312
|
+
</fo:block-container>
|
313
|
+
</fo:block-container>
|
314
|
+
</xsl:when>
|
315
|
+
<xsl:otherwise>
|
316
|
+
<fo:block font-size="12pt" font-weight="bold" margin-top="14pt">
|
317
|
+
<xsl:call-template name="addLetterSpacing">
|
318
|
+
<xsl:with-param name="text" select="$stage_uc"/>
|
319
|
+
</xsl:call-template>
|
320
|
+
</fo:block>
|
321
|
+
</xsl:otherwise>
|
322
|
+
</xsl:choose>
|
323
|
+
|
301
324
|
</fo:block>
|
302
325
|
</fo:block-container>
|
303
326
|
</fo:block-container>
|
@@ -389,7 +412,24 @@
|
|
389
412
|
</fo:block>
|
390
413
|
</fo:block>
|
391
414
|
|
392
|
-
<xsl:
|
415
|
+
<xsl:choose>
|
416
|
+
<xsl:when test="$isLegacy = 'true'">
|
417
|
+
<fo:block-container margin-left="-7mm" color="{$color_design}" background-color="{$color_background_blue}" width="202mm">
|
418
|
+
<fo:block-container margin-left="2.5mm" margin-right="1mm" padding-top="0.5mm" padding-bottom="0.5mm">
|
419
|
+
<fo:block-container margin-left="0mm" margin-right="0mm">
|
420
|
+
<fo:block>
|
421
|
+
<xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:legal-statement">
|
422
|
+
<xsl:with-param name="isLegacy" select="$isLegacy"/>
|
423
|
+
</xsl:apply-templates>
|
424
|
+
</fo:block>
|
425
|
+
</fo:block-container>
|
426
|
+
</fo:block-container>
|
427
|
+
</fo:block-container>
|
428
|
+
</xsl:when>
|
429
|
+
<xsl:otherwise>
|
430
|
+
<xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:legal-statement"/>
|
431
|
+
</xsl:otherwise>
|
432
|
+
</xsl:choose>
|
393
433
|
|
394
434
|
</fo:block-container>
|
395
435
|
|
@@ -3429,7 +3469,13 @@
|
|
3429
3469
|
</xsl:template> <!-- license-statement/p -->
|
3430
3470
|
|
3431
3471
|
<xsl:template match="*[local-name()='legal-statement']">
|
3472
|
+
<xsl:param name="isLegacy">false</xsl:param>
|
3432
3473
|
<fo:block xsl:use-attribute-sets="legal-statement-style">
|
3474
|
+
|
3475
|
+
<xsl:if test="$isLegacy = 'true'">
|
3476
|
+
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
3477
|
+
</xsl:if>
|
3478
|
+
|
3433
3479
|
<xsl:apply-templates/>
|
3434
3480
|
</fo:block>
|
3435
3481
|
</xsl:template> <!-- legal-statement -->
|
@@ -5718,13 +5764,14 @@
|
|
5718
5764
|
<!-- ================= -->
|
5719
5765
|
<!-- Added,deleted text -->
|
5720
5766
|
<!-- ================= -->
|
5721
|
-
<xsl:template match="*[local-name()='add']" name="tag_add">
|
5767
|
+
<xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
|
5722
5768
|
<xsl:param name="skip">true</xsl:param>
|
5723
5769
|
<xsl:param name="block">false</xsl:param>
|
5724
5770
|
<xsl:param name="type"/>
|
5725
5771
|
<xsl:param name="text-align"/>
|
5726
5772
|
<xsl:choose>
|
5727
|
-
<xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start
|
5773
|
+
<xsl:when test="starts-with(., $ace_tag) or local-name() = 'change-open-tag' or local-name() = 'change-close-tag'"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start, or
|
5774
|
+
<change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
|
5728
5775
|
<xsl:choose>
|
5729
5776
|
<xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
|
5730
5777
|
<xsl:otherwise>
|
@@ -5732,12 +5779,32 @@
|
|
5732
5779
|
<xsl:call-template name="insertTag">
|
5733
5780
|
<xsl:with-param name="type">
|
5734
5781
|
<xsl:choose>
|
5782
|
+
<xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
|
5783
|
+
<xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
|
5735
5784
|
<xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
|
5736
5785
|
<xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
|
5737
5786
|
</xsl:choose>
|
5738
5787
|
</xsl:with-param>
|
5739
|
-
<xsl:with-param name="kind"
|
5740
|
-
|
5788
|
+
<xsl:with-param name="kind">
|
5789
|
+
<xsl:choose>
|
5790
|
+
<xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
|
5791
|
+
<xsl:value-of select="text()"/>
|
5792
|
+
</xsl:when>
|
5793
|
+
<xsl:otherwise>
|
5794
|
+
<xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
|
5795
|
+
</xsl:otherwise>
|
5796
|
+
</xsl:choose>
|
5797
|
+
</xsl:with-param>
|
5798
|
+
<xsl:with-param name="value">
|
5799
|
+
<xsl:choose>
|
5800
|
+
<xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
|
5801
|
+
<xsl:value-of select="*[local-name() = 'sub']"/>
|
5802
|
+
</xsl:when>
|
5803
|
+
<xsl:otherwise>
|
5804
|
+
<xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
|
5805
|
+
</xsl:otherwise>
|
5806
|
+
</xsl:choose>
|
5807
|
+
</xsl:with-param>
|
5741
5808
|
</xsl:call-template>
|
5742
5809
|
</xsl:variable>
|
5743
5810
|
<xsl:choose>
|
@@ -7949,11 +8016,17 @@
|
|
7949
8016
|
</xsl:when>
|
7950
8017
|
<xsl:otherwise>
|
7951
8018
|
|
8019
|
+
<xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
|
8020
|
+
<xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
|
8021
|
+
|
7952
8022
|
<xsl:variable name="element">
|
7953
8023
|
<xsl:choose>
|
7954
8024
|
<xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
|
7955
8025
|
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
7956
8026
|
</xsl:when>
|
8027
|
+
<xsl:when test="not(ancestor::*[local-name() = 'figure'])">
|
8028
|
+
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
8029
|
+
</xsl:when>
|
7957
8030
|
<xsl:otherwise>
|
7958
8031
|
<fo:block xsl:use-attribute-sets="image-style">
|
7959
8032
|
<xsl:if test="ancestor::*[local-name() = 'dt']">
|
@@ -7969,10 +8042,24 @@
|
|
7969
8042
|
<xsl:copy-of select="@*"/>
|
7970
8043
|
<!-- <fo:block xsl:use-attribute-sets="image-style"> -->
|
7971
8044
|
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
7972
|
-
|
7973
|
-
|
7974
|
-
|
7975
|
-
|
8045
|
+
|
8046
|
+
<xsl:choose>
|
8047
|
+
<xsl:when test="$image_class = 'corrigenda-tag'">
|
8048
|
+
<xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
|
8049
|
+
<xsl:attribute name="baseline-shift">-10%</xsl:attribute>
|
8050
|
+
<xsl:if test="$ancestor_table_cell = 'true'">
|
8051
|
+
<xsl:attribute name="baseline-shift">-25%</xsl:attribute>
|
8052
|
+
</xsl:if>
|
8053
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
8054
|
+
</xsl:when>
|
8055
|
+
<xsl:otherwise>
|
8056
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
8057
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
8058
|
+
</xsl:if>
|
8059
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
8060
|
+
</xsl:otherwise>
|
8061
|
+
</xsl:choose>
|
8062
|
+
|
7976
8063
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
7977
8064
|
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
7978
8065
|
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
@@ -10197,14 +10284,16 @@
|
|
10197
10284
|
|
10198
10285
|
<xsl:template match="*[local-name() = 'annex']">
|
10199
10286
|
<fo:block break-after="page"/>
|
10200
|
-
<fo:block
|
10287
|
+
<fo:block>
|
10201
10288
|
|
10202
10289
|
<xsl:call-template name="setBlockSpanAll"/>
|
10203
10290
|
|
10204
10291
|
<xsl:call-template name="refine_annex_style"/>
|
10205
10292
|
|
10206
10293
|
</fo:block>
|
10207
|
-
<
|
10294
|
+
<fo:block id="{@id}">
|
10295
|
+
<xsl:apply-templates/>
|
10296
|
+
</fo:block>
|
10208
10297
|
</xsl:template>
|
10209
10298
|
|
10210
10299
|
<xsl:template name="refine_annex_style">
|
@@ -10224,13 +10313,19 @@
|
|
10224
10313
|
<fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
10225
10314
|
</xsl:when>
|
10226
10315
|
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
10227
|
-
<xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
10316
|
+
<xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
10317
|
+
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
10318
|
+
</xsl:when>
|
10319
|
+
<xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
10228
10320
|
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
10229
10321
|
</xsl:when>
|
10230
10322
|
</xsl:choose>
|
10231
10323
|
|
10232
10324
|
</xsl:template>
|
10233
10325
|
|
10326
|
+
<!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
|
10327
|
+
<xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
|
10328
|
+
|
10234
10329
|
<xsl:template match="*[local-name() = 'name']/text()">
|
10235
10330
|
<!-- 0xA0 to space replacement -->
|
10236
10331
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
@@ -11833,7 +11928,7 @@
|
|
11833
11928
|
|
11834
11929
|
<xsl:template name="printEdition">
|
11835
11930
|
<xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
11836
|
-
|
11931
|
+
|
11837
11932
|
<xsl:choose>
|
11838
11933
|
<xsl:when test="$edition_i18n != ''">
|
11839
11934
|
<!-- Example: <edition language="fr">deuxième édition</edition> -->
|
@@ -2501,7 +2501,9 @@
|
|
2501
2501
|
</xsl:template> <!-- license-statement/p -->
|
2502
2502
|
|
2503
2503
|
<xsl:template match="*[local-name()='legal-statement']">
|
2504
|
+
<xsl:param name="isLegacy">false</xsl:param>
|
2504
2505
|
<fo:block xsl:use-attribute-sets="legal-statement-style">
|
2506
|
+
|
2505
2507
|
<xsl:apply-templates/>
|
2506
2508
|
</fo:block>
|
2507
2509
|
</xsl:template> <!-- legal-statement -->
|
@@ -4794,13 +4796,14 @@
|
|
4794
4796
|
<!-- ================= -->
|
4795
4797
|
<!-- Added,deleted text -->
|
4796
4798
|
<!-- ================= -->
|
4797
|
-
<xsl:template match="*[local-name()='add']" name="tag_add">
|
4799
|
+
<xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
|
4798
4800
|
<xsl:param name="skip">true</xsl:param>
|
4799
4801
|
<xsl:param name="block">false</xsl:param>
|
4800
4802
|
<xsl:param name="type"/>
|
4801
4803
|
<xsl:param name="text-align"/>
|
4802
4804
|
<xsl:choose>
|
4803
|
-
<xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start
|
4805
|
+
<xsl:when test="starts-with(., $ace_tag) or local-name() = 'change-open-tag' or local-name() = 'change-close-tag'"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start, or
|
4806
|
+
<change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
|
4804
4807
|
<xsl:choose>
|
4805
4808
|
<xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
|
4806
4809
|
<xsl:otherwise>
|
@@ -4808,12 +4811,32 @@
|
|
4808
4811
|
<xsl:call-template name="insertTag">
|
4809
4812
|
<xsl:with-param name="type">
|
4810
4813
|
<xsl:choose>
|
4814
|
+
<xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
|
4815
|
+
<xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
|
4811
4816
|
<xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
|
4812
4817
|
<xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
|
4813
4818
|
</xsl:choose>
|
4814
4819
|
</xsl:with-param>
|
4815
|
-
<xsl:with-param name="kind"
|
4816
|
-
|
4820
|
+
<xsl:with-param name="kind">
|
4821
|
+
<xsl:choose>
|
4822
|
+
<xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
|
4823
|
+
<xsl:value-of select="text()"/>
|
4824
|
+
</xsl:when>
|
4825
|
+
<xsl:otherwise>
|
4826
|
+
<xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
|
4827
|
+
</xsl:otherwise>
|
4828
|
+
</xsl:choose>
|
4829
|
+
</xsl:with-param>
|
4830
|
+
<xsl:with-param name="value">
|
4831
|
+
<xsl:choose>
|
4832
|
+
<xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
|
4833
|
+
<xsl:value-of select="*[local-name() = 'sub']"/>
|
4834
|
+
</xsl:when>
|
4835
|
+
<xsl:otherwise>
|
4836
|
+
<xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
|
4837
|
+
</xsl:otherwise>
|
4838
|
+
</xsl:choose>
|
4839
|
+
</xsl:with-param>
|
4817
4840
|
</xsl:call-template>
|
4818
4841
|
</xsl:variable>
|
4819
4842
|
<xsl:choose>
|
@@ -7019,11 +7042,17 @@
|
|
7019
7042
|
</xsl:when>
|
7020
7043
|
<xsl:otherwise>
|
7021
7044
|
|
7045
|
+
<xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
|
7046
|
+
<xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
|
7047
|
+
|
7022
7048
|
<xsl:variable name="element">
|
7023
7049
|
<xsl:choose>
|
7024
7050
|
<xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
|
7025
7051
|
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
7026
7052
|
</xsl:when>
|
7053
|
+
<xsl:when test="not(ancestor::*[local-name() = 'figure'])">
|
7054
|
+
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
7055
|
+
</xsl:when>
|
7027
7056
|
<xsl:otherwise>
|
7028
7057
|
<fo:block xsl:use-attribute-sets="image-style">
|
7029
7058
|
<xsl:if test="ancestor::*[local-name() = 'dt']">
|
@@ -7039,10 +7068,24 @@
|
|
7039
7068
|
<xsl:copy-of select="@*"/>
|
7040
7069
|
<!-- <fo:block xsl:use-attribute-sets="image-style"> -->
|
7041
7070
|
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
7042
|
-
|
7043
|
-
|
7044
|
-
|
7045
|
-
|
7071
|
+
|
7072
|
+
<xsl:choose>
|
7073
|
+
<xsl:when test="$image_class = 'corrigenda-tag'">
|
7074
|
+
<xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
|
7075
|
+
<xsl:attribute name="baseline-shift">-10%</xsl:attribute>
|
7076
|
+
<xsl:if test="$ancestor_table_cell = 'true'">
|
7077
|
+
<xsl:attribute name="baseline-shift">-25%</xsl:attribute>
|
7078
|
+
</xsl:if>
|
7079
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
7080
|
+
</xsl:when>
|
7081
|
+
<xsl:otherwise>
|
7082
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
7083
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
7084
|
+
</xsl:if>
|
7085
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
7086
|
+
</xsl:otherwise>
|
7087
|
+
</xsl:choose>
|
7088
|
+
|
7046
7089
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
7047
7090
|
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
7048
7091
|
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
@@ -9248,14 +9291,16 @@
|
|
9248
9291
|
|
9249
9292
|
<xsl:template match="*[local-name() = 'annex']">
|
9250
9293
|
<fo:block break-after="page"/>
|
9251
|
-
<fo:block
|
9294
|
+
<fo:block>
|
9252
9295
|
|
9253
9296
|
<xsl:call-template name="setBlockSpanAll"/>
|
9254
9297
|
|
9255
9298
|
<xsl:call-template name="refine_annex_style"/>
|
9256
9299
|
|
9257
9300
|
</fo:block>
|
9258
|
-
<
|
9301
|
+
<fo:block id="{@id}">
|
9302
|
+
<xsl:apply-templates/>
|
9303
|
+
</fo:block>
|
9259
9304
|
</xsl:template>
|
9260
9305
|
|
9261
9306
|
<xsl:template name="refine_annex_style">
|
@@ -9275,13 +9320,19 @@
|
|
9275
9320
|
<fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
9276
9321
|
</xsl:when>
|
9277
9322
|
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
9278
|
-
<xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
9323
|
+
<xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
9324
|
+
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
9325
|
+
</xsl:when>
|
9326
|
+
<xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
9279
9327
|
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
9280
9328
|
</xsl:when>
|
9281
9329
|
</xsl:choose>
|
9282
9330
|
|
9283
9331
|
</xsl:template>
|
9284
9332
|
|
9333
|
+
<!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
|
9334
|
+
<xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
|
9335
|
+
|
9285
9336
|
<xsl:template match="*[local-name() = 'name']/text()">
|
9286
9337
|
<!-- 0xA0 to space replacement -->
|
9287
9338
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
@@ -10884,7 +10935,7 @@
|
|
10884
10935
|
|
10885
10936
|
<xsl:template name="printEdition">
|
10886
10937
|
<xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
10887
|
-
|
10938
|
+
|
10888
10939
|
<xsl:choose>
|
10889
10940
|
<xsl:when test="$edition_i18n != ''">
|
10890
10941
|
<!-- Example: <edition language="fr">deuxième édition</edition> -->
|
@@ -0,0 +1,112 @@
|
|
1
|
+
module IsoDoc
|
2
|
+
module Ogc
|
3
|
+
class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
|
4
|
+
def middle_title(docxml); end
|
5
|
+
|
6
|
+
def preface_rearrange(doc)
|
7
|
+
super
|
8
|
+
insert_preface_sections(doc)
|
9
|
+
end
|
10
|
+
|
11
|
+
def insert_preface_sections(doc)
|
12
|
+
preface_insert(doc.at(ns("//preface/clause" \
|
13
|
+
"[@type = 'executivesummary']")),
|
14
|
+
doc.at(ns("//preface/abstract")), doc)
|
15
|
+
preface_insert(doc.at(ns("//preface//submitters")),
|
16
|
+
submit_orgs_append_pt(doc), doc)
|
17
|
+
insert_submitting_orgs(doc)
|
18
|
+
preface_insert(doc.at(ns("//preface/clause[@type = 'security']")),
|
19
|
+
submit_orgs_append_pt(doc), doc)
|
20
|
+
insert_keywords(doc)
|
21
|
+
end
|
22
|
+
|
23
|
+
def preface_init_insert_pt(docxml)
|
24
|
+
docxml.at(ns("//preface")) ||
|
25
|
+
docxml.at(ns("//sections"))
|
26
|
+
.add_previous_sibling("<preface> </preface>").first
|
27
|
+
end
|
28
|
+
|
29
|
+
def preface_insert(clause, after, docxml)
|
30
|
+
clause or return
|
31
|
+
clause.remove
|
32
|
+
if after then after.next = clause
|
33
|
+
else
|
34
|
+
preface_init_insert_pt(docxml)&.children&.first
|
35
|
+
&.add_previous_sibling(clause)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def submit_orgs_append_pt(docxml)
|
40
|
+
docxml.at(ns("//foreword")) ||
|
41
|
+
docxml.at(ns("//preface/clause[@type = 'keywords']")) ||
|
42
|
+
docxml.at(ns("//preface/clause[@type = 'executivesummary']")) ||
|
43
|
+
docxml.at(ns("//preface/abstract"))
|
44
|
+
end
|
45
|
+
|
46
|
+
def insert_submitting_orgs(docxml)
|
47
|
+
orgs = docxml.xpath(ns(submittingorgs_path))
|
48
|
+
.each_with_object([]) { |org, m| m << org.text }
|
49
|
+
orgs.empty? and return
|
50
|
+
if a = submit_orgs_append_pt(docxml)
|
51
|
+
a.next = submitting_orgs_clause(orgs)
|
52
|
+
else
|
53
|
+
preface_init_insert_pt(docxml)&.children&.first
|
54
|
+
&.add_previous_sibling(submitting_orgs_clause(orgs))
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def submitting_orgs_clause(orgs)
|
59
|
+
<<~SUBMITTING
|
60
|
+
<clause id="_#{UUIDTools::UUID.random_create}" type="submitting_orgs">
|
61
|
+
<title>Submitting Organizations</title>
|
62
|
+
<p>The following organizations submitted this Document to the Open Geospatial Consortium (OGC):</p>
|
63
|
+
<ul>#{orgs.map { |m| "<li>#{m}</li>" }.join("\n")}</ul>
|
64
|
+
</clause>
|
65
|
+
SUBMITTING
|
66
|
+
end
|
67
|
+
|
68
|
+
def keyword_clause(kwords)
|
69
|
+
<<~KEYWORDS
|
70
|
+
<clause id="_#{UUIDTools::UUID.random_create}" type="keywords">
|
71
|
+
<title>Keywords</title>
|
72
|
+
<p>The following are keywords to be used by search engines and document catalogues.</p>
|
73
|
+
<p>#{kwords.join(', ')}</p></clause>
|
74
|
+
KEYWORDS
|
75
|
+
end
|
76
|
+
|
77
|
+
def insert_keywords(docxml)
|
78
|
+
kw = @meta.get[:keywords]
|
79
|
+
kw.empty? and return
|
80
|
+
if abstract =
|
81
|
+
docxml.at(ns("//preface/clause[@type = 'executivesummary']")) ||
|
82
|
+
docxml.at(ns("//preface/abstract"))
|
83
|
+
abstract.next = keyword_clause(kw)
|
84
|
+
else
|
85
|
+
preface_init_insert_pt(docxml)&.children&.first
|
86
|
+
&.add_previous_sibling(keyword_clause(kw))
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def annex1(elem)
|
91
|
+
lbl = @xrefs.anchor(elem["id"], :label)
|
92
|
+
t = elem.at(ns("./title")) and
|
93
|
+
t.children = "<strong>#{to_xml(t.children)}</strong>"
|
94
|
+
prefix_name(elem, "<br/>", lbl, "title")
|
95
|
+
end
|
96
|
+
|
97
|
+
def clause(docxml)
|
98
|
+
super
|
99
|
+
docxml.xpath(ns("//foreword | //preface/abstract | " \
|
100
|
+
"//submitters | //introduction | //acknowledgements"))
|
101
|
+
.each { |f| clause1(f) }
|
102
|
+
end
|
103
|
+
|
104
|
+
def clause1(elem)
|
105
|
+
elem.name == "terms" && elem.parent.name == "annex" &&
|
106
|
+
elem.parent.xpath(ns("./terms")).size == 1 and return
|
107
|
+
elem.name == "clause" && elem["type"] == "toc" and return
|
108
|
+
super
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|