metanorma-ogc 2.3.8 → 2.3.9
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/html_ogc_intro.html +0 -1
- data/lib/isodoc/ogc/html/word_ogc_intro.html +0 -3
- data/lib/isodoc/ogc/html/word_ogc_intro_wp.html +0 -3
- data/lib/isodoc/ogc/html_convert.rb +1 -11
- data/lib/isodoc/ogc/i18n-en.yaml +1 -0
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +228 -80
- data/lib/isodoc/ogc/ogc.best-practice.xsl +228 -80
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +228 -80
- data/lib/isodoc/ogc/ogc.community-practice.xsl +228 -80
- data/lib/isodoc/ogc/ogc.community-standard.xsl +228 -80
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +228 -80
- data/lib/isodoc/ogc/ogc.draft-standard.xsl +228 -80
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +228 -80
- data/lib/isodoc/ogc/ogc.other.xsl +228 -80
- data/lib/isodoc/ogc/ogc.policy.xsl +228 -80
- data/lib/isodoc/ogc/ogc.reference-model.xsl +228 -80
- data/lib/isodoc/ogc/ogc.release-notes.xsl +228 -80
- data/lib/isodoc/ogc/ogc.standard.xsl +228 -80
- data/lib/isodoc/ogc/ogc.test-suite.xsl +228 -80
- data/lib/isodoc/ogc/ogc.user-guide.xsl +228 -80
- data/lib/isodoc/ogc/ogc.white-paper.xsl +230 -82
- data/lib/isodoc/ogc/presentation_xml_convert.rb +9 -6
- data/lib/isodoc/ogc/sections.rb +48 -48
- data/lib/isodoc/ogc/word_convert.rb +3 -0
- data/lib/isodoc/ogc/xref.rb +1 -1
- data/lib/metanorma/ogc/isodoc.rng +12 -7
- data/lib/metanorma/ogc/ogc.rng +3 -8
- data/lib/metanorma/ogc/validate.rb +18 -11
- data/lib/metanorma/ogc/version.rb +1 -1
- metadata +2 -2
@@ -1407,6 +1407,7 @@
|
|
1407
1407
|
</xsl:attribute-set>
|
1408
1408
|
|
1409
1409
|
<xsl:attribute-set name="xref-style">
|
1410
|
+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
1410
1411
|
|
1411
1412
|
<xsl:attribute name="color">blue</xsl:attribute>
|
1412
1413
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
@@ -3452,9 +3453,13 @@
|
|
3452
3453
|
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
3453
3454
|
</xsl:if>
|
3454
3455
|
|
3455
|
-
<
|
3456
|
-
<xsl:
|
3457
|
-
|
3456
|
+
<xsl:call-template name="insert_basic_link">
|
3457
|
+
<xsl:with-param name="element">
|
3458
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
3459
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
3460
|
+
</fo:basic-link>
|
3461
|
+
</xsl:with-param>
|
3462
|
+
</xsl:call-template>
|
3458
3463
|
</fo:inline>
|
3459
3464
|
</xsl:variable>
|
3460
3465
|
|
@@ -3798,8 +3803,10 @@
|
|
3798
3803
|
<xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p' and @keep-with-next = 'true']/node()"/>
|
3799
3804
|
<xsl:text> </xsl:text>
|
3800
3805
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
3801
|
-
<xsl:text
|
3802
|
-
|
3806
|
+
<xsl:if test="*[local-name()='dd']/node()[normalize-space() != ''][1][self::text()]">
|
3807
|
+
<xsl:text> </xsl:text>
|
3808
|
+
</xsl:if>
|
3809
|
+
<xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
|
3803
3810
|
</fo:block>
|
3804
3811
|
|
3805
3812
|
</xsl:when> <!-- END: only one component -->
|
@@ -4286,8 +4293,18 @@
|
|
4286
4293
|
</xsl:if>
|
4287
4294
|
</xsl:template>
|
4288
4295
|
|
4289
|
-
<xsl:template match="*[local-name()='dd']/*
|
4290
|
-
<
|
4296
|
+
<xsl:template match="*[local-name()='dd']/*" mode="inline">
|
4297
|
+
<xsl:variable name="is_inline_element_after_where">
|
4298
|
+
<xsl:if test="(local-name() = 'p') and not(preceding-sibling::node()[normalize-space() != ''])">true</xsl:if>
|
4299
|
+
</xsl:variable>
|
4300
|
+
<xsl:choose>
|
4301
|
+
<xsl:when test="$is_inline_element_after_where = 'true'">
|
4302
|
+
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
4303
|
+
</xsl:when>
|
4304
|
+
<xsl:otherwise>
|
4305
|
+
<xsl:apply-templates select="."/>
|
4306
|
+
</xsl:otherwise>
|
4307
|
+
</xsl:choose>
|
4291
4308
|
</xsl:template>
|
4292
4309
|
|
4293
4310
|
<!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
|
@@ -5720,6 +5737,79 @@
|
|
5720
5737
|
<xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
|
5721
5738
|
</xsl:template>
|
5722
5739
|
|
5740
|
+
<!-- special case for:
|
5741
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
5742
|
+
<mstyle displaystyle="true">
|
5743
|
+
<msup>
|
5744
|
+
<mi color="#00000000">C</mi>
|
5745
|
+
<mtext>R</mtext>
|
5746
|
+
</msup>
|
5747
|
+
<msubsup>
|
5748
|
+
<mtext>C</mtext>
|
5749
|
+
<mi>n</mi>
|
5750
|
+
<mi>k</mi>
|
5751
|
+
</msubsup>
|
5752
|
+
</mstyle>
|
5753
|
+
</math>
|
5754
|
+
-->
|
5755
|
+
<xsl:template match="mathml:msup/mathml:mi[. = '' or . = ''][not(preceding-sibling::*)][following-sibling::mathml:mtext]" mode="mathml">
|
5756
|
+
<xsl:copy>
|
5757
|
+
<xsl:copy-of select="@*"/>
|
5758
|
+
<xsl:variable name="next_mtext" select="ancestor::mathml:msup/following-sibling::*[1][self::mathml:msubsup or self::mathml:msub or self::mathml:msup]/mathml:mtext"/>
|
5759
|
+
<xsl:if test="string-length($next_mtext) != ''">
|
5760
|
+
<xsl:attribute name="color">#00000000</xsl:attribute>
|
5761
|
+
</xsl:if>
|
5762
|
+
<xsl:apply-templates/>
|
5763
|
+
<xsl:value-of select="$next_mtext"/>
|
5764
|
+
</xsl:copy>
|
5765
|
+
</xsl:template>
|
5766
|
+
|
5767
|
+
<!-- special case for:
|
5768
|
+
<msup>
|
5769
|
+
<mtext/>
|
5770
|
+
<mn>1</mn>
|
5771
|
+
</msup>
|
5772
|
+
convert to (add mspace after mtext and enclose them into mrow):
|
5773
|
+
<msup>
|
5774
|
+
<mrow>
|
5775
|
+
<mtext/>
|
5776
|
+
<mspace height="1.47ex"/>
|
5777
|
+
</mrow>
|
5778
|
+
<mn>1</mn>
|
5779
|
+
</msup>
|
5780
|
+
-->
|
5781
|
+
<xsl:template match="mathml:msup/mathml:mtext[not(preceding-sibling::*)]" mode="mathml">
|
5782
|
+
<mathml:mrow>
|
5783
|
+
<xsl:copy-of select="."/>
|
5784
|
+
<mathml:mspace height="1.47ex"/>
|
5785
|
+
</mathml:mrow>
|
5786
|
+
</xsl:template>
|
5787
|
+
|
5788
|
+
<!-- add space around vertical line -->
|
5789
|
+
<xsl:template match="mathml:mo[normalize-space(text()) = '|']" mode="mathml">
|
5790
|
+
<xsl:copy>
|
5791
|
+
<xsl:apply-templates select="@*" mode="mathml"/>
|
5792
|
+
<xsl:if test="not(@lspace)">
|
5793
|
+
<xsl:attribute name="lspace">0.4em</xsl:attribute>
|
5794
|
+
</xsl:if>
|
5795
|
+
<xsl:if test="not(@rspace)">
|
5796
|
+
<xsl:attribute name="rspace">0.4em</xsl:attribute>
|
5797
|
+
</xsl:if>
|
5798
|
+
<xsl:apply-templates mode="mathml"/>
|
5799
|
+
</xsl:copy>
|
5800
|
+
</xsl:template>
|
5801
|
+
|
5802
|
+
<!-- decrease fontsize for 'Circled Times' char -->
|
5803
|
+
<xsl:template match="mathml:mo[normalize-space(text()) = '⊗']" mode="mathml">
|
5804
|
+
<xsl:copy>
|
5805
|
+
<xsl:apply-templates select="@*" mode="mathml"/>
|
5806
|
+
<xsl:if test="not(@fontsize)">
|
5807
|
+
<xsl:attribute name="fontsize">55%</xsl:attribute>
|
5808
|
+
</xsl:if>
|
5809
|
+
<xsl:apply-templates mode="mathml"/>
|
5810
|
+
</xsl:copy>
|
5811
|
+
</xsl:template>
|
5812
|
+
|
5723
5813
|
<!-- Examples:
|
5724
5814
|
<stem type="AsciiMath">x = 1</stem>
|
5725
5815
|
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
@@ -5777,19 +5867,23 @@
|
|
5777
5867
|
<xsl:apply-templates/>
|
5778
5868
|
</xsl:when>
|
5779
5869
|
<xsl:otherwise>
|
5780
|
-
<
|
5781
|
-
<xsl:
|
5782
|
-
<
|
5783
|
-
<xsl:
|
5784
|
-
<xsl:
|
5785
|
-
|
5786
|
-
|
5787
|
-
|
5788
|
-
|
5789
|
-
|
5790
|
-
|
5791
|
-
|
5792
|
-
|
5870
|
+
<xsl:call-template name="insert_basic_link">
|
5871
|
+
<xsl:with-param name="element">
|
5872
|
+
<fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
|
5873
|
+
<xsl:choose>
|
5874
|
+
<xsl:when test="normalize-space(.) = ''">
|
5875
|
+
<xsl:call-template name="add-zero-spaces-link-java">
|
5876
|
+
<xsl:with-param name="text" select="$target_text"/>
|
5877
|
+
</xsl:call-template>
|
5878
|
+
</xsl:when>
|
5879
|
+
<xsl:otherwise>
|
5880
|
+
<!-- output text from <link>text</link> -->
|
5881
|
+
<xsl:apply-templates/>
|
5882
|
+
</xsl:otherwise>
|
5883
|
+
</xsl:choose>
|
5884
|
+
</fo:basic-link>
|
5885
|
+
</xsl:with-param>
|
5886
|
+
</xsl:call-template>
|
5793
5887
|
</xsl:otherwise>
|
5794
5888
|
</xsl:choose>
|
5795
5889
|
</fo:inline>
|
@@ -5852,12 +5946,16 @@
|
|
5852
5946
|
</xsl:template>
|
5853
5947
|
|
5854
5948
|
<xsl:template match="*[local-name() = 'xref']">
|
5855
|
-
<
|
5856
|
-
<xsl:
|
5857
|
-
<
|
5858
|
-
|
5859
|
-
|
5860
|
-
|
5949
|
+
<xsl:call-template name="insert_basic_link">
|
5950
|
+
<xsl:with-param name="element">
|
5951
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
5952
|
+
<xsl:if test="parent::*[local-name() = 'add']">
|
5953
|
+
<xsl:call-template name="append_add-style"/>
|
5954
|
+
</xsl:if>
|
5955
|
+
<xsl:apply-templates/>
|
5956
|
+
</fo:basic-link>
|
5957
|
+
</xsl:with-param>
|
5958
|
+
</xsl:call-template>
|
5861
5959
|
</xsl:template>
|
5862
5960
|
|
5863
5961
|
<!-- ====== -->
|
@@ -6244,7 +6342,7 @@
|
|
6244
6342
|
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
6245
6343
|
</xsl:when>
|
6246
6344
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
6247
|
-
<xsl:value-of select="concat('url(file
|
6345
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
6248
6346
|
</xsl:when>
|
6249
6347
|
<xsl:otherwise>
|
6250
6348
|
<xsl:value-of select="@src"/>
|
@@ -6266,7 +6364,7 @@
|
|
6266
6364
|
</xsl:when>
|
6267
6365
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
6268
6366
|
<xsl:variable name="src">
|
6269
|
-
<xsl:value-of select="concat('url(file
|
6367
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
6270
6368
|
</xsl:variable>
|
6271
6369
|
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
6272
6370
|
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
@@ -6652,15 +6750,19 @@
|
|
6652
6750
|
<xsl:param name="dest"/>
|
6653
6751
|
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
6654
6752
|
<fo:block font-size="1pt">
|
6655
|
-
<
|
6656
|
-
<
|
6657
|
-
<fo:
|
6658
|
-
|
6659
|
-
<
|
6660
|
-
|
6661
|
-
|
6662
|
-
|
6663
|
-
|
6753
|
+
<xsl:call-template name="insert_basic_link">
|
6754
|
+
<xsl:with-param name="element">
|
6755
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
6756
|
+
<fo:inline-container inline-progression-dimension="100%">
|
6757
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
6758
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
6759
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
6760
|
+
</xsl:if> -->
|
6761
|
+
<fo:block> </fo:block></fo:block-container>
|
6762
|
+
</fo:inline-container>
|
6763
|
+
</fo:basic-link>
|
6764
|
+
</xsl:with-param>
|
6765
|
+
</xsl:call-template>
|
6664
6766
|
</fo:block>
|
6665
6767
|
</fo:block-container>
|
6666
6768
|
</xsl:template>
|
@@ -8226,14 +8328,18 @@
|
|
8226
8328
|
</xsl:template>
|
8227
8329
|
|
8228
8330
|
<xsl:template match="*[local-name() = 'origin']">
|
8229
|
-
<
|
8230
|
-
<xsl:
|
8231
|
-
<
|
8232
|
-
|
8233
|
-
|
8234
|
-
|
8235
|
-
|
8236
|
-
|
8331
|
+
<xsl:call-template name="insert_basic_link">
|
8332
|
+
<xsl:with-param name="element">
|
8333
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
8334
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
8335
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
8336
|
+
</xsl:if>
|
8337
|
+
<fo:inline xsl:use-attribute-sets="origin-style">
|
8338
|
+
<xsl:apply-templates/>
|
8339
|
+
</fo:inline>
|
8340
|
+
</fo:basic-link>
|
8341
|
+
</xsl:with-param>
|
8342
|
+
</xsl:call-template>
|
8237
8343
|
</xsl:template>
|
8238
8344
|
|
8239
8345
|
<!-- not using, see https://github.com/glossarist/iev-document/issues/23 -->
|
@@ -8307,9 +8413,13 @@
|
|
8307
8413
|
<xsl:if test="../*[local-name() = 'author']">
|
8308
8414
|
<xsl:text>, </xsl:text>
|
8309
8415
|
</xsl:if>
|
8310
|
-
<
|
8311
|
-
<xsl:
|
8312
|
-
|
8416
|
+
<xsl:call-template name="insert_basic_link">
|
8417
|
+
<xsl:with-param name="element">
|
8418
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
8419
|
+
<xsl:apply-templates/>
|
8420
|
+
</fo:basic-link>
|
8421
|
+
</xsl:with-param>
|
8422
|
+
</xsl:call-template>
|
8313
8423
|
</xsl:template>
|
8314
8424
|
|
8315
8425
|
<xsl:template match="*[local-name() = 'author']">
|
@@ -8358,28 +8468,32 @@
|
|
8358
8468
|
<xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
|
8359
8469
|
<xsl:variable name="text" select="normalize-space()"/>
|
8360
8470
|
|
8361
|
-
<
|
8362
|
-
<xsl:
|
8363
|
-
<
|
8364
|
-
|
8365
|
-
|
8471
|
+
<xsl:call-template name="insert_basic_link">
|
8472
|
+
<xsl:with-param name="element">
|
8473
|
+
<fo:basic-link fox:alt-text="{@citeas}">
|
8474
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
8475
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
8476
|
+
</xsl:if>
|
8477
|
+
<xsl:if test="@type = 'inline'">
|
8366
8478
|
|
8367
|
-
|
8368
|
-
|
8479
|
+
<xsl:attribute name="color">blue</xsl:attribute>
|
8480
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
8369
8481
|
|
8370
|
-
|
8482
|
+
</xsl:if>
|
8371
8483
|
|
8372
|
-
|
8373
|
-
|
8374
|
-
|
8375
|
-
|
8376
|
-
|
8377
|
-
|
8378
|
-
|
8379
|
-
|
8484
|
+
<xsl:choose>
|
8485
|
+
<xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
|
8486
|
+
<xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
|
8487
|
+
</xsl:when>
|
8488
|
+
<xsl:otherwise>
|
8489
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
8490
|
+
</xsl:otherwise>
|
8491
|
+
</xsl:choose>
|
8380
8492
|
|
8381
|
-
|
8382
|
-
|
8493
|
+
<xsl:apply-templates/>
|
8494
|
+
</fo:basic-link>
|
8495
|
+
</xsl:with-param>
|
8496
|
+
</xsl:call-template>
|
8383
8497
|
|
8384
8498
|
</fo:inline>
|
8385
8499
|
</xsl:when>
|
@@ -8629,7 +8743,10 @@
|
|
8629
8743
|
<xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
|
8630
8744
|
|
8631
8745
|
<xsl:template name="setULLabel">
|
8632
|
-
<xsl:variable name="
|
8746
|
+
<xsl:variable name="list_level__">
|
8747
|
+
<xsl:value-of select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
|
8748
|
+
</xsl:variable>
|
8749
|
+
<xsl:variable name="list_level_" select="number($list_level__)"/>
|
8633
8750
|
<xsl:variable name="list_level">
|
8634
8751
|
<xsl:choose>
|
8635
8752
|
<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
|
@@ -8762,9 +8879,11 @@
|
|
8762
8879
|
</fo:block-container>
|
8763
8880
|
</xsl:when>
|
8764
8881
|
<xsl:otherwise>
|
8765
|
-
|
8766
|
-
|
8767
|
-
|
8882
|
+
|
8883
|
+
<fo:block>
|
8884
|
+
<xsl:apply-templates select="." mode="list"/>
|
8885
|
+
</fo:block>
|
8886
|
+
|
8768
8887
|
</xsl:otherwise>
|
8769
8888
|
</xsl:choose>
|
8770
8889
|
</xsl:template>
|
@@ -9448,24 +9567,32 @@
|
|
9448
9567
|
<xsl:for-each select="*[local-name() = 'tab']">
|
9449
9568
|
<xsl:variable name="current_id" select="generate-id()"/>
|
9450
9569
|
<fo:table-cell>
|
9451
|
-
<fo:block>
|
9452
|
-
<
|
9453
|
-
<xsl:
|
9454
|
-
<
|
9455
|
-
<xsl:
|
9456
|
-
|
9457
|
-
|
9458
|
-
|
9459
|
-
|
9570
|
+
<fo:block line-height-shift-adjustment="disregard-shifts">
|
9571
|
+
<xsl:call-template name="insert_basic_link">
|
9572
|
+
<xsl:with-param name="element">
|
9573
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
9574
|
+
<xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
|
9575
|
+
<xsl:choose>
|
9576
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
9577
|
+
<xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
|
9578
|
+
</xsl:choose>
|
9579
|
+
</xsl:for-each>
|
9580
|
+
</fo:basic-link>
|
9581
|
+
</xsl:with-param>
|
9582
|
+
</xsl:call-template>
|
9460
9583
|
</fo:block>
|
9461
9584
|
</fo:table-cell>
|
9462
9585
|
</xsl:for-each>
|
9463
9586
|
<!-- last column - for page numbers -->
|
9464
9587
|
<fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
|
9465
9588
|
<fo:block>
|
9466
|
-
<
|
9467
|
-
<
|
9468
|
-
|
9589
|
+
<xsl:call-template name="insert_basic_link">
|
9590
|
+
<xsl:with-param name="element">
|
9591
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
9592
|
+
<fo:page-number-citation ref-id="{$target}"/>
|
9593
|
+
</fo:basic-link>
|
9594
|
+
</xsl:with-param>
|
9595
|
+
</xsl:call-template>
|
9469
9596
|
</fo:block>
|
9470
9597
|
</fo:table-cell>
|
9471
9598
|
</xsl:template>
|
@@ -9507,6 +9634,27 @@
|
|
9507
9634
|
<!-- End Table of Contents (ToC) processing -->
|
9508
9635
|
<!-- =================== -->
|
9509
9636
|
|
9637
|
+
<!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
|
9638
|
+
<xsl:template name="insert_basic_link">
|
9639
|
+
<xsl:param name="element"/>
|
9640
|
+
<xsl:variable name="element_node" select="xalan:nodeset($element)"/>
|
9641
|
+
<xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
|
9642
|
+
<xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
|
9643
|
+
<xsl:choose>
|
9644
|
+
<xsl:when test="$external-destination = 'true' or $internal-destination = 'true'">
|
9645
|
+
<xsl:copy-of select="$element_node"/>
|
9646
|
+
</xsl:when>
|
9647
|
+
<xsl:otherwise>
|
9648
|
+
<fo:inline>
|
9649
|
+
<xsl:for-each select="$element_node/fo:basic-link/@*[local-name() != 'external-destination' and local-name() != 'internal-destination' and local-name() != 'alt-text']">
|
9650
|
+
<xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
|
9651
|
+
</xsl:for-each>
|
9652
|
+
<xsl:copy-of select="$element_node/fo:basic-link/node()"/>
|
9653
|
+
</fo:inline>
|
9654
|
+
</xsl:otherwise>
|
9655
|
+
</xsl:choose>
|
9656
|
+
</xsl:template>
|
9657
|
+
|
9510
9658
|
<xsl:template match="*[local-name() = 'variant-title']"/> <!-- [@type = 'sub'] -->
|
9511
9659
|
<xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
|
9512
9660
|
<fo:inline padding-right="5mm"> </fo:inline>
|
@@ -12,7 +12,6 @@ module IsoDoc
|
|
12
12
|
|
13
13
|
def convert1(docxml, filename, dir)
|
14
14
|
info docxml, nil
|
15
|
-
insert_preface_sections(docxml)
|
16
15
|
super
|
17
16
|
end
|
18
17
|
|
@@ -20,6 +19,11 @@ module IsoDoc
|
|
20
19
|
File.read(File.join(@libdir, "html", "rouge.css"))
|
21
20
|
end
|
22
21
|
|
22
|
+
def preface_rearrange(doc)
|
23
|
+
super
|
24
|
+
insert_preface_sections(doc)
|
25
|
+
end
|
26
|
+
|
23
27
|
def insert_preface_sections(doc)
|
24
28
|
preface_insert(doc.at(ns("//preface/clause" \
|
25
29
|
"[@type = 'executivesummary']")),
|
@@ -39,8 +43,7 @@ module IsoDoc
|
|
39
43
|
end
|
40
44
|
|
41
45
|
def preface_insert(clause, after, docxml)
|
42
|
-
|
43
|
-
|
46
|
+
clause or return
|
44
47
|
clause.remove
|
45
48
|
if after then after.next = clause
|
46
49
|
else
|
@@ -126,9 +129,9 @@ module IsoDoc
|
|
126
129
|
end
|
127
130
|
|
128
131
|
def clause1(elem)
|
129
|
-
|
130
|
-
elem.parent.xpath(ns("./terms")).size == 1
|
131
|
-
|
132
|
+
elem.name == "terms" && elem.parent.name == "annex" &&
|
133
|
+
elem.parent.xpath(ns("./terms")).size == 1 and return
|
134
|
+
elem.name == "clause" && elem["type"] == "toc" and return
|
132
135
|
super
|
133
136
|
end
|
134
137
|
|
data/lib/isodoc/ogc/sections.rb
CHANGED
@@ -1,70 +1,70 @@
|
|
1
1
|
module IsoDoc
|
2
2
|
module Ogc
|
3
3
|
module BaseConvert
|
4
|
-
def
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
def front(isoxml, out)
|
5
|
+
p = isoxml.at(ns("//preface")) or return
|
6
|
+
p.elements.each do |e|
|
7
|
+
if is_clause?(e.name)
|
8
|
+
case e.name
|
9
|
+
when "abstract" then abstract e, out
|
10
|
+
when "foreword" then foreword e, out
|
11
|
+
when "introduction" then introduction e, out
|
12
|
+
when "submitters" then intro_clause e, out
|
13
|
+
when "clause" then preface e, out
|
14
|
+
when "acknowledgements" then acknowledgements e, out
|
15
|
+
end
|
16
|
+
else
|
17
|
+
preface_block(e, out)
|
18
|
+
end
|
8
19
|
end
|
9
20
|
end
|
10
21
|
|
11
|
-
def
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
def security(docxml, out)
|
23
|
-
f = docxml.at(ns("//preface/clause[@type = 'security']")) or return
|
24
|
-
intro_clause(f, out)
|
25
|
-
end
|
26
|
-
|
27
|
-
def executivesummary(docxml, out)
|
28
|
-
f = docxml.at(ns("//preface/clause[@type = 'executivesummary']")) or
|
29
|
-
return
|
30
|
-
intro_clause(f, out)
|
31
|
-
end
|
32
|
-
|
33
|
-
def submitters(docxml, out)
|
34
|
-
f = docxml.at(ns("//submitters")) || return
|
35
|
-
intro_clause(f, out)
|
22
|
+
def preface(clause, out)
|
23
|
+
case clause["type"]
|
24
|
+
when "toc"
|
25
|
+
table_of_contents(clause, out)
|
26
|
+
when "executivesummary", "security", "submitting_orgs",
|
27
|
+
"keywords"
|
28
|
+
intro_clause(clause, out)
|
29
|
+
else
|
30
|
+
intro_clause(clause, out)
|
31
|
+
end
|
36
32
|
end
|
37
33
|
|
38
|
-
def
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
.each do |
|
43
|
-
|
34
|
+
def intro_clause(elem, out)
|
35
|
+
out.div class: "Section3", id: elem["id"] do |div|
|
36
|
+
clause_name(elem, elem&.at(ns("./title")), div,
|
37
|
+
class: "IntroTitle")
|
38
|
+
elem.elements.each do |e|
|
39
|
+
parse(e, div) unless e.name == "title"
|
40
|
+
end
|
44
41
|
end
|
45
42
|
end
|
46
43
|
|
47
|
-
def abstract(
|
48
|
-
f = isoxml.at(ns("//preface/abstract")) || return
|
44
|
+
def abstract(clause, out)
|
49
45
|
page_break(out)
|
50
|
-
out.div **attr_code(id:
|
51
|
-
clause_name(
|
52
|
-
|
46
|
+
out.div **attr_code(id: clause["id"]) do |s|
|
47
|
+
clause_name(clause, clause.at(ns("./title")), s,
|
48
|
+
class: "AbstractTitle")
|
49
|
+
clause.elements.each do |e|
|
50
|
+
parse(e, s) unless e.name == "title"
|
51
|
+
end
|
53
52
|
end
|
54
53
|
end
|
55
54
|
|
56
|
-
def foreword(
|
57
|
-
f = isoxml.at(ns("//foreword")) || return
|
55
|
+
def foreword(clause, out)
|
58
56
|
page_break(out)
|
59
|
-
out.div **attr_code(id:
|
60
|
-
clause_name(
|
61
|
-
|
57
|
+
out.div **attr_code(id: clause["id"]) do |s|
|
58
|
+
clause_name(clause, clause&.at(ns("./title")), s,
|
59
|
+
class: "ForewordTitle")
|
60
|
+
clause.elements.each do |e|
|
61
|
+
parse(e, s) unless e.name == "title"
|
62
|
+
end
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
65
|
-
def acknowledgements(
|
66
|
-
|
67
|
-
intro_clause(f, out)
|
66
|
+
def acknowledgements(clause, out)
|
67
|
+
intro_clause(clause, out)
|
68
68
|
end
|
69
69
|
|
70
70
|
def conformance(isoxml, out, num)
|
@@ -91,6 +91,8 @@ module IsoDoc
|
|
91
91
|
@prefacenum = 0
|
92
92
|
info docxml, div2
|
93
93
|
boilerplate docxml, div2
|
94
|
+
front docxml, div2
|
95
|
+
=begin
|
94
96
|
preface_block docxml, div2
|
95
97
|
abstract docxml, div2
|
96
98
|
executivesummary docxml, div2
|
@@ -102,6 +104,7 @@ module IsoDoc
|
|
102
104
|
submitters docxml, div2
|
103
105
|
preface docxml, div2
|
104
106
|
acknowledgements docxml, div2
|
107
|
+
=end
|
105
108
|
div2.p { |p| p << " " } # placeholder
|
106
109
|
end
|
107
110
|
section_break(body)
|
data/lib/isodoc/ogc/xref.rb
CHANGED
@@ -31,7 +31,7 @@ module IsoDoc
|
|
31
31
|
end
|
32
32
|
doc.xpath(ns("//preface/clause[not(@type = 'keywords' or " \
|
33
33
|
"@type = 'submitting_orgs' or @type = 'security' or " \
|
34
|
-
"@type = 'executivesummary')]"))
|
34
|
+
"@type = 'executivesummary' or @type = 'toc')]"))
|
35
35
|
.each { |c| preface_names_numbered(c) }
|
36
36
|
preface_names_numbered(doc.at(ns("//acknowledgements")))
|
37
37
|
sequential_asset_names(
|