metanorma-iho 0.7.8 → 0.7.9
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/iho/html/html_iho_intro.html +0 -1
- data/lib/isodoc/iho/html/word_iho_intro.html +0 -3
- data/lib/isodoc/iho/html_convert.rb +2 -0
- data/lib/isodoc/iho/iho.specification.xsl +230 -82
- data/lib/isodoc/iho/iho.standard.xsl +230 -82
- data/lib/isodoc/iho/presentation_xml_convert.rb +15 -1
- data/lib/isodoc/iho/word_convert.rb +17 -17
- data/lib/metanorma/iho/iho.rng +3 -8
- data/lib/metanorma/iho/isodoc.rng +12 -7
- data/lib/metanorma/iho/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44a6c817e8c5684e39adf0452d7e86d0c93bbbfe657c09e4e2c5a2ff073deff5
|
4
|
+
data.tar.gz: 5971f98f8a04db9d19ee893d35b0044da87575924c60967db891c23d9e539dc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e38a5b8edef759b2523059942e5f29a99ec761faca0678ef81355c56e530171f0107e2235eb27c358797c0139c26679d441be2ccf193a9ebd4dc1a1a066939ea
|
7
|
+
data.tar.gz: '0439d5c092c8eed3a38947194849088b7ef8a330a0fe44d4cd6a50f7ef416128044b1b9c648abb984e14416487ce27fb0964000eb4533ddb956809dd005f1620'
|
@@ -12,6 +12,7 @@ module IsoDoc
|
|
12
12
|
Metanorma::IHO.configuration
|
13
13
|
end
|
14
14
|
|
15
|
+
=begin
|
15
16
|
def make_body3(body, docxml)
|
16
17
|
body.div **{ class: "main-section" } do |div3|
|
17
18
|
boilerplate docxml, div3
|
@@ -26,6 +27,7 @@ module IsoDoc
|
|
26
27
|
comments div3
|
27
28
|
end
|
28
29
|
end
|
30
|
+
=end
|
29
31
|
|
30
32
|
include BaseConvert
|
31
33
|
include Init
|
@@ -1566,6 +1566,7 @@
|
|
1566
1566
|
</xsl:attribute-set>
|
1567
1567
|
|
1568
1568
|
<xsl:attribute-set name="xref-style">
|
1569
|
+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
1569
1570
|
|
1570
1571
|
<xsl:attribute name="color">blue</xsl:attribute>
|
1571
1572
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
@@ -3559,9 +3560,13 @@
|
|
3559
3560
|
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
3560
3561
|
</xsl:if>
|
3561
3562
|
|
3562
|
-
<
|
3563
|
-
<xsl:
|
3564
|
-
|
3563
|
+
<xsl:call-template name="insert_basic_link">
|
3564
|
+
<xsl:with-param name="element">
|
3565
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
3566
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
3567
|
+
</fo:basic-link>
|
3568
|
+
</xsl:with-param>
|
3569
|
+
</xsl:call-template>
|
3565
3570
|
</fo:inline>
|
3566
3571
|
</xsl:variable>
|
3567
3572
|
|
@@ -3894,8 +3899,10 @@
|
|
3894
3899
|
<xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p' and @keep-with-next = 'true']/node()"/>
|
3895
3900
|
<xsl:text> </xsl:text>
|
3896
3901
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
3897
|
-
<xsl:text
|
3898
|
-
|
3902
|
+
<xsl:if test="*[local-name()='dd']/node()[normalize-space() != ''][1][self::text()]">
|
3903
|
+
<xsl:text> </xsl:text>
|
3904
|
+
</xsl:if>
|
3905
|
+
<xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
|
3899
3906
|
</fo:block>
|
3900
3907
|
|
3901
3908
|
</xsl:when> <!-- END: only one component -->
|
@@ -4388,8 +4395,18 @@
|
|
4388
4395
|
</xsl:if>
|
4389
4396
|
</xsl:template>
|
4390
4397
|
|
4391
|
-
<xsl:template match="*[local-name()='dd']/*
|
4392
|
-
<
|
4398
|
+
<xsl:template match="*[local-name()='dd']/*" mode="inline">
|
4399
|
+
<xsl:variable name="is_inline_element_after_where">
|
4400
|
+
<xsl:if test="(local-name() = 'p') and not(preceding-sibling::node()[normalize-space() != ''])">true</xsl:if>
|
4401
|
+
</xsl:variable>
|
4402
|
+
<xsl:choose>
|
4403
|
+
<xsl:when test="$is_inline_element_after_where = 'true'">
|
4404
|
+
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
4405
|
+
</xsl:when>
|
4406
|
+
<xsl:otherwise>
|
4407
|
+
<xsl:apply-templates select="."/>
|
4408
|
+
</xsl:otherwise>
|
4409
|
+
</xsl:choose>
|
4393
4410
|
</xsl:template>
|
4394
4411
|
|
4395
4412
|
<!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
|
@@ -5889,6 +5906,79 @@
|
|
5889
5906
|
<xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
|
5890
5907
|
</xsl:template>
|
5891
5908
|
|
5909
|
+
<!-- special case for:
|
5910
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
5911
|
+
<mstyle displaystyle="true">
|
5912
|
+
<msup>
|
5913
|
+
<mi color="#00000000">C</mi>
|
5914
|
+
<mtext>R</mtext>
|
5915
|
+
</msup>
|
5916
|
+
<msubsup>
|
5917
|
+
<mtext>C</mtext>
|
5918
|
+
<mi>n</mi>
|
5919
|
+
<mi>k</mi>
|
5920
|
+
</msubsup>
|
5921
|
+
</mstyle>
|
5922
|
+
</math>
|
5923
|
+
-->
|
5924
|
+
<xsl:template match="mathml:msup/mathml:mi[. = '' or . = ''][not(preceding-sibling::*)][following-sibling::mathml:mtext]" mode="mathml">
|
5925
|
+
<xsl:copy>
|
5926
|
+
<xsl:copy-of select="@*"/>
|
5927
|
+
<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"/>
|
5928
|
+
<xsl:if test="string-length($next_mtext) != ''">
|
5929
|
+
<xsl:attribute name="color">#00000000</xsl:attribute>
|
5930
|
+
</xsl:if>
|
5931
|
+
<xsl:apply-templates/>
|
5932
|
+
<xsl:value-of select="$next_mtext"/>
|
5933
|
+
</xsl:copy>
|
5934
|
+
</xsl:template>
|
5935
|
+
|
5936
|
+
<!-- special case for:
|
5937
|
+
<msup>
|
5938
|
+
<mtext/>
|
5939
|
+
<mn>1</mn>
|
5940
|
+
</msup>
|
5941
|
+
convert to (add mspace after mtext and enclose them into mrow):
|
5942
|
+
<msup>
|
5943
|
+
<mrow>
|
5944
|
+
<mtext/>
|
5945
|
+
<mspace height="1.47ex"/>
|
5946
|
+
</mrow>
|
5947
|
+
<mn>1</mn>
|
5948
|
+
</msup>
|
5949
|
+
-->
|
5950
|
+
<xsl:template match="mathml:msup/mathml:mtext[not(preceding-sibling::*)]" mode="mathml">
|
5951
|
+
<mathml:mrow>
|
5952
|
+
<xsl:copy-of select="."/>
|
5953
|
+
<mathml:mspace height="1.47ex"/>
|
5954
|
+
</mathml:mrow>
|
5955
|
+
</xsl:template>
|
5956
|
+
|
5957
|
+
<!-- add space around vertical line -->
|
5958
|
+
<xsl:template match="mathml:mo[normalize-space(text()) = '|']" mode="mathml">
|
5959
|
+
<xsl:copy>
|
5960
|
+
<xsl:apply-templates select="@*" mode="mathml"/>
|
5961
|
+
<xsl:if test="not(@lspace)">
|
5962
|
+
<xsl:attribute name="lspace">0.4em</xsl:attribute>
|
5963
|
+
</xsl:if>
|
5964
|
+
<xsl:if test="not(@rspace)">
|
5965
|
+
<xsl:attribute name="rspace">0.4em</xsl:attribute>
|
5966
|
+
</xsl:if>
|
5967
|
+
<xsl:apply-templates mode="mathml"/>
|
5968
|
+
</xsl:copy>
|
5969
|
+
</xsl:template>
|
5970
|
+
|
5971
|
+
<!-- decrease fontsize for 'Circled Times' char -->
|
5972
|
+
<xsl:template match="mathml:mo[normalize-space(text()) = '⊗']" mode="mathml">
|
5973
|
+
<xsl:copy>
|
5974
|
+
<xsl:apply-templates select="@*" mode="mathml"/>
|
5975
|
+
<xsl:if test="not(@fontsize)">
|
5976
|
+
<xsl:attribute name="fontsize">55%</xsl:attribute>
|
5977
|
+
</xsl:if>
|
5978
|
+
<xsl:apply-templates mode="mathml"/>
|
5979
|
+
</xsl:copy>
|
5980
|
+
</xsl:template>
|
5981
|
+
|
5892
5982
|
<!-- Examples:
|
5893
5983
|
<stem type="AsciiMath">x = 1</stem>
|
5894
5984
|
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
@@ -5946,19 +6036,23 @@
|
|
5946
6036
|
<xsl:apply-templates/>
|
5947
6037
|
</xsl:when>
|
5948
6038
|
<xsl:otherwise>
|
5949
|
-
<
|
5950
|
-
<xsl:
|
5951
|
-
<
|
5952
|
-
<xsl:
|
5953
|
-
<xsl:
|
5954
|
-
|
5955
|
-
|
5956
|
-
|
5957
|
-
|
5958
|
-
|
5959
|
-
|
5960
|
-
|
5961
|
-
|
6039
|
+
<xsl:call-template name="insert_basic_link">
|
6040
|
+
<xsl:with-param name="element">
|
6041
|
+
<fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
|
6042
|
+
<xsl:choose>
|
6043
|
+
<xsl:when test="normalize-space(.) = ''">
|
6044
|
+
<xsl:call-template name="add-zero-spaces-link-java">
|
6045
|
+
<xsl:with-param name="text" select="$target_text"/>
|
6046
|
+
</xsl:call-template>
|
6047
|
+
</xsl:when>
|
6048
|
+
<xsl:otherwise>
|
6049
|
+
<!-- output text from <link>text</link> -->
|
6050
|
+
<xsl:apply-templates/>
|
6051
|
+
</xsl:otherwise>
|
6052
|
+
</xsl:choose>
|
6053
|
+
</fo:basic-link>
|
6054
|
+
</xsl:with-param>
|
6055
|
+
</xsl:call-template>
|
5962
6056
|
</xsl:otherwise>
|
5963
6057
|
</xsl:choose>
|
5964
6058
|
</fo:inline>
|
@@ -6021,12 +6115,16 @@
|
|
6021
6115
|
</xsl:template>
|
6022
6116
|
|
6023
6117
|
<xsl:template match="*[local-name() = 'xref']">
|
6024
|
-
<
|
6025
|
-
<xsl:
|
6026
|
-
<
|
6027
|
-
|
6028
|
-
|
6029
|
-
|
6118
|
+
<xsl:call-template name="insert_basic_link">
|
6119
|
+
<xsl:with-param name="element">
|
6120
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
6121
|
+
<xsl:if test="parent::*[local-name() = 'add']">
|
6122
|
+
<xsl:call-template name="append_add-style"/>
|
6123
|
+
</xsl:if>
|
6124
|
+
<xsl:apply-templates/>
|
6125
|
+
</fo:basic-link>
|
6126
|
+
</xsl:with-param>
|
6127
|
+
</xsl:call-template>
|
6030
6128
|
</xsl:template>
|
6031
6129
|
|
6032
6130
|
<!-- ====== -->
|
@@ -6409,7 +6507,7 @@
|
|
6409
6507
|
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
6410
6508
|
</xsl:when>
|
6411
6509
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
6412
|
-
<xsl:value-of select="concat('url(file
|
6510
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
6413
6511
|
</xsl:when>
|
6414
6512
|
<xsl:otherwise>
|
6415
6513
|
<xsl:value-of select="@src"/>
|
@@ -6431,7 +6529,7 @@
|
|
6431
6529
|
</xsl:when>
|
6432
6530
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
6433
6531
|
<xsl:variable name="src">
|
6434
|
-
<xsl:value-of select="concat('url(file
|
6532
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
6435
6533
|
</xsl:variable>
|
6436
6534
|
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
6437
6535
|
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
@@ -6817,15 +6915,19 @@
|
|
6817
6915
|
<xsl:param name="dest"/>
|
6818
6916
|
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
6819
6917
|
<fo:block font-size="1pt">
|
6820
|
-
<
|
6821
|
-
<
|
6822
|
-
<fo:
|
6823
|
-
|
6824
|
-
<
|
6825
|
-
|
6826
|
-
|
6827
|
-
|
6828
|
-
|
6918
|
+
<xsl:call-template name="insert_basic_link">
|
6919
|
+
<xsl:with-param name="element">
|
6920
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
6921
|
+
<fo:inline-container inline-progression-dimension="100%">
|
6922
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
6923
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
6924
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
6925
|
+
</xsl:if> -->
|
6926
|
+
<fo:block> </fo:block></fo:block-container>
|
6927
|
+
</fo:inline-container>
|
6928
|
+
</fo:basic-link>
|
6929
|
+
</xsl:with-param>
|
6930
|
+
</xsl:call-template>
|
6829
6931
|
</fo:block>
|
6830
6932
|
</fo:block-container>
|
6831
6933
|
</xsl:template>
|
@@ -8370,14 +8472,18 @@
|
|
8370
8472
|
</xsl:template>
|
8371
8473
|
|
8372
8474
|
<xsl:template match="*[local-name() = 'origin']">
|
8373
|
-
<
|
8374
|
-
<xsl:
|
8375
|
-
<
|
8376
|
-
|
8377
|
-
|
8378
|
-
|
8379
|
-
|
8380
|
-
|
8475
|
+
<xsl:call-template name="insert_basic_link">
|
8476
|
+
<xsl:with-param name="element">
|
8477
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
8478
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
8479
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
8480
|
+
</xsl:if>
|
8481
|
+
<fo:inline xsl:use-attribute-sets="origin-style">
|
8482
|
+
<xsl:apply-templates/>
|
8483
|
+
</fo:inline>
|
8484
|
+
</fo:basic-link>
|
8485
|
+
</xsl:with-param>
|
8486
|
+
</xsl:call-template>
|
8381
8487
|
</xsl:template>
|
8382
8488
|
|
8383
8489
|
<!-- not using, see https://github.com/glossarist/iev-document/issues/23 -->
|
@@ -8451,9 +8557,13 @@
|
|
8451
8557
|
<xsl:if test="../*[local-name() = 'author']">
|
8452
8558
|
<xsl:text>, </xsl:text>
|
8453
8559
|
</xsl:if>
|
8454
|
-
<
|
8455
|
-
<xsl:
|
8456
|
-
|
8560
|
+
<xsl:call-template name="insert_basic_link">
|
8561
|
+
<xsl:with-param name="element">
|
8562
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
8563
|
+
<xsl:apply-templates/>
|
8564
|
+
</fo:basic-link>
|
8565
|
+
</xsl:with-param>
|
8566
|
+
</xsl:call-template>
|
8457
8567
|
</xsl:template>
|
8458
8568
|
|
8459
8569
|
<xsl:template match="*[local-name() = 'author']">
|
@@ -8502,28 +8612,32 @@
|
|
8502
8612
|
<xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
|
8503
8613
|
<xsl:variable name="text" select="normalize-space()"/>
|
8504
8614
|
|
8505
|
-
<
|
8506
|
-
<xsl:
|
8507
|
-
<
|
8508
|
-
|
8509
|
-
|
8615
|
+
<xsl:call-template name="insert_basic_link">
|
8616
|
+
<xsl:with-param name="element">
|
8617
|
+
<fo:basic-link fox:alt-text="{@citeas}">
|
8618
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
8619
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
8620
|
+
</xsl:if>
|
8621
|
+
<xsl:if test="@type = 'inline'">
|
8510
8622
|
|
8511
|
-
|
8512
|
-
|
8623
|
+
<xsl:attribute name="color">blue</xsl:attribute>
|
8624
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
8513
8625
|
|
8514
|
-
|
8626
|
+
</xsl:if>
|
8515
8627
|
|
8516
|
-
|
8517
|
-
|
8518
|
-
|
8519
|
-
|
8520
|
-
|
8521
|
-
|
8522
|
-
|
8523
|
-
|
8628
|
+
<xsl:choose>
|
8629
|
+
<xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
|
8630
|
+
<xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
|
8631
|
+
</xsl:when>
|
8632
|
+
<xsl:otherwise>
|
8633
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
8634
|
+
</xsl:otherwise>
|
8635
|
+
</xsl:choose>
|
8524
8636
|
|
8525
|
-
|
8526
|
-
|
8637
|
+
<xsl:apply-templates/>
|
8638
|
+
</fo:basic-link>
|
8639
|
+
</xsl:with-param>
|
8640
|
+
</xsl:call-template>
|
8527
8641
|
|
8528
8642
|
</fo:inline>
|
8529
8643
|
</xsl:when>
|
@@ -8762,7 +8876,10 @@
|
|
8762
8876
|
<xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
|
8763
8877
|
|
8764
8878
|
<xsl:template name="setULLabel">
|
8765
|
-
<xsl:variable name="
|
8879
|
+
<xsl:variable name="list_level__">
|
8880
|
+
<xsl:value-of select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
|
8881
|
+
</xsl:variable>
|
8882
|
+
<xsl:variable name="list_level_" select="number($list_level__)"/>
|
8766
8883
|
<xsl:variable name="list_level">
|
8767
8884
|
<xsl:choose>
|
8768
8885
|
<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
|
@@ -8895,9 +9012,11 @@
|
|
8895
9012
|
</fo:block-container>
|
8896
9013
|
</xsl:when>
|
8897
9014
|
<xsl:otherwise>
|
8898
|
-
|
8899
|
-
|
8900
|
-
|
9015
|
+
|
9016
|
+
<fo:block>
|
9017
|
+
<xsl:apply-templates select="." mode="list"/>
|
9018
|
+
</fo:block>
|
9019
|
+
|
8901
9020
|
</xsl:otherwise>
|
8902
9021
|
</xsl:choose>
|
8903
9022
|
</xsl:template>
|
@@ -9587,24 +9706,32 @@
|
|
9587
9706
|
<xsl:for-each select="*[local-name() = 'tab']">
|
9588
9707
|
<xsl:variable name="current_id" select="generate-id()"/>
|
9589
9708
|
<fo:table-cell>
|
9590
|
-
<fo:block>
|
9591
|
-
<
|
9592
|
-
<xsl:
|
9593
|
-
<
|
9594
|
-
<xsl:
|
9595
|
-
|
9596
|
-
|
9597
|
-
|
9598
|
-
|
9709
|
+
<fo:block line-height-shift-adjustment="disregard-shifts">
|
9710
|
+
<xsl:call-template name="insert_basic_link">
|
9711
|
+
<xsl:with-param name="element">
|
9712
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
9713
|
+
<xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
|
9714
|
+
<xsl:choose>
|
9715
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
9716
|
+
<xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
|
9717
|
+
</xsl:choose>
|
9718
|
+
</xsl:for-each>
|
9719
|
+
</fo:basic-link>
|
9720
|
+
</xsl:with-param>
|
9721
|
+
</xsl:call-template>
|
9599
9722
|
</fo:block>
|
9600
9723
|
</fo:table-cell>
|
9601
9724
|
</xsl:for-each>
|
9602
9725
|
<!-- last column - for page numbers -->
|
9603
9726
|
<fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
|
9604
9727
|
<fo:block>
|
9605
|
-
<
|
9606
|
-
<
|
9607
|
-
|
9728
|
+
<xsl:call-template name="insert_basic_link">
|
9729
|
+
<xsl:with-param name="element">
|
9730
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
9731
|
+
<fo:page-number-citation ref-id="{$target}"/>
|
9732
|
+
</fo:basic-link>
|
9733
|
+
</xsl:with-param>
|
9734
|
+
</xsl:call-template>
|
9608
9735
|
</fo:block>
|
9609
9736
|
</fo:table-cell>
|
9610
9737
|
</xsl:template>
|
@@ -9646,6 +9773,27 @@
|
|
9646
9773
|
<!-- End Table of Contents (ToC) processing -->
|
9647
9774
|
<!-- =================== -->
|
9648
9775
|
|
9776
|
+
<!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
|
9777
|
+
<xsl:template name="insert_basic_link">
|
9778
|
+
<xsl:param name="element"/>
|
9779
|
+
<xsl:variable name="element_node" select="xalan:nodeset($element)"/>
|
9780
|
+
<xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
|
9781
|
+
<xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
|
9782
|
+
<xsl:choose>
|
9783
|
+
<xsl:when test="$external-destination = 'true' or $internal-destination = 'true'">
|
9784
|
+
<xsl:copy-of select="$element_node"/>
|
9785
|
+
</xsl:when>
|
9786
|
+
<xsl:otherwise>
|
9787
|
+
<fo:inline>
|
9788
|
+
<xsl:for-each select="$element_node/fo:basic-link/@*[local-name() != 'external-destination' and local-name() != 'internal-destination' and local-name() != 'alt-text']">
|
9789
|
+
<xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
|
9790
|
+
</xsl:for-each>
|
9791
|
+
<xsl:copy-of select="$element_node/fo:basic-link/node()"/>
|
9792
|
+
</fo:inline>
|
9793
|
+
</xsl:otherwise>
|
9794
|
+
</xsl:choose>
|
9795
|
+
</xsl:template>
|
9796
|
+
|
9649
9797
|
<xsl:template match="*[local-name() = 'variant-title']"/> <!-- [@type = 'sub'] -->
|
9650
9798
|
<xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
|
9651
9799
|
<fo:inline padding-right="5mm"> </fo:inline>
|
@@ -1566,6 +1566,7 @@
|
|
1566
1566
|
</xsl:attribute-set>
|
1567
1567
|
|
1568
1568
|
<xsl:attribute-set name="xref-style">
|
1569
|
+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
1569
1570
|
|
1570
1571
|
<xsl:attribute name="color">blue</xsl:attribute>
|
1571
1572
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
@@ -3559,9 +3560,13 @@
|
|
3559
3560
|
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
3560
3561
|
</xsl:if>
|
3561
3562
|
|
3562
|
-
<
|
3563
|
-
<xsl:
|
3564
|
-
|
3563
|
+
<xsl:call-template name="insert_basic_link">
|
3564
|
+
<xsl:with-param name="element">
|
3565
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
3566
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
3567
|
+
</fo:basic-link>
|
3568
|
+
</xsl:with-param>
|
3569
|
+
</xsl:call-template>
|
3565
3570
|
</fo:inline>
|
3566
3571
|
</xsl:variable>
|
3567
3572
|
|
@@ -3894,8 +3899,10 @@
|
|
3894
3899
|
<xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p' and @keep-with-next = 'true']/node()"/>
|
3895
3900
|
<xsl:text> </xsl:text>
|
3896
3901
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
3897
|
-
<xsl:text
|
3898
|
-
|
3902
|
+
<xsl:if test="*[local-name()='dd']/node()[normalize-space() != ''][1][self::text()]">
|
3903
|
+
<xsl:text> </xsl:text>
|
3904
|
+
</xsl:if>
|
3905
|
+
<xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
|
3899
3906
|
</fo:block>
|
3900
3907
|
|
3901
3908
|
</xsl:when> <!-- END: only one component -->
|
@@ -4388,8 +4395,18 @@
|
|
4388
4395
|
</xsl:if>
|
4389
4396
|
</xsl:template>
|
4390
4397
|
|
4391
|
-
<xsl:template match="*[local-name()='dd']/*
|
4392
|
-
<
|
4398
|
+
<xsl:template match="*[local-name()='dd']/*" mode="inline">
|
4399
|
+
<xsl:variable name="is_inline_element_after_where">
|
4400
|
+
<xsl:if test="(local-name() = 'p') and not(preceding-sibling::node()[normalize-space() != ''])">true</xsl:if>
|
4401
|
+
</xsl:variable>
|
4402
|
+
<xsl:choose>
|
4403
|
+
<xsl:when test="$is_inline_element_after_where = 'true'">
|
4404
|
+
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
4405
|
+
</xsl:when>
|
4406
|
+
<xsl:otherwise>
|
4407
|
+
<xsl:apply-templates select="."/>
|
4408
|
+
</xsl:otherwise>
|
4409
|
+
</xsl:choose>
|
4393
4410
|
</xsl:template>
|
4394
4411
|
|
4395
4412
|
<!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
|
@@ -5889,6 +5906,79 @@
|
|
5889
5906
|
<xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
|
5890
5907
|
</xsl:template>
|
5891
5908
|
|
5909
|
+
<!-- special case for:
|
5910
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
5911
|
+
<mstyle displaystyle="true">
|
5912
|
+
<msup>
|
5913
|
+
<mi color="#00000000">C</mi>
|
5914
|
+
<mtext>R</mtext>
|
5915
|
+
</msup>
|
5916
|
+
<msubsup>
|
5917
|
+
<mtext>C</mtext>
|
5918
|
+
<mi>n</mi>
|
5919
|
+
<mi>k</mi>
|
5920
|
+
</msubsup>
|
5921
|
+
</mstyle>
|
5922
|
+
</math>
|
5923
|
+
-->
|
5924
|
+
<xsl:template match="mathml:msup/mathml:mi[. = '' or . = ''][not(preceding-sibling::*)][following-sibling::mathml:mtext]" mode="mathml">
|
5925
|
+
<xsl:copy>
|
5926
|
+
<xsl:copy-of select="@*"/>
|
5927
|
+
<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"/>
|
5928
|
+
<xsl:if test="string-length($next_mtext) != ''">
|
5929
|
+
<xsl:attribute name="color">#00000000</xsl:attribute>
|
5930
|
+
</xsl:if>
|
5931
|
+
<xsl:apply-templates/>
|
5932
|
+
<xsl:value-of select="$next_mtext"/>
|
5933
|
+
</xsl:copy>
|
5934
|
+
</xsl:template>
|
5935
|
+
|
5936
|
+
<!-- special case for:
|
5937
|
+
<msup>
|
5938
|
+
<mtext/>
|
5939
|
+
<mn>1</mn>
|
5940
|
+
</msup>
|
5941
|
+
convert to (add mspace after mtext and enclose them into mrow):
|
5942
|
+
<msup>
|
5943
|
+
<mrow>
|
5944
|
+
<mtext/>
|
5945
|
+
<mspace height="1.47ex"/>
|
5946
|
+
</mrow>
|
5947
|
+
<mn>1</mn>
|
5948
|
+
</msup>
|
5949
|
+
-->
|
5950
|
+
<xsl:template match="mathml:msup/mathml:mtext[not(preceding-sibling::*)]" mode="mathml">
|
5951
|
+
<mathml:mrow>
|
5952
|
+
<xsl:copy-of select="."/>
|
5953
|
+
<mathml:mspace height="1.47ex"/>
|
5954
|
+
</mathml:mrow>
|
5955
|
+
</xsl:template>
|
5956
|
+
|
5957
|
+
<!-- add space around vertical line -->
|
5958
|
+
<xsl:template match="mathml:mo[normalize-space(text()) = '|']" mode="mathml">
|
5959
|
+
<xsl:copy>
|
5960
|
+
<xsl:apply-templates select="@*" mode="mathml"/>
|
5961
|
+
<xsl:if test="not(@lspace)">
|
5962
|
+
<xsl:attribute name="lspace">0.4em</xsl:attribute>
|
5963
|
+
</xsl:if>
|
5964
|
+
<xsl:if test="not(@rspace)">
|
5965
|
+
<xsl:attribute name="rspace">0.4em</xsl:attribute>
|
5966
|
+
</xsl:if>
|
5967
|
+
<xsl:apply-templates mode="mathml"/>
|
5968
|
+
</xsl:copy>
|
5969
|
+
</xsl:template>
|
5970
|
+
|
5971
|
+
<!-- decrease fontsize for 'Circled Times' char -->
|
5972
|
+
<xsl:template match="mathml:mo[normalize-space(text()) = '⊗']" mode="mathml">
|
5973
|
+
<xsl:copy>
|
5974
|
+
<xsl:apply-templates select="@*" mode="mathml"/>
|
5975
|
+
<xsl:if test="not(@fontsize)">
|
5976
|
+
<xsl:attribute name="fontsize">55%</xsl:attribute>
|
5977
|
+
</xsl:if>
|
5978
|
+
<xsl:apply-templates mode="mathml"/>
|
5979
|
+
</xsl:copy>
|
5980
|
+
</xsl:template>
|
5981
|
+
|
5892
5982
|
<!-- Examples:
|
5893
5983
|
<stem type="AsciiMath">x = 1</stem>
|
5894
5984
|
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
@@ -5946,19 +6036,23 @@
|
|
5946
6036
|
<xsl:apply-templates/>
|
5947
6037
|
</xsl:when>
|
5948
6038
|
<xsl:otherwise>
|
5949
|
-
<
|
5950
|
-
<xsl:
|
5951
|
-
<
|
5952
|
-
<xsl:
|
5953
|
-
<xsl:
|
5954
|
-
|
5955
|
-
|
5956
|
-
|
5957
|
-
|
5958
|
-
|
5959
|
-
|
5960
|
-
|
5961
|
-
|
6039
|
+
<xsl:call-template name="insert_basic_link">
|
6040
|
+
<xsl:with-param name="element">
|
6041
|
+
<fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
|
6042
|
+
<xsl:choose>
|
6043
|
+
<xsl:when test="normalize-space(.) = ''">
|
6044
|
+
<xsl:call-template name="add-zero-spaces-link-java">
|
6045
|
+
<xsl:with-param name="text" select="$target_text"/>
|
6046
|
+
</xsl:call-template>
|
6047
|
+
</xsl:when>
|
6048
|
+
<xsl:otherwise>
|
6049
|
+
<!-- output text from <link>text</link> -->
|
6050
|
+
<xsl:apply-templates/>
|
6051
|
+
</xsl:otherwise>
|
6052
|
+
</xsl:choose>
|
6053
|
+
</fo:basic-link>
|
6054
|
+
</xsl:with-param>
|
6055
|
+
</xsl:call-template>
|
5962
6056
|
</xsl:otherwise>
|
5963
6057
|
</xsl:choose>
|
5964
6058
|
</fo:inline>
|
@@ -6021,12 +6115,16 @@
|
|
6021
6115
|
</xsl:template>
|
6022
6116
|
|
6023
6117
|
<xsl:template match="*[local-name() = 'xref']">
|
6024
|
-
<
|
6025
|
-
<xsl:
|
6026
|
-
<
|
6027
|
-
|
6028
|
-
|
6029
|
-
|
6118
|
+
<xsl:call-template name="insert_basic_link">
|
6119
|
+
<xsl:with-param name="element">
|
6120
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
6121
|
+
<xsl:if test="parent::*[local-name() = 'add']">
|
6122
|
+
<xsl:call-template name="append_add-style"/>
|
6123
|
+
</xsl:if>
|
6124
|
+
<xsl:apply-templates/>
|
6125
|
+
</fo:basic-link>
|
6126
|
+
</xsl:with-param>
|
6127
|
+
</xsl:call-template>
|
6030
6128
|
</xsl:template>
|
6031
6129
|
|
6032
6130
|
<!-- ====== -->
|
@@ -6409,7 +6507,7 @@
|
|
6409
6507
|
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
6410
6508
|
</xsl:when>
|
6411
6509
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
6412
|
-
<xsl:value-of select="concat('url(file
|
6510
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
6413
6511
|
</xsl:when>
|
6414
6512
|
<xsl:otherwise>
|
6415
6513
|
<xsl:value-of select="@src"/>
|
@@ -6431,7 +6529,7 @@
|
|
6431
6529
|
</xsl:when>
|
6432
6530
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
6433
6531
|
<xsl:variable name="src">
|
6434
|
-
<xsl:value-of select="concat('url(file
|
6532
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
6435
6533
|
</xsl:variable>
|
6436
6534
|
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
6437
6535
|
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
@@ -6817,15 +6915,19 @@
|
|
6817
6915
|
<xsl:param name="dest"/>
|
6818
6916
|
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
6819
6917
|
<fo:block font-size="1pt">
|
6820
|
-
<
|
6821
|
-
<
|
6822
|
-
<fo:
|
6823
|
-
|
6824
|
-
<
|
6825
|
-
|
6826
|
-
|
6827
|
-
|
6828
|
-
|
6918
|
+
<xsl:call-template name="insert_basic_link">
|
6919
|
+
<xsl:with-param name="element">
|
6920
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
6921
|
+
<fo:inline-container inline-progression-dimension="100%">
|
6922
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
6923
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
6924
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
6925
|
+
</xsl:if> -->
|
6926
|
+
<fo:block> </fo:block></fo:block-container>
|
6927
|
+
</fo:inline-container>
|
6928
|
+
</fo:basic-link>
|
6929
|
+
</xsl:with-param>
|
6930
|
+
</xsl:call-template>
|
6829
6931
|
</fo:block>
|
6830
6932
|
</fo:block-container>
|
6831
6933
|
</xsl:template>
|
@@ -8370,14 +8472,18 @@
|
|
8370
8472
|
</xsl:template>
|
8371
8473
|
|
8372
8474
|
<xsl:template match="*[local-name() = 'origin']">
|
8373
|
-
<
|
8374
|
-
<xsl:
|
8375
|
-
<
|
8376
|
-
|
8377
|
-
|
8378
|
-
|
8379
|
-
|
8380
|
-
|
8475
|
+
<xsl:call-template name="insert_basic_link">
|
8476
|
+
<xsl:with-param name="element">
|
8477
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
8478
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
8479
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
8480
|
+
</xsl:if>
|
8481
|
+
<fo:inline xsl:use-attribute-sets="origin-style">
|
8482
|
+
<xsl:apply-templates/>
|
8483
|
+
</fo:inline>
|
8484
|
+
</fo:basic-link>
|
8485
|
+
</xsl:with-param>
|
8486
|
+
</xsl:call-template>
|
8381
8487
|
</xsl:template>
|
8382
8488
|
|
8383
8489
|
<!-- not using, see https://github.com/glossarist/iev-document/issues/23 -->
|
@@ -8451,9 +8557,13 @@
|
|
8451
8557
|
<xsl:if test="../*[local-name() = 'author']">
|
8452
8558
|
<xsl:text>, </xsl:text>
|
8453
8559
|
</xsl:if>
|
8454
|
-
<
|
8455
|
-
<xsl:
|
8456
|
-
|
8560
|
+
<xsl:call-template name="insert_basic_link">
|
8561
|
+
<xsl:with-param name="element">
|
8562
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
8563
|
+
<xsl:apply-templates/>
|
8564
|
+
</fo:basic-link>
|
8565
|
+
</xsl:with-param>
|
8566
|
+
</xsl:call-template>
|
8457
8567
|
</xsl:template>
|
8458
8568
|
|
8459
8569
|
<xsl:template match="*[local-name() = 'author']">
|
@@ -8502,28 +8612,32 @@
|
|
8502
8612
|
<xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
|
8503
8613
|
<xsl:variable name="text" select="normalize-space()"/>
|
8504
8614
|
|
8505
|
-
<
|
8506
|
-
<xsl:
|
8507
|
-
<
|
8508
|
-
|
8509
|
-
|
8615
|
+
<xsl:call-template name="insert_basic_link">
|
8616
|
+
<xsl:with-param name="element">
|
8617
|
+
<fo:basic-link fox:alt-text="{@citeas}">
|
8618
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
8619
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
8620
|
+
</xsl:if>
|
8621
|
+
<xsl:if test="@type = 'inline'">
|
8510
8622
|
|
8511
|
-
|
8512
|
-
|
8623
|
+
<xsl:attribute name="color">blue</xsl:attribute>
|
8624
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
8513
8625
|
|
8514
|
-
|
8626
|
+
</xsl:if>
|
8515
8627
|
|
8516
|
-
|
8517
|
-
|
8518
|
-
|
8519
|
-
|
8520
|
-
|
8521
|
-
|
8522
|
-
|
8523
|
-
|
8628
|
+
<xsl:choose>
|
8629
|
+
<xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
|
8630
|
+
<xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
|
8631
|
+
</xsl:when>
|
8632
|
+
<xsl:otherwise>
|
8633
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
8634
|
+
</xsl:otherwise>
|
8635
|
+
</xsl:choose>
|
8524
8636
|
|
8525
|
-
|
8526
|
-
|
8637
|
+
<xsl:apply-templates/>
|
8638
|
+
</fo:basic-link>
|
8639
|
+
</xsl:with-param>
|
8640
|
+
</xsl:call-template>
|
8527
8641
|
|
8528
8642
|
</fo:inline>
|
8529
8643
|
</xsl:when>
|
@@ -8762,7 +8876,10 @@
|
|
8762
8876
|
<xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
|
8763
8877
|
|
8764
8878
|
<xsl:template name="setULLabel">
|
8765
|
-
<xsl:variable name="
|
8879
|
+
<xsl:variable name="list_level__">
|
8880
|
+
<xsl:value-of select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
|
8881
|
+
</xsl:variable>
|
8882
|
+
<xsl:variable name="list_level_" select="number($list_level__)"/>
|
8766
8883
|
<xsl:variable name="list_level">
|
8767
8884
|
<xsl:choose>
|
8768
8885
|
<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
|
@@ -8895,9 +9012,11 @@
|
|
8895
9012
|
</fo:block-container>
|
8896
9013
|
</xsl:when>
|
8897
9014
|
<xsl:otherwise>
|
8898
|
-
|
8899
|
-
|
8900
|
-
|
9015
|
+
|
9016
|
+
<fo:block>
|
9017
|
+
<xsl:apply-templates select="." mode="list"/>
|
9018
|
+
</fo:block>
|
9019
|
+
|
8901
9020
|
</xsl:otherwise>
|
8902
9021
|
</xsl:choose>
|
8903
9022
|
</xsl:template>
|
@@ -9587,24 +9706,32 @@
|
|
9587
9706
|
<xsl:for-each select="*[local-name() = 'tab']">
|
9588
9707
|
<xsl:variable name="current_id" select="generate-id()"/>
|
9589
9708
|
<fo:table-cell>
|
9590
|
-
<fo:block>
|
9591
|
-
<
|
9592
|
-
<xsl:
|
9593
|
-
<
|
9594
|
-
<xsl:
|
9595
|
-
|
9596
|
-
|
9597
|
-
|
9598
|
-
|
9709
|
+
<fo:block line-height-shift-adjustment="disregard-shifts">
|
9710
|
+
<xsl:call-template name="insert_basic_link">
|
9711
|
+
<xsl:with-param name="element">
|
9712
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
9713
|
+
<xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
|
9714
|
+
<xsl:choose>
|
9715
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
9716
|
+
<xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
|
9717
|
+
</xsl:choose>
|
9718
|
+
</xsl:for-each>
|
9719
|
+
</fo:basic-link>
|
9720
|
+
</xsl:with-param>
|
9721
|
+
</xsl:call-template>
|
9599
9722
|
</fo:block>
|
9600
9723
|
</fo:table-cell>
|
9601
9724
|
</xsl:for-each>
|
9602
9725
|
<!-- last column - for page numbers -->
|
9603
9726
|
<fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
|
9604
9727
|
<fo:block>
|
9605
|
-
<
|
9606
|
-
<
|
9607
|
-
|
9728
|
+
<xsl:call-template name="insert_basic_link">
|
9729
|
+
<xsl:with-param name="element">
|
9730
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
9731
|
+
<fo:page-number-citation ref-id="{$target}"/>
|
9732
|
+
</fo:basic-link>
|
9733
|
+
</xsl:with-param>
|
9734
|
+
</xsl:call-template>
|
9608
9735
|
</fo:block>
|
9609
9736
|
</fo:table-cell>
|
9610
9737
|
</xsl:template>
|
@@ -9646,6 +9773,27 @@
|
|
9646
9773
|
<!-- End Table of Contents (ToC) processing -->
|
9647
9774
|
<!-- =================== -->
|
9648
9775
|
|
9776
|
+
<!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
|
9777
|
+
<xsl:template name="insert_basic_link">
|
9778
|
+
<xsl:param name="element"/>
|
9779
|
+
<xsl:variable name="element_node" select="xalan:nodeset($element)"/>
|
9780
|
+
<xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
|
9781
|
+
<xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
|
9782
|
+
<xsl:choose>
|
9783
|
+
<xsl:when test="$external-destination = 'true' or $internal-destination = 'true'">
|
9784
|
+
<xsl:copy-of select="$element_node"/>
|
9785
|
+
</xsl:when>
|
9786
|
+
<xsl:otherwise>
|
9787
|
+
<fo:inline>
|
9788
|
+
<xsl:for-each select="$element_node/fo:basic-link/@*[local-name() != 'external-destination' and local-name() != 'internal-destination' and local-name() != 'alt-text']">
|
9789
|
+
<xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
|
9790
|
+
</xsl:for-each>
|
9791
|
+
<xsl:copy-of select="$element_node/fo:basic-link/node()"/>
|
9792
|
+
</fo:inline>
|
9793
|
+
</xsl:otherwise>
|
9794
|
+
</xsl:choose>
|
9795
|
+
</xsl:template>
|
9796
|
+
|
9649
9797
|
<xsl:template match="*[local-name() = 'variant-title']"/> <!-- [@type = 'sub'] -->
|
9650
9798
|
<xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
|
9651
9799
|
<fo:inline padding-right="5mm"> </fo:inline>
|
@@ -14,10 +14,24 @@ module IsoDoc
|
|
14
14
|
"[#{ordinal}]<tab/>"
|
15
15
|
end
|
16
16
|
|
17
|
-
def biblio_ref_entry_code(ordinal, _idents, _ids, _standard, _datefn,
|
17
|
+
def biblio_ref_entry_code(ordinal, _idents, _ids, _standard, _datefn,
|
18
|
+
_bib)
|
18
19
|
"[#{ordinal}]<tab/>"
|
19
20
|
end
|
20
21
|
|
22
|
+
def preface_rearrange(doc)
|
23
|
+
preface_move(doc.at(ns("//preface/abstract")),
|
24
|
+
%w(foreword executivesummary introduction clause acknowledgements), doc)
|
25
|
+
preface_move(doc.at(ns("//preface/foreword")),
|
26
|
+
%w(executivesummary introduction clause acknowledgements), doc)
|
27
|
+
preface_move(doc.at(ns("//preface/executivesummary")),
|
28
|
+
%w(introduction clause acknowledgements), doc)
|
29
|
+
preface_move(doc.at(ns("//preface/introduction")),
|
30
|
+
%w(clause acknowledgements), doc)
|
31
|
+
preface_move(doc.at(ns("//preface/acknowledgements")),
|
32
|
+
%w(), doc)
|
33
|
+
end
|
34
|
+
|
21
35
|
include Init
|
22
36
|
end
|
23
37
|
end
|
@@ -12,32 +12,32 @@ module IsoDoc
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def make_body1(body, _docxml)
|
15
|
-
body.div
|
16
|
-
div1.p
|
17
|
-
|
15
|
+
body.div class: "WordSection1" do |div1|
|
16
|
+
div1.p style: "font-size:0pt;" do |p|
|
17
|
+
p << " "
|
18
18
|
end # placeholder
|
19
19
|
end
|
20
20
|
section_break(body)
|
21
21
|
end
|
22
22
|
|
23
|
-
def make_body2(body, docxml)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
23
|
+
# def make_body2(body, docxml)
|
24
|
+
# body.div **{ class: "WordSection2" } do |div2|
|
25
|
+
# boilerplate docxml, div2
|
26
|
+
# preface_block docxml, div2
|
27
|
+
# abstract docxml, div2
|
28
|
+
# foreword docxml, div2
|
29
|
+
# introduction docxml, div2
|
30
|
+
# preface docxml, div2
|
31
|
+
# acknowledgements docxml, div2
|
32
|
+
# div2.p { |p| p << " " } # placeholder
|
33
|
+
# end
|
34
|
+
# section_break(body)
|
35
|
+
# end
|
36
36
|
|
37
37
|
def authority_cleanup(docxml)
|
38
38
|
super
|
39
39
|
docxml.xpath("//div[@class = 'boilerplate-feedback']/p").each do |p|
|
40
|
-
p["style"] =
|
40
|
+
p["style"] = "font-size:8pt;font-family:Arial;text-align:right"
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
data/lib/metanorma/iho/iho.rng
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar ns=
|
2
|
+
<grammar ns='https://www.metanorma.org/ns/iho' xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
3
|
<!--
|
4
|
+
VERSION v1.2.1
|
4
5
|
Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
|
5
6
|
we cannot have a new default namespace: we will end up with a grammar with two different
|
6
7
|
namespaces, one for isostandard and one for csand additions. And we do not want that.
|
@@ -63,13 +64,7 @@
|
|
63
64
|
</define>
|
64
65
|
<define name="iho-standard">
|
65
66
|
<element name="iho-standard">
|
66
|
-
<
|
67
|
-
<attribute name="type">
|
68
|
-
<choice>
|
69
|
-
<value>semantic</value>
|
70
|
-
<value>presentation</value>
|
71
|
-
</choice>
|
72
|
-
</attribute>
|
67
|
+
<ref name="Root-Attributes"/>
|
73
68
|
<ref name="bibdata"/>
|
74
69
|
<zeroOrMore>
|
75
70
|
<ref name="termdocsource"/>
|
@@ -17,6 +17,7 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
+
<!-- VERSION v1.2.1 -->
|
20
21
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
21
22
|
<include href="reqt.rng"/>
|
22
23
|
<include href="basicdoc.rng">
|
@@ -1349,15 +1350,19 @@
|
|
1349
1350
|
</choice>
|
1350
1351
|
</element>
|
1351
1352
|
</define>
|
1353
|
+
<define name="Root-Attributes">
|
1354
|
+
<attribute name="version"/>
|
1355
|
+
<attribute name="schema-version"/>
|
1356
|
+
<attribute name="type">
|
1357
|
+
<choice>
|
1358
|
+
<value>semantic</value>
|
1359
|
+
<value>presentation</value>
|
1360
|
+
</choice>
|
1361
|
+
</attribute>
|
1362
|
+
</define>
|
1352
1363
|
<define name="standard-document">
|
1353
1364
|
<element name="standard-document">
|
1354
|
-
<
|
1355
|
-
<attribute name="type">
|
1356
|
-
<choice>
|
1357
|
-
<value>semantic</value>
|
1358
|
-
<value>presentation</value>
|
1359
|
-
</choice>
|
1360
|
-
</attribute>
|
1365
|
+
<ref name="Root-Attributes"/>
|
1361
1366
|
<ref name="bibdata"/>
|
1362
1367
|
<optional>
|
1363
1368
|
<ref name="misccontainer"/>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|