metanorma-iho 0.2.14 → 0.2.15
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/.github/workflows/rake.yml +7 -25
- data/lib/asciidoctor/iho/isodoc.rng +23 -1
- data/lib/isodoc/iho/iho.specification.xsl +270 -90
- data/lib/isodoc/iho/iho.standard.xsl +270 -90
- data/lib/metanorma/iho/version.rb +1 -1
- data/metanorma-iho.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dd084764cc365d72d94fabf29b38e4d387b2fa8b492c59f839c623dd0e55ba30
|
|
4
|
+
data.tar.gz: 580aff5d4154790bbc800d4fed5f435b87f2decf1b85ffd4b8eaa586b7ef712f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 87c447db801103d23380fb84d05593349c46248b14665e1647ca03f0955943d76e9fcdc0a6ad7538ee65b74040ce9654c9e3808bd74eba62ab0f6375ecf7e886
|
|
7
|
+
data.tar.gz: cd2f7e8eb8993cb847f4aea6ff4b6270ff3af9e14eed4ac30bbe87d21d22e173c6e3442d8bfe82bc50d9520dd121daeb3e9616bc864976ec6970a35c5c3fac3a
|
data/.github/workflows/rake.yml
CHANGED
|
@@ -4,7 +4,7 @@ name: rake
|
|
|
4
4
|
|
|
5
5
|
on:
|
|
6
6
|
push:
|
|
7
|
-
branches: [ master, main
|
|
7
|
+
branches: [ master, main ]
|
|
8
8
|
tags: [ v* ]
|
|
9
9
|
pull_request:
|
|
10
10
|
|
|
@@ -37,35 +37,17 @@ jobs:
|
|
|
37
37
|
ruby-version: ${{ matrix.ruby }}
|
|
38
38
|
bundler-cache: true
|
|
39
39
|
|
|
40
|
-
-
|
|
41
|
-
if: matrix.os == 'ubuntu-latest'
|
|
42
|
-
uses: nick-invision/retry@v1
|
|
43
|
-
with:
|
|
44
|
-
polling_interval_seconds: 5
|
|
45
|
-
timeout_minutes: 5
|
|
46
|
-
max_attempts: 3
|
|
47
|
-
command: >
|
|
48
|
-
sudo apt-get update -y && sudo bash -c
|
|
49
|
-
"curl -L https://github.com/metanorma/plantuml-install/raw/master/ubuntu.sh | bash"
|
|
50
|
-
|
|
51
|
-
- if: matrix.os == 'macos-latest'
|
|
52
|
-
run: brew install plantuml
|
|
53
|
-
|
|
54
|
-
- if: matrix.os == 'windows-latest'
|
|
55
|
-
run: cinst -y plantuml
|
|
40
|
+
- uses: metanorma/metanorma-build-scripts/plantuml-setup-action@master
|
|
56
41
|
|
|
57
42
|
- run: bundle exec rake
|
|
58
43
|
|
|
59
44
|
tests-passed:
|
|
60
45
|
needs: rake
|
|
61
46
|
runs-on: ubuntu-latest
|
|
62
|
-
continue-on-error: true
|
|
63
47
|
steps:
|
|
64
|
-
-
|
|
65
|
-
uses: Sibz/github-status-action@v1
|
|
48
|
+
- uses: peter-evans/repository-dispatch@v1
|
|
66
49
|
with:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
sha: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
50
|
+
token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
|
|
51
|
+
repository: ${{ github.repository }}
|
|
52
|
+
event-type: notify
|
|
53
|
+
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
</attribute>
|
|
103
103
|
</optional>
|
|
104
104
|
<oneOrMore>
|
|
105
|
-
<ref name="
|
|
105
|
+
<ref name="ul_li"/>
|
|
106
106
|
</oneOrMore>
|
|
107
107
|
<zeroOrMore>
|
|
108
108
|
<ref name="note"/>
|
|
@@ -1716,4 +1716,26 @@
|
|
|
1716
1716
|
</zeroOrMore>
|
|
1717
1717
|
</element>
|
|
1718
1718
|
</define>
|
|
1719
|
+
<define name="ul_li">
|
|
1720
|
+
<element name="li">
|
|
1721
|
+
<optional>
|
|
1722
|
+
<attribute name="id">
|
|
1723
|
+
<data type="ID"/>
|
|
1724
|
+
</attribute>
|
|
1725
|
+
</optional>
|
|
1726
|
+
<optional>
|
|
1727
|
+
<attribute name="uncheckedcheckbox">
|
|
1728
|
+
<data type="boolean"/>
|
|
1729
|
+
</attribute>
|
|
1730
|
+
</optional>
|
|
1731
|
+
<optional>
|
|
1732
|
+
<attribute name="checkedcheckbox">
|
|
1733
|
+
<data type="boolean"/>
|
|
1734
|
+
</attribute>
|
|
1735
|
+
</optional>
|
|
1736
|
+
<oneOrMore>
|
|
1737
|
+
<ref name="BasicBlock"/>
|
|
1738
|
+
</oneOrMore>
|
|
1739
|
+
</element>
|
|
1740
|
+
</define>
|
|
1719
1741
|
</grammar>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
|
|
4
4
|
|
|
5
5
|
<xsl:param name="svg_images"/>
|
|
6
|
+
<xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
|
|
6
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
|
7
8
|
|
|
8
9
|
|
|
@@ -109,7 +110,9 @@
|
|
|
109
110
|
</fo:page-sequence-master>
|
|
110
111
|
</fo:layout-master-set>
|
|
111
112
|
|
|
112
|
-
<
|
|
113
|
+
<fo:declarations>
|
|
114
|
+
<xsl:call-template name="addPDFUAmeta"/>
|
|
115
|
+
</fo:declarations>
|
|
113
116
|
|
|
114
117
|
<xsl:call-template name="addBookmarks">
|
|
115
118
|
<xsl:with-param name="contents" select="$contents"/>
|
|
@@ -1224,6 +1227,7 @@
|
|
|
1224
1227
|
|
|
1225
1228
|
|
|
1226
1229
|
|
|
1230
|
+
|
|
1227
1231
|
</xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
|
|
1228
1232
|
|
|
1229
1233
|
|
|
@@ -1845,7 +1849,15 @@
|
|
|
1845
1849
|
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
|
1846
1850
|
<xsl:value-of select="@target"/>
|
|
1847
1851
|
</xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
|
|
1848
|
-
<xsl:variable name="
|
|
1852
|
+
<xsl:variable name="mathml">
|
|
1853
|
+
<xsl:for-each select="*">
|
|
1854
|
+
<xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
|
|
1855
|
+
<xsl:copy-of select="."/>
|
|
1856
|
+
</xsl:if>
|
|
1857
|
+
</xsl:for-each>
|
|
1858
|
+
</xsl:variable>
|
|
1859
|
+
|
|
1860
|
+
<xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
|
|
1849
1861
|
<xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
|
|
1850
1862
|
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
|
1851
1863
|
<xsl:param name="cols-count"/>
|
|
@@ -2806,6 +2818,10 @@
|
|
|
2806
2818
|
<fo:inline font-size="10pt" color="red" text-decoration="line-through">
|
|
2807
2819
|
<xsl:apply-templates/>
|
|
2808
2820
|
</fo:inline>
|
|
2821
|
+
</xsl:template><xsl:template match="*[local-name()='hi']">
|
|
2822
|
+
<fo:inline background-color="yellow">
|
|
2823
|
+
<xsl:apply-templates/>
|
|
2824
|
+
</fo:inline>
|
|
2809
2825
|
</xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
|
2810
2826
|
<xsl:variable name="text" select="normalize-space(.)"/>
|
|
2811
2827
|
<fo:inline font-size="75%">
|
|
@@ -3146,6 +3162,7 @@
|
|
|
3146
3162
|
<xsl:apply-templates select="." mode="mathml"/>
|
|
3147
3163
|
</xsl:variable>
|
|
3148
3164
|
<fo:instream-foreign-object fox:alt-text="Math">
|
|
3165
|
+
|
|
3149
3166
|
<!-- <xsl:copy-of select="."/> -->
|
|
3150
3167
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
|
3151
3168
|
</fo:instream-foreign-object>
|
|
@@ -3164,7 +3181,7 @@
|
|
|
3164
3181
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
|
3165
3182
|
</xsl:copy>
|
|
3166
3183
|
<mathml:mspace width="0.5ex"/>
|
|
3167
|
-
</xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
|
3184
|
+
</xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
|
3168
3185
|
<xsl:variable name="target">
|
|
3169
3186
|
<xsl:choose>
|
|
3170
3187
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
|
@@ -3198,8 +3215,6 @@
|
|
|
3198
3215
|
</xsl:otherwise>
|
|
3199
3216
|
</xsl:choose>
|
|
3200
3217
|
</fo:inline>
|
|
3201
|
-
</xsl:template><xsl:template match="*[local-name()='bookmark']">
|
|
3202
|
-
<fo:inline id="{@id}"/>
|
|
3203
3218
|
</xsl:template><xsl:template match="*[local-name()='appendix']">
|
|
3204
3219
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
|
3205
3220
|
<xsl:apply-templates select="*[local-name()='title']" mode="process"/>
|
|
@@ -3410,6 +3425,7 @@
|
|
|
3410
3425
|
<fo:block id="{@id}">
|
|
3411
3426
|
<xsl:apply-templates/>
|
|
3412
3427
|
</fo:block>
|
|
3428
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
|
3413
3429
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
|
|
3414
3430
|
<fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
|
|
3415
3431
|
<xsl:apply-templates/>
|
|
@@ -3993,10 +4009,11 @@
|
|
|
3993
4009
|
</xsl:choose>
|
|
3994
4010
|
|
|
3995
4011
|
</xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
|
|
3996
|
-
|
|
4012
|
+
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
|
3997
4013
|
<xsl:variable name="element">
|
|
3998
4014
|
block
|
|
3999
4015
|
|
|
4016
|
+
|
|
4000
4017
|
</xsl:variable>
|
|
4001
4018
|
<xsl:choose>
|
|
4002
4019
|
<xsl:when test="normalize-space($element) = 'block'">
|
|
@@ -4100,32 +4117,50 @@
|
|
|
4100
4117
|
<xsl:text>— </xsl:text>
|
|
4101
4118
|
<xsl:apply-templates/>
|
|
4102
4119
|
</xsl:template><xsl:template match="*[local-name() = 'eref']">
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4120
|
+
|
|
4121
|
+
<xsl:variable name="bibitemid">
|
|
4122
|
+
<xsl:choose>
|
|
4123
|
+
<xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
|
|
4124
|
+
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
|
|
4125
|
+
<xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
|
|
4126
|
+
</xsl:choose>
|
|
4127
|
+
</xsl:variable>
|
|
4128
|
+
|
|
4129
|
+
<xsl:choose>
|
|
4130
|
+
<xsl:when test="normalize-space($bibitemid) != ''">
|
|
4131
|
+
<fo:inline xsl:use-attribute-sets="eref-style">
|
|
4132
|
+
<xsl:if test="@type = 'footnote'">
|
|
4133
|
+
|
|
4134
|
+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
|
4135
|
+
<xsl:attribute name="font-size">80%</xsl:attribute>
|
|
4136
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
|
4137
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
|
4138
|
+
|
|
4139
|
+
|
|
4140
|
+
</xsl:if>
|
|
4141
|
+
|
|
4142
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
|
4143
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
|
4144
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
|
4145
|
+
</xsl:if>
|
|
4146
|
+
<xsl:if test="@type = 'inline'">
|
|
4147
|
+
|
|
4148
|
+
<xsl:attribute name="color">blue</xsl:attribute>
|
|
4149
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
|
4150
|
+
|
|
4151
|
+
|
|
4152
|
+
|
|
4153
|
+
</xsl:if>
|
|
4154
|
+
|
|
4155
|
+
<xsl:apply-templates/>
|
|
4156
|
+
</fo:basic-link>
|
|
4157
|
+
|
|
4158
|
+
</fo:inline>
|
|
4159
|
+
</xsl:when>
|
|
4160
|
+
<xsl:otherwise>
|
|
4161
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
|
4162
|
+
</xsl:otherwise>
|
|
4163
|
+
</xsl:choose>
|
|
4129
4164
|
</xsl:template><xsl:template match="*[local-name() = 'tab']">
|
|
4130
4165
|
<!-- zero-space char -->
|
|
4131
4166
|
<xsl:variable name="depth">
|
|
@@ -4304,6 +4339,153 @@
|
|
|
4304
4339
|
</fo:block>
|
|
4305
4340
|
</xsl:otherwise>
|
|
4306
4341
|
</xsl:choose>
|
|
4342
|
+
</xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
|
|
4343
|
+
<xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
|
|
4344
|
+
<bookmark><xsl:value-of select="@id"/></bookmark>
|
|
4345
|
+
</xsl:for-each>
|
|
4346
|
+
</xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
|
|
4347
|
+
<xsl:copy>
|
|
4348
|
+
<xsl:apply-templates select="@*|node()" mode="index_add_id"/>
|
|
4349
|
+
</xsl:copy>
|
|
4350
|
+
</xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
|
|
4351
|
+
<xsl:variable name="id">
|
|
4352
|
+
<xsl:call-template name="generateIndexXrefId"/>
|
|
4353
|
+
</xsl:variable>
|
|
4354
|
+
<xsl:copy> <!-- add id to xref -->
|
|
4355
|
+
<xsl:apply-templates select="@*" mode="index_add_id"/>
|
|
4356
|
+
<xsl:attribute name="id">
|
|
4357
|
+
<xsl:value-of select="$id"/>
|
|
4358
|
+
</xsl:attribute>
|
|
4359
|
+
<xsl:apply-templates mode="index_add_id"/>
|
|
4360
|
+
</xsl:copy>
|
|
4361
|
+
<!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
|
|
4362
|
+
<xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
|
|
4363
|
+
<xsl:if test="@to">
|
|
4364
|
+
<xsl:value-of select="$dash"/>
|
|
4365
|
+
<xsl:copy>
|
|
4366
|
+
<xsl:copy-of select="@*"/>
|
|
4367
|
+
<xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
|
|
4368
|
+
<xsl:attribute name="id">
|
|
4369
|
+
<xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
|
|
4370
|
+
</xsl:attribute>
|
|
4371
|
+
<xsl:apply-templates mode="index_add_id"/>
|
|
4372
|
+
</xsl:copy>
|
|
4373
|
+
</xsl:if>
|
|
4374
|
+
</xsl:template><xsl:template match="@*|node()" mode="index_update">
|
|
4375
|
+
<xsl:copy>
|
|
4376
|
+
<xsl:apply-templates select="@*|node()" mode="index_update"/>
|
|
4377
|
+
</xsl:copy>
|
|
4378
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
|
|
4379
|
+
<xsl:copy>
|
|
4380
|
+
<xsl:apply-templates select="@*" mode="index_update"/>
|
|
4381
|
+
<xsl:apply-templates select="node()[1]" mode="process_li_element"/>
|
|
4382
|
+
</xsl:copy>
|
|
4383
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
|
|
4384
|
+
<xsl:param name="element"/>
|
|
4385
|
+
<xsl:param name="remove" select="'false'"/>
|
|
4386
|
+
<xsl:param name="target"/>
|
|
4387
|
+
<!-- <node></node> -->
|
|
4388
|
+
<xsl:choose>
|
|
4389
|
+
<xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
|
|
4390
|
+
<!-- skip text (i.e. remove it) and process next element -->
|
|
4391
|
+
<!-- [removed_<xsl:value-of select="."/>] -->
|
|
4392
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
|
4393
|
+
<xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
|
|
4394
|
+
</xsl:apply-templates>
|
|
4395
|
+
</xsl:when>
|
|
4396
|
+
<xsl:when test="self::text()">
|
|
4397
|
+
<xsl:value-of select="."/>
|
|
4398
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
|
4399
|
+
</xsl:when>
|
|
4400
|
+
<xsl:when test="self::* and local-name(.) = 'xref'">
|
|
4401
|
+
<xsl:variable name="id" select="@id"/>
|
|
4402
|
+
<xsl:variable name="page" select="$index//item[@id = $id]"/>
|
|
4403
|
+
<xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
|
|
4404
|
+
<xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
|
|
4405
|
+
|
|
4406
|
+
<xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
|
|
4407
|
+
<xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
|
|
4408
|
+
|
|
4409
|
+
<xsl:choose>
|
|
4410
|
+
<!-- 2nd pass -->
|
|
4411
|
+
<!-- if page is equal to page for next and page is not the end of range -->
|
|
4412
|
+
<xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
|
|
4413
|
+
<!-- skip element (i.e. remove it) and remove next text ',' -->
|
|
4414
|
+
<!-- [removed_xref] -->
|
|
4415
|
+
|
|
4416
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
|
4417
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
|
4418
|
+
<xsl:with-param name="target">
|
|
4419
|
+
<xsl:choose>
|
|
4420
|
+
<xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
|
|
4421
|
+
<xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
|
|
4422
|
+
</xsl:choose>
|
|
4423
|
+
</xsl:with-param>
|
|
4424
|
+
</xsl:apply-templates>
|
|
4425
|
+
</xsl:when>
|
|
4426
|
+
|
|
4427
|
+
<xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
|
|
4428
|
+
<!-- remove xref -->
|
|
4429
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
|
4430
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
|
4431
|
+
</xsl:apply-templates>
|
|
4432
|
+
</xsl:when>
|
|
4433
|
+
|
|
4434
|
+
<xsl:otherwise>
|
|
4435
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
|
4436
|
+
<xsl:with-param name="target" select="$target"/>
|
|
4437
|
+
</xsl:apply-templates>
|
|
4438
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
|
4439
|
+
</xsl:otherwise>
|
|
4440
|
+
</xsl:choose>
|
|
4441
|
+
</xsl:when>
|
|
4442
|
+
<xsl:when test="self::* and local-name(.) = 'ul'">
|
|
4443
|
+
<!-- ul -->
|
|
4444
|
+
<xsl:apply-templates select="." mode="index_update"/>
|
|
4445
|
+
</xsl:when>
|
|
4446
|
+
<xsl:otherwise>
|
|
4447
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
|
4448
|
+
<xsl:with-param name="target" select="$target"/>
|
|
4449
|
+
</xsl:apply-templates>
|
|
4450
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
|
4451
|
+
</xsl:otherwise>
|
|
4452
|
+
</xsl:choose>
|
|
4453
|
+
</xsl:template><xsl:template match="@*|node()" mode="xref_copy">
|
|
4454
|
+
<xsl:param name="target"/>
|
|
4455
|
+
<xsl:copy>
|
|
4456
|
+
<xsl:apply-templates select="@*" mode="xref_copy"/>
|
|
4457
|
+
<xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
|
|
4458
|
+
<xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
|
|
4459
|
+
</xsl:if>
|
|
4460
|
+
<xsl:apply-templates select="node()" mode="xref_copy"/>
|
|
4461
|
+
</xsl:copy>
|
|
4462
|
+
</xsl:template><xsl:template name="generateIndexXrefId">
|
|
4463
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
|
4464
|
+
|
|
4465
|
+
<xsl:variable name="docid">
|
|
4466
|
+
<xsl:call-template name="getDocumentId"/>
|
|
4467
|
+
</xsl:variable>
|
|
4468
|
+
<xsl:variable name="item_number">
|
|
4469
|
+
<xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
|
|
4470
|
+
</xsl:variable>
|
|
4471
|
+
<xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
|
|
4472
|
+
<xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
|
|
4473
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
|
|
4474
|
+
<xsl:apply-templates/>
|
|
4475
|
+
<fo:block>
|
|
4476
|
+
<xsl:if test="following-sibling::*[local-name() = 'clause']">
|
|
4477
|
+
<fo:block> </fo:block>
|
|
4478
|
+
</xsl:if>
|
|
4479
|
+
</fo:block>
|
|
4480
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
|
|
4481
|
+
<xsl:apply-templates/>
|
|
4482
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
|
|
4483
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
|
4484
|
+
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
|
4485
|
+
<xsl:apply-templates/>
|
|
4486
|
+
</fo:block>
|
|
4487
|
+
</xsl:template><xsl:template match="*[local-name() = 'bookmark']">
|
|
4488
|
+
<fo:inline id="{@id}"/>
|
|
4307
4489
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
|
4308
4490
|
<!-- <row>
|
|
4309
4491
|
<date>05-07-2013</date>
|
|
@@ -4619,70 +4801,68 @@
|
|
|
4619
4801
|
<xsl:variable name="lang">
|
|
4620
4802
|
<xsl:call-template name="getLang"/>
|
|
4621
4803
|
</xsl:variable>
|
|
4622
|
-
<
|
|
4623
|
-
|
|
4624
|
-
<pdf:
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
<
|
|
4629
|
-
<rdf:
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
<
|
|
4633
|
-
<xsl:variable name="title">
|
|
4634
|
-
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
<xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
</xsl:for-each>
|
|
4644
|
-
</xsl:variable>
|
|
4645
|
-
<xsl:choose>
|
|
4646
|
-
<xsl:when test="normalize-space($title) != ''">
|
|
4647
|
-
<xsl:value-of select="$title"/>
|
|
4648
|
-
</xsl:when>
|
|
4649
|
-
<xsl:otherwise>
|
|
4650
|
-
<xsl:text> </xsl:text>
|
|
4651
|
-
</xsl:otherwise>
|
|
4652
|
-
</xsl:choose>
|
|
4653
|
-
</dc:title>
|
|
4654
|
-
<dc:creator>
|
|
4804
|
+
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
|
4805
|
+
<pdf:dictionary type="normal" key="ViewerPreferences">
|
|
4806
|
+
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
|
4807
|
+
</pdf:dictionary>
|
|
4808
|
+
</pdf:catalog>
|
|
4809
|
+
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
|
4810
|
+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
|
4811
|
+
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
|
4812
|
+
<!-- Dublin Core properties go here -->
|
|
4813
|
+
<dc:title>
|
|
4814
|
+
<xsl:variable name="title">
|
|
4655
4815
|
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
|
4656
4816
|
|
|
4657
|
-
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
|
4658
|
-
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
|
4659
|
-
<xsl:if test="position() != last()">; </xsl:if>
|
|
4660
|
-
</xsl:for-each>
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
4817
|
|
|
4664
|
-
</xsl:for-each>
|
|
4665
|
-
</dc:creator>
|
|
4666
|
-
<dc:description>
|
|
4667
|
-
<xsl:variable name="abstract">
|
|
4668
4818
|
|
|
4669
|
-
|
|
4819
|
+
|
|
4820
|
+
<xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
|
|
4670
4821
|
|
|
4671
4822
|
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
</
|
|
4675
|
-
<
|
|
4676
|
-
<xsl:
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4823
|
+
|
|
4824
|
+
</xsl:for-each>
|
|
4825
|
+
</xsl:variable>
|
|
4826
|
+
<xsl:choose>
|
|
4827
|
+
<xsl:when test="normalize-space($title) != ''">
|
|
4828
|
+
<xsl:value-of select="$title"/>
|
|
4829
|
+
</xsl:when>
|
|
4830
|
+
<xsl:otherwise>
|
|
4831
|
+
<xsl:text> </xsl:text>
|
|
4832
|
+
</xsl:otherwise>
|
|
4833
|
+
</xsl:choose>
|
|
4834
|
+
</dc:title>
|
|
4835
|
+
<dc:creator>
|
|
4836
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
|
4837
|
+
|
|
4838
|
+
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
|
4839
|
+
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
|
4840
|
+
<xsl:if test="position() != last()">; </xsl:if>
|
|
4841
|
+
</xsl:for-each>
|
|
4842
|
+
|
|
4843
|
+
|
|
4844
|
+
|
|
4845
|
+
</xsl:for-each>
|
|
4846
|
+
</dc:creator>
|
|
4847
|
+
<dc:description>
|
|
4848
|
+
<xsl:variable name="abstract">
|
|
4849
|
+
|
|
4850
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
|
4851
|
+
|
|
4852
|
+
|
|
4853
|
+
</xsl:variable>
|
|
4854
|
+
<xsl:value-of select="normalize-space($abstract)"/>
|
|
4855
|
+
</dc:description>
|
|
4856
|
+
<pdf:Keywords>
|
|
4857
|
+
<xsl:call-template name="insertKeywords"/>
|
|
4858
|
+
</pdf:Keywords>
|
|
4859
|
+
</rdf:Description>
|
|
4860
|
+
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
|
4861
|
+
<!-- XMP properties go here -->
|
|
4862
|
+
<xmp:CreatorTool/>
|
|
4863
|
+
</rdf:Description>
|
|
4864
|
+
</rdf:RDF>
|
|
4865
|
+
</x:xmpmeta>
|
|
4686
4866
|
</xsl:template><xsl:template name="getId">
|
|
4687
4867
|
<xsl:choose>
|
|
4688
4868
|
<xsl:when test="../@id">
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
|
|
4
4
|
|
|
5
5
|
<xsl:param name="svg_images"/>
|
|
6
|
+
<xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
|
|
6
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
|
7
8
|
|
|
8
9
|
|
|
@@ -109,7 +110,9 @@
|
|
|
109
110
|
</fo:page-sequence-master>
|
|
110
111
|
</fo:layout-master-set>
|
|
111
112
|
|
|
112
|
-
<
|
|
113
|
+
<fo:declarations>
|
|
114
|
+
<xsl:call-template name="addPDFUAmeta"/>
|
|
115
|
+
</fo:declarations>
|
|
113
116
|
|
|
114
117
|
<xsl:call-template name="addBookmarks">
|
|
115
118
|
<xsl:with-param name="contents" select="$contents"/>
|
|
@@ -1224,6 +1227,7 @@
|
|
|
1224
1227
|
|
|
1225
1228
|
|
|
1226
1229
|
|
|
1230
|
+
|
|
1227
1231
|
</xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
|
|
1228
1232
|
|
|
1229
1233
|
|
|
@@ -1845,7 +1849,15 @@
|
|
|
1845
1849
|
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
|
1846
1850
|
<xsl:value-of select="@target"/>
|
|
1847
1851
|
</xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
|
|
1848
|
-
<xsl:variable name="
|
|
1852
|
+
<xsl:variable name="mathml">
|
|
1853
|
+
<xsl:for-each select="*">
|
|
1854
|
+
<xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
|
|
1855
|
+
<xsl:copy-of select="."/>
|
|
1856
|
+
</xsl:if>
|
|
1857
|
+
</xsl:for-each>
|
|
1858
|
+
</xsl:variable>
|
|
1859
|
+
|
|
1860
|
+
<xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
|
|
1849
1861
|
<xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
|
|
1850
1862
|
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
|
1851
1863
|
<xsl:param name="cols-count"/>
|
|
@@ -2806,6 +2818,10 @@
|
|
|
2806
2818
|
<fo:inline font-size="10pt" color="red" text-decoration="line-through">
|
|
2807
2819
|
<xsl:apply-templates/>
|
|
2808
2820
|
</fo:inline>
|
|
2821
|
+
</xsl:template><xsl:template match="*[local-name()='hi']">
|
|
2822
|
+
<fo:inline background-color="yellow">
|
|
2823
|
+
<xsl:apply-templates/>
|
|
2824
|
+
</fo:inline>
|
|
2809
2825
|
</xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
|
2810
2826
|
<xsl:variable name="text" select="normalize-space(.)"/>
|
|
2811
2827
|
<fo:inline font-size="75%">
|
|
@@ -3146,6 +3162,7 @@
|
|
|
3146
3162
|
<xsl:apply-templates select="." mode="mathml"/>
|
|
3147
3163
|
</xsl:variable>
|
|
3148
3164
|
<fo:instream-foreign-object fox:alt-text="Math">
|
|
3165
|
+
|
|
3149
3166
|
<!-- <xsl:copy-of select="."/> -->
|
|
3150
3167
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
|
3151
3168
|
</fo:instream-foreign-object>
|
|
@@ -3164,7 +3181,7 @@
|
|
|
3164
3181
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
|
3165
3182
|
</xsl:copy>
|
|
3166
3183
|
<mathml:mspace width="0.5ex"/>
|
|
3167
|
-
</xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
|
3184
|
+
</xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
|
3168
3185
|
<xsl:variable name="target">
|
|
3169
3186
|
<xsl:choose>
|
|
3170
3187
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
|
@@ -3198,8 +3215,6 @@
|
|
|
3198
3215
|
</xsl:otherwise>
|
|
3199
3216
|
</xsl:choose>
|
|
3200
3217
|
</fo:inline>
|
|
3201
|
-
</xsl:template><xsl:template match="*[local-name()='bookmark']">
|
|
3202
|
-
<fo:inline id="{@id}"/>
|
|
3203
3218
|
</xsl:template><xsl:template match="*[local-name()='appendix']">
|
|
3204
3219
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
|
3205
3220
|
<xsl:apply-templates select="*[local-name()='title']" mode="process"/>
|
|
@@ -3410,6 +3425,7 @@
|
|
|
3410
3425
|
<fo:block id="{@id}">
|
|
3411
3426
|
<xsl:apply-templates/>
|
|
3412
3427
|
</fo:block>
|
|
3428
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
|
3413
3429
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
|
|
3414
3430
|
<fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
|
|
3415
3431
|
<xsl:apply-templates/>
|
|
@@ -3993,10 +4009,11 @@
|
|
|
3993
4009
|
</xsl:choose>
|
|
3994
4010
|
|
|
3995
4011
|
</xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
|
|
3996
|
-
|
|
4012
|
+
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
|
3997
4013
|
<xsl:variable name="element">
|
|
3998
4014
|
block
|
|
3999
4015
|
|
|
4016
|
+
|
|
4000
4017
|
</xsl:variable>
|
|
4001
4018
|
<xsl:choose>
|
|
4002
4019
|
<xsl:when test="normalize-space($element) = 'block'">
|
|
@@ -4100,32 +4117,50 @@
|
|
|
4100
4117
|
<xsl:text>— </xsl:text>
|
|
4101
4118
|
<xsl:apply-templates/>
|
|
4102
4119
|
</xsl:template><xsl:template match="*[local-name() = 'eref']">
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4120
|
+
|
|
4121
|
+
<xsl:variable name="bibitemid">
|
|
4122
|
+
<xsl:choose>
|
|
4123
|
+
<xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
|
|
4124
|
+
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
|
|
4125
|
+
<xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
|
|
4126
|
+
</xsl:choose>
|
|
4127
|
+
</xsl:variable>
|
|
4128
|
+
|
|
4129
|
+
<xsl:choose>
|
|
4130
|
+
<xsl:when test="normalize-space($bibitemid) != ''">
|
|
4131
|
+
<fo:inline xsl:use-attribute-sets="eref-style">
|
|
4132
|
+
<xsl:if test="@type = 'footnote'">
|
|
4133
|
+
|
|
4134
|
+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
|
4135
|
+
<xsl:attribute name="font-size">80%</xsl:attribute>
|
|
4136
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
|
4137
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
|
4138
|
+
|
|
4139
|
+
|
|
4140
|
+
</xsl:if>
|
|
4141
|
+
|
|
4142
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
|
4143
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
|
4144
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
|
4145
|
+
</xsl:if>
|
|
4146
|
+
<xsl:if test="@type = 'inline'">
|
|
4147
|
+
|
|
4148
|
+
<xsl:attribute name="color">blue</xsl:attribute>
|
|
4149
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
|
4150
|
+
|
|
4151
|
+
|
|
4152
|
+
|
|
4153
|
+
</xsl:if>
|
|
4154
|
+
|
|
4155
|
+
<xsl:apply-templates/>
|
|
4156
|
+
</fo:basic-link>
|
|
4157
|
+
|
|
4158
|
+
</fo:inline>
|
|
4159
|
+
</xsl:when>
|
|
4160
|
+
<xsl:otherwise>
|
|
4161
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
|
4162
|
+
</xsl:otherwise>
|
|
4163
|
+
</xsl:choose>
|
|
4129
4164
|
</xsl:template><xsl:template match="*[local-name() = 'tab']">
|
|
4130
4165
|
<!-- zero-space char -->
|
|
4131
4166
|
<xsl:variable name="depth">
|
|
@@ -4304,6 +4339,153 @@
|
|
|
4304
4339
|
</fo:block>
|
|
4305
4340
|
</xsl:otherwise>
|
|
4306
4341
|
</xsl:choose>
|
|
4342
|
+
</xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
|
|
4343
|
+
<xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
|
|
4344
|
+
<bookmark><xsl:value-of select="@id"/></bookmark>
|
|
4345
|
+
</xsl:for-each>
|
|
4346
|
+
</xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
|
|
4347
|
+
<xsl:copy>
|
|
4348
|
+
<xsl:apply-templates select="@*|node()" mode="index_add_id"/>
|
|
4349
|
+
</xsl:copy>
|
|
4350
|
+
</xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
|
|
4351
|
+
<xsl:variable name="id">
|
|
4352
|
+
<xsl:call-template name="generateIndexXrefId"/>
|
|
4353
|
+
</xsl:variable>
|
|
4354
|
+
<xsl:copy> <!-- add id to xref -->
|
|
4355
|
+
<xsl:apply-templates select="@*" mode="index_add_id"/>
|
|
4356
|
+
<xsl:attribute name="id">
|
|
4357
|
+
<xsl:value-of select="$id"/>
|
|
4358
|
+
</xsl:attribute>
|
|
4359
|
+
<xsl:apply-templates mode="index_add_id"/>
|
|
4360
|
+
</xsl:copy>
|
|
4361
|
+
<!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
|
|
4362
|
+
<xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
|
|
4363
|
+
<xsl:if test="@to">
|
|
4364
|
+
<xsl:value-of select="$dash"/>
|
|
4365
|
+
<xsl:copy>
|
|
4366
|
+
<xsl:copy-of select="@*"/>
|
|
4367
|
+
<xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
|
|
4368
|
+
<xsl:attribute name="id">
|
|
4369
|
+
<xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
|
|
4370
|
+
</xsl:attribute>
|
|
4371
|
+
<xsl:apply-templates mode="index_add_id"/>
|
|
4372
|
+
</xsl:copy>
|
|
4373
|
+
</xsl:if>
|
|
4374
|
+
</xsl:template><xsl:template match="@*|node()" mode="index_update">
|
|
4375
|
+
<xsl:copy>
|
|
4376
|
+
<xsl:apply-templates select="@*|node()" mode="index_update"/>
|
|
4377
|
+
</xsl:copy>
|
|
4378
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
|
|
4379
|
+
<xsl:copy>
|
|
4380
|
+
<xsl:apply-templates select="@*" mode="index_update"/>
|
|
4381
|
+
<xsl:apply-templates select="node()[1]" mode="process_li_element"/>
|
|
4382
|
+
</xsl:copy>
|
|
4383
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
|
|
4384
|
+
<xsl:param name="element"/>
|
|
4385
|
+
<xsl:param name="remove" select="'false'"/>
|
|
4386
|
+
<xsl:param name="target"/>
|
|
4387
|
+
<!-- <node></node> -->
|
|
4388
|
+
<xsl:choose>
|
|
4389
|
+
<xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
|
|
4390
|
+
<!-- skip text (i.e. remove it) and process next element -->
|
|
4391
|
+
<!-- [removed_<xsl:value-of select="."/>] -->
|
|
4392
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
|
4393
|
+
<xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
|
|
4394
|
+
</xsl:apply-templates>
|
|
4395
|
+
</xsl:when>
|
|
4396
|
+
<xsl:when test="self::text()">
|
|
4397
|
+
<xsl:value-of select="."/>
|
|
4398
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
|
4399
|
+
</xsl:when>
|
|
4400
|
+
<xsl:when test="self::* and local-name(.) = 'xref'">
|
|
4401
|
+
<xsl:variable name="id" select="@id"/>
|
|
4402
|
+
<xsl:variable name="page" select="$index//item[@id = $id]"/>
|
|
4403
|
+
<xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
|
|
4404
|
+
<xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
|
|
4405
|
+
|
|
4406
|
+
<xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
|
|
4407
|
+
<xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
|
|
4408
|
+
|
|
4409
|
+
<xsl:choose>
|
|
4410
|
+
<!-- 2nd pass -->
|
|
4411
|
+
<!-- if page is equal to page for next and page is not the end of range -->
|
|
4412
|
+
<xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
|
|
4413
|
+
<!-- skip element (i.e. remove it) and remove next text ',' -->
|
|
4414
|
+
<!-- [removed_xref] -->
|
|
4415
|
+
|
|
4416
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
|
4417
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
|
4418
|
+
<xsl:with-param name="target">
|
|
4419
|
+
<xsl:choose>
|
|
4420
|
+
<xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
|
|
4421
|
+
<xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
|
|
4422
|
+
</xsl:choose>
|
|
4423
|
+
</xsl:with-param>
|
|
4424
|
+
</xsl:apply-templates>
|
|
4425
|
+
</xsl:when>
|
|
4426
|
+
|
|
4427
|
+
<xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
|
|
4428
|
+
<!-- remove xref -->
|
|
4429
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
|
4430
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
|
4431
|
+
</xsl:apply-templates>
|
|
4432
|
+
</xsl:when>
|
|
4433
|
+
|
|
4434
|
+
<xsl:otherwise>
|
|
4435
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
|
4436
|
+
<xsl:with-param name="target" select="$target"/>
|
|
4437
|
+
</xsl:apply-templates>
|
|
4438
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
|
4439
|
+
</xsl:otherwise>
|
|
4440
|
+
</xsl:choose>
|
|
4441
|
+
</xsl:when>
|
|
4442
|
+
<xsl:when test="self::* and local-name(.) = 'ul'">
|
|
4443
|
+
<!-- ul -->
|
|
4444
|
+
<xsl:apply-templates select="." mode="index_update"/>
|
|
4445
|
+
</xsl:when>
|
|
4446
|
+
<xsl:otherwise>
|
|
4447
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
|
4448
|
+
<xsl:with-param name="target" select="$target"/>
|
|
4449
|
+
</xsl:apply-templates>
|
|
4450
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
|
4451
|
+
</xsl:otherwise>
|
|
4452
|
+
</xsl:choose>
|
|
4453
|
+
</xsl:template><xsl:template match="@*|node()" mode="xref_copy">
|
|
4454
|
+
<xsl:param name="target"/>
|
|
4455
|
+
<xsl:copy>
|
|
4456
|
+
<xsl:apply-templates select="@*" mode="xref_copy"/>
|
|
4457
|
+
<xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
|
|
4458
|
+
<xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
|
|
4459
|
+
</xsl:if>
|
|
4460
|
+
<xsl:apply-templates select="node()" mode="xref_copy"/>
|
|
4461
|
+
</xsl:copy>
|
|
4462
|
+
</xsl:template><xsl:template name="generateIndexXrefId">
|
|
4463
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
|
4464
|
+
|
|
4465
|
+
<xsl:variable name="docid">
|
|
4466
|
+
<xsl:call-template name="getDocumentId"/>
|
|
4467
|
+
</xsl:variable>
|
|
4468
|
+
<xsl:variable name="item_number">
|
|
4469
|
+
<xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
|
|
4470
|
+
</xsl:variable>
|
|
4471
|
+
<xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
|
|
4472
|
+
<xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
|
|
4473
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
|
|
4474
|
+
<xsl:apply-templates/>
|
|
4475
|
+
<fo:block>
|
|
4476
|
+
<xsl:if test="following-sibling::*[local-name() = 'clause']">
|
|
4477
|
+
<fo:block> </fo:block>
|
|
4478
|
+
</xsl:if>
|
|
4479
|
+
</fo:block>
|
|
4480
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
|
|
4481
|
+
<xsl:apply-templates/>
|
|
4482
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
|
|
4483
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
|
4484
|
+
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
|
4485
|
+
<xsl:apply-templates/>
|
|
4486
|
+
</fo:block>
|
|
4487
|
+
</xsl:template><xsl:template match="*[local-name() = 'bookmark']">
|
|
4488
|
+
<fo:inline id="{@id}"/>
|
|
4307
4489
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
|
4308
4490
|
<!-- <row>
|
|
4309
4491
|
<date>05-07-2013</date>
|
|
@@ -4619,70 +4801,68 @@
|
|
|
4619
4801
|
<xsl:variable name="lang">
|
|
4620
4802
|
<xsl:call-template name="getLang"/>
|
|
4621
4803
|
</xsl:variable>
|
|
4622
|
-
<
|
|
4623
|
-
|
|
4624
|
-
<pdf:
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
<
|
|
4629
|
-
<rdf:
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
<
|
|
4633
|
-
<xsl:variable name="title">
|
|
4634
|
-
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
<xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
</xsl:for-each>
|
|
4644
|
-
</xsl:variable>
|
|
4645
|
-
<xsl:choose>
|
|
4646
|
-
<xsl:when test="normalize-space($title) != ''">
|
|
4647
|
-
<xsl:value-of select="$title"/>
|
|
4648
|
-
</xsl:when>
|
|
4649
|
-
<xsl:otherwise>
|
|
4650
|
-
<xsl:text> </xsl:text>
|
|
4651
|
-
</xsl:otherwise>
|
|
4652
|
-
</xsl:choose>
|
|
4653
|
-
</dc:title>
|
|
4654
|
-
<dc:creator>
|
|
4804
|
+
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
|
4805
|
+
<pdf:dictionary type="normal" key="ViewerPreferences">
|
|
4806
|
+
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
|
4807
|
+
</pdf:dictionary>
|
|
4808
|
+
</pdf:catalog>
|
|
4809
|
+
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
|
4810
|
+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
|
4811
|
+
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
|
4812
|
+
<!-- Dublin Core properties go here -->
|
|
4813
|
+
<dc:title>
|
|
4814
|
+
<xsl:variable name="title">
|
|
4655
4815
|
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
|
4656
4816
|
|
|
4657
|
-
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
|
4658
|
-
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
|
4659
|
-
<xsl:if test="position() != last()">; </xsl:if>
|
|
4660
|
-
</xsl:for-each>
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
4817
|
|
|
4664
|
-
</xsl:for-each>
|
|
4665
|
-
</dc:creator>
|
|
4666
|
-
<dc:description>
|
|
4667
|
-
<xsl:variable name="abstract">
|
|
4668
4818
|
|
|
4669
|
-
|
|
4819
|
+
|
|
4820
|
+
<xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
|
|
4670
4821
|
|
|
4671
4822
|
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
</
|
|
4675
|
-
<
|
|
4676
|
-
<xsl:
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4823
|
+
|
|
4824
|
+
</xsl:for-each>
|
|
4825
|
+
</xsl:variable>
|
|
4826
|
+
<xsl:choose>
|
|
4827
|
+
<xsl:when test="normalize-space($title) != ''">
|
|
4828
|
+
<xsl:value-of select="$title"/>
|
|
4829
|
+
</xsl:when>
|
|
4830
|
+
<xsl:otherwise>
|
|
4831
|
+
<xsl:text> </xsl:text>
|
|
4832
|
+
</xsl:otherwise>
|
|
4833
|
+
</xsl:choose>
|
|
4834
|
+
</dc:title>
|
|
4835
|
+
<dc:creator>
|
|
4836
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
|
4837
|
+
|
|
4838
|
+
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
|
4839
|
+
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
|
4840
|
+
<xsl:if test="position() != last()">; </xsl:if>
|
|
4841
|
+
</xsl:for-each>
|
|
4842
|
+
|
|
4843
|
+
|
|
4844
|
+
|
|
4845
|
+
</xsl:for-each>
|
|
4846
|
+
</dc:creator>
|
|
4847
|
+
<dc:description>
|
|
4848
|
+
<xsl:variable name="abstract">
|
|
4849
|
+
|
|
4850
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
|
4851
|
+
|
|
4852
|
+
|
|
4853
|
+
</xsl:variable>
|
|
4854
|
+
<xsl:value-of select="normalize-space($abstract)"/>
|
|
4855
|
+
</dc:description>
|
|
4856
|
+
<pdf:Keywords>
|
|
4857
|
+
<xsl:call-template name="insertKeywords"/>
|
|
4858
|
+
</pdf:Keywords>
|
|
4859
|
+
</rdf:Description>
|
|
4860
|
+
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
|
4861
|
+
<!-- XMP properties go here -->
|
|
4862
|
+
<xmp:CreatorTool/>
|
|
4863
|
+
</rdf:Description>
|
|
4864
|
+
</rdf:RDF>
|
|
4865
|
+
</x:xmpmeta>
|
|
4686
4866
|
</xsl:template><xsl:template name="getId">
|
|
4687
4867
|
<xsl:choose>
|
|
4688
4868
|
<xsl:when test="../@id">
|
data/metanorma-iho.gemspec
CHANGED
|
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
|
34
34
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
|
35
35
|
spec.add_development_dependency "guard", "~> 2.14"
|
|
36
36
|
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
|
37
|
-
spec.add_development_dependency "rake", "~>
|
|
37
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
|
38
38
|
spec.add_development_dependency "rspec", "~> 3.6"
|
|
39
39
|
spec.add_development_dependency "rubocop", "= 0.54.0"
|
|
40
40
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
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.2.
|
|
4
|
+
version: 0.2.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-03-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: htmlentities
|
|
@@ -114,14 +114,14 @@ dependencies:
|
|
|
114
114
|
requirements:
|
|
115
115
|
- - "~>"
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: '
|
|
117
|
+
version: '13.0'
|
|
118
118
|
type: :development
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
122
|
- - "~>"
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: '
|
|
124
|
+
version: '13.0'
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
126
|
name: rspec
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|