metanorma-ribose 2.4.1 → 2.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ribose/ribose.standard.xsl +110 -15
- data/lib/metanorma/ribose/biblio.rng +28 -25
- data/lib/metanorma/ribose/version.rb +1 -1
- data/metanorma-ribose.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: fc2ec5eeef14d9e06ebd9eca89316b6063d00f6f777d68b60df5d4908efc182e
|
4
|
+
data.tar.gz: 02bede05c476fea899b62630855f888dbf1abc7680ca1b7d9b2cecf1b4ab3f0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0de437c7729d1d4b95faaedc1e7f036b9902f77af20c464051bf957fd80f9c03a4948dde957d5d57fae095742c38bdd789a4cc11687488ffc95d3dfb85d7698
|
7
|
+
data.tar.gz: 10ba2c72751a3c91a9d9451b364a76690ddfe70ad10b197a81bb2d9f27f57d760224b4c2e7dcec86fac63741d8171dcc9d7dc50e24737ba140f51dc80c2962d7
|
@@ -1216,6 +1216,8 @@
|
|
1216
1216
|
<xsl:param name="svg_images"/> <!-- svg images array -->
|
1217
1217
|
<xsl:variable name="images" select="document($svg_images)"/>
|
1218
1218
|
<xsl:param name="basepath"/> <!-- base path for images -->
|
1219
|
+
<xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
|
1220
|
+
<xsl:param name="inputxml_filename"/> <!-- input xml file name -->
|
1219
1221
|
<xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
|
1220
1222
|
<xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
|
1221
1223
|
<xsl:param name="add_math_as_text">true</xsl:param> <!-- add math in text behind svg formula, to copy-paste formula from PDF as text -->
|
@@ -1268,6 +1270,20 @@
|
|
1268
1270
|
<xsl:call-template name="getLang"/>
|
1269
1271
|
</xsl:variable>
|
1270
1272
|
|
1273
|
+
<xsl:variable name="inputxml_filename_prefix">
|
1274
|
+
<xsl:choose>
|
1275
|
+
<xsl:when test="contains($inputxml_filename, '.presentation.xml')">
|
1276
|
+
<xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
|
1277
|
+
</xsl:when>
|
1278
|
+
<xsl:when test="contains($inputxml_filename, '.xml')">
|
1279
|
+
<xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
|
1280
|
+
</xsl:when>
|
1281
|
+
<xsl:otherwise>
|
1282
|
+
<xsl:value-of select="$inputxml_filename"/>
|
1283
|
+
</xsl:otherwise>
|
1284
|
+
</xsl:choose>
|
1285
|
+
</xsl:variable>
|
1286
|
+
|
1271
1287
|
<!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
|
1272
1288
|
You can put such conditions by using xslt construction `xsl:if test="..."` or <xsl:choose><xsl:when test=""></xsl:when><xsl:otherwiste></xsl:otherwiste></xsl:choose>,
|
1273
1289
|
BUT DON'T put any another conditions together with $namespace = '...' (such conditions will be ignored). For another conditions, please use nested xsl:if or xsl:choose -->
|
@@ -1753,6 +1769,10 @@
|
|
1753
1769
|
|
1754
1770
|
</xsl:attribute-set>
|
1755
1771
|
|
1772
|
+
<xsl:template name="refine_termexample-style">
|
1773
|
+
|
1774
|
+
</xsl:template>
|
1775
|
+
|
1756
1776
|
<xsl:attribute-set name="example-style">
|
1757
1777
|
|
1758
1778
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
@@ -2231,6 +2251,10 @@
|
|
2231
2251
|
|
2232
2252
|
</xsl:attribute-set>
|
2233
2253
|
|
2254
|
+
<xsl:template name="refine_figure-block-style">
|
2255
|
+
|
2256
|
+
</xsl:template>
|
2257
|
+
|
2234
2258
|
<xsl:attribute-set name="figure-style">
|
2235
2259
|
<!-- background for image -->
|
2236
2260
|
<xsl:attribute name="background-color">rgb(236,242,246)</xsl:attribute>
|
@@ -2928,6 +2952,36 @@
|
|
2928
2952
|
</xsl:for-each>
|
2929
2953
|
</xsl:template>
|
2930
2954
|
|
2955
|
+
<xsl:template name="processMainSectionsDefault_flatxml">
|
2956
|
+
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
|
2957
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2958
|
+
<xsl:variable name="flatxml">
|
2959
|
+
<xsl:apply-templates select="." mode="flatxml"/>
|
2960
|
+
</xsl:variable>
|
2961
|
+
<!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
|
2962
|
+
<xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
|
2963
|
+
|
2964
|
+
</xsl:for-each>
|
2965
|
+
|
2966
|
+
<xsl:for-each select="/*/*[local-name()='annex']">
|
2967
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2968
|
+
<xsl:variable name="flatxml">
|
2969
|
+
<xsl:apply-templates select="." mode="flatxml"/>
|
2970
|
+
</xsl:variable>
|
2971
|
+
<!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
|
2972
|
+
<xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
|
2973
|
+
</xsl:for-each>
|
2974
|
+
|
2975
|
+
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
2976
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2977
|
+
<xsl:variable name="flatxml">
|
2978
|
+
<xsl:apply-templates select="." mode="flatxml"/>
|
2979
|
+
</xsl:variable>
|
2980
|
+
<!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
|
2981
|
+
<xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
|
2982
|
+
</xsl:for-each>
|
2983
|
+
</xsl:template>
|
2984
|
+
|
2931
2985
|
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
2932
2986
|
<xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
|
2933
2987
|
<xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
|
@@ -3158,7 +3212,7 @@
|
|
3158
3212
|
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
|
3159
3213
|
|
3160
3214
|
<xsl:variable name="colwidths">
|
3161
|
-
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
3215
|
+
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
|
3162
3216
|
<xsl:call-template name="calculate-column-widths">
|
3163
3217
|
<xsl:with-param name="cols-count" select="$cols-count"/>
|
3164
3218
|
<xsl:with-param name="table" select="$simple-table"/>
|
@@ -3270,6 +3324,11 @@
|
|
3270
3324
|
<fo:table-column column-width="{@width}"/>
|
3271
3325
|
</xsl:for-each>
|
3272
3326
|
</xsl:when>
|
3327
|
+
<xsl:when test="@class = 'dl'">
|
3328
|
+
<xsl:for-each select=".//*[local-name()='tr'][1]/*">
|
3329
|
+
<fo:table-column column-width="{@width}"/>
|
3330
|
+
</xsl:for-each>
|
3331
|
+
</xsl:when>
|
3273
3332
|
<xsl:otherwise>
|
3274
3333
|
<xsl:call-template name="insertTableColumnWidth">
|
3275
3334
|
<xsl:with-param name="colwidths" select="$colwidths"/>
|
@@ -4545,6 +4604,7 @@
|
|
4545
4604
|
<!-- ===================== -->
|
4546
4605
|
<!-- Definition List -->
|
4547
4606
|
<!-- ===================== -->
|
4607
|
+
|
4548
4608
|
<xsl:template match="*[local-name()='dl']">
|
4549
4609
|
<xsl:variable name="isAdded" select="@added"/>
|
4550
4610
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -4757,10 +4817,21 @@
|
|
4757
4817
|
</xsl:variable>
|
4758
4818
|
|
4759
4819
|
<xsl:variable name="colwidths">
|
4760
|
-
<xsl:
|
4761
|
-
|
4762
|
-
<xsl:
|
4763
|
-
|
4820
|
+
<xsl:choose>
|
4821
|
+
<!-- dl from table[@class='dl'] -->
|
4822
|
+
<xsl:when test="*[local-name() = 'colgroup']">
|
4823
|
+
<autolayout/>
|
4824
|
+
<xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
|
4825
|
+
<column><xsl:value-of select="translate(@width,'%m','')"/></column>
|
4826
|
+
</xsl:for-each>
|
4827
|
+
</xsl:when>
|
4828
|
+
<xsl:otherwise>
|
4829
|
+
<xsl:call-template name="calculate-column-widths">
|
4830
|
+
<xsl:with-param name="cols-count" select="2"/>
|
4831
|
+
<xsl:with-param name="table" select="$simple-table"/>
|
4832
|
+
</xsl:call-template>
|
4833
|
+
</xsl:otherwise>
|
4834
|
+
</xsl:choose>
|
4764
4835
|
</xsl:variable>
|
4765
4836
|
|
4766
4837
|
<!-- <xsl:text disable-output-escaping="yes"><!- -</xsl:text>
|
@@ -5009,13 +5080,13 @@
|
|
5009
5080
|
<tr>
|
5010
5081
|
<td>
|
5011
5082
|
<xsl:attribute name="id">
|
5012
|
-
<xsl:value-of select="concat($id,'
|
5083
|
+
<xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
|
5013
5084
|
</xsl:attribute>
|
5014
5085
|
<xsl:apply-templates/>
|
5015
5086
|
</td>
|
5016
5087
|
<td>
|
5017
5088
|
<xsl:attribute name="id">
|
5018
|
-
<xsl:value-of select="concat($id,'
|
5089
|
+
<xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
|
5019
5090
|
</xsl:attribute>
|
5020
5091
|
|
5021
5092
|
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
|
@@ -5634,6 +5705,10 @@
|
|
5634
5705
|
<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
|
5635
5706
|
</xsl:template>
|
5636
5707
|
|
5708
|
+
<xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
|
5709
|
+
<xsl:value-of select="."/>
|
5710
|
+
</xsl:template>
|
5711
|
+
|
5637
5712
|
<!-- ========================= -->
|
5638
5713
|
<!-- END Rich text formatting -->
|
5639
5714
|
<!-- ========================= -->
|
@@ -6264,7 +6339,7 @@
|
|
6264
6339
|
</xsl:choose>
|
6265
6340
|
</xsl:variable>
|
6266
6341
|
<xsl:attribute name="id">
|
6267
|
-
<xsl:value-of select="concat($id,'
|
6342
|
+
<xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
|
6268
6343
|
</xsl:attribute>
|
6269
6344
|
|
6270
6345
|
<xsl:for-each select="*[local-name() = 'p']">
|
@@ -6272,7 +6347,7 @@
|
|
6272
6347
|
<xsl:copy-of select="@*"/>
|
6273
6348
|
<xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
|
6274
6349
|
<xsl:attribute name="id">
|
6275
|
-
<xsl:value-of select="concat($id,'
|
6350
|
+
<xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
|
6276
6351
|
</xsl:attribute>
|
6277
6352
|
|
6278
6353
|
<!-- <xsl:copy-of select="node()" /> -->
|
@@ -6336,7 +6411,7 @@
|
|
6336
6411
|
<xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
|
6337
6412
|
<xsl:copy>
|
6338
6413
|
<xsl:attribute name="id">
|
6339
|
-
<xsl:value-of select="concat($id,'
|
6414
|
+
<xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
|
6340
6415
|
</xsl:attribute>
|
6341
6416
|
<xsl:copy-of select="node()"/>
|
6342
6417
|
</xsl:copy>
|
@@ -6863,6 +6938,12 @@
|
|
6863
6938
|
<xsl:when test="@updatetype = 'true'">
|
6864
6939
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
6865
6940
|
</xsl:when>
|
6941
|
+
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
6942
|
+
<!-- link to the PDF attachment -->
|
6943
|
+
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
6944
|
+
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
6945
|
+
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
6946
|
+
</xsl:when>
|
6866
6947
|
<xsl:otherwise>
|
6867
6948
|
<xsl:value-of select="normalize-space(@target)"/>
|
6868
6949
|
</xsl:otherwise>
|
@@ -7272,6 +7353,7 @@
|
|
7272
7353
|
<xsl:variable name="isAdded" select="@added"/>
|
7273
7354
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
7274
7355
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
|
7356
|
+
<xsl:call-template name="refine_figure-block-style"/>
|
7275
7357
|
|
7276
7358
|
<xsl:call-template name="setTrackChangesStyles">
|
7277
7359
|
<xsl:with-param name="isAdded" select="$isAdded"/>
|
@@ -9145,7 +9227,7 @@
|
|
9145
9227
|
<!-- ====== -->
|
9146
9228
|
<xsl:template match="*[local-name() = 'termexample']">
|
9147
9229
|
<fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
|
9148
|
-
|
9230
|
+
<xsl:call-template name="refine_termexample-style"/>
|
9149
9231
|
<xsl:call-template name="setBlockSpanAll"/>
|
9150
9232
|
|
9151
9233
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
@@ -11631,10 +11713,10 @@
|
|
11631
11713
|
|
11632
11714
|
<xsl:template name="addPDFUAmeta">
|
11633
11715
|
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
11634
|
-
|
11635
|
-
|
11636
|
-
|
11637
|
-
|
11716
|
+
<pdf:dictionary type="normal" key="ViewerPreferences">
|
11717
|
+
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
11718
|
+
</pdf:dictionary>
|
11719
|
+
</pdf:catalog>
|
11638
11720
|
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
11639
11721
|
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
11640
11722
|
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
@@ -11686,6 +11768,19 @@
|
|
11686
11768
|
</rdf:Description>
|
11687
11769
|
</rdf:RDF>
|
11688
11770
|
</x:xmpmeta>
|
11771
|
+
<!-- add attachments -->
|
11772
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
11773
|
+
<xsl:choose>
|
11774
|
+
<xsl:when test="normalize-space() != ''">
|
11775
|
+
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
|
11776
|
+
</xsl:when>
|
11777
|
+
<xsl:otherwise>
|
11778
|
+
<!-- _{filename}_attachments -->
|
11779
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
11780
|
+
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
|
11781
|
+
</xsl:otherwise>
|
11782
|
+
</xsl:choose>
|
11783
|
+
</xsl:for-each>
|
11689
11784
|
</xsl:template> <!-- addPDFUAmeta -->
|
11690
11785
|
|
11691
11786
|
<xsl:template name="getId">
|
@@ -338,29 +338,32 @@
|
|
338
338
|
</define>
|
339
339
|
<define name="organization">
|
340
340
|
<element name="organization">
|
341
|
-
<
|
342
|
-
<ref name="orgname"/>
|
343
|
-
</oneOrMore>
|
344
|
-
<zeroOrMore>
|
345
|
-
<ref name="subdivision"/>
|
346
|
-
</zeroOrMore>
|
347
|
-
<optional>
|
348
|
-
<ref name="abbreviation"/>
|
349
|
-
</optional>
|
350
|
-
<zeroOrMore>
|
351
|
-
<ref name="uri"/>
|
352
|
-
</zeroOrMore>
|
353
|
-
<zeroOrMore>
|
354
|
-
<ref name="org-identifier"/>
|
355
|
-
</zeroOrMore>
|
356
|
-
<zeroOrMore>
|
357
|
-
<ref name="contact"/>
|
358
|
-
</zeroOrMore>
|
359
|
-
<optional>
|
360
|
-
<ref name="logo"/>
|
361
|
-
</optional>
|
341
|
+
<ref name="OrganizationType"/>
|
362
342
|
</element>
|
363
343
|
</define>
|
344
|
+
<define name="OrganizationType">
|
345
|
+
<oneOrMore>
|
346
|
+
<ref name="orgname"/>
|
347
|
+
</oneOrMore>
|
348
|
+
<zeroOrMore>
|
349
|
+
<ref name="subdivision"/>
|
350
|
+
</zeroOrMore>
|
351
|
+
<optional>
|
352
|
+
<ref name="abbreviation"/>
|
353
|
+
</optional>
|
354
|
+
<zeroOrMore>
|
355
|
+
<ref name="uri"/>
|
356
|
+
</zeroOrMore>
|
357
|
+
<zeroOrMore>
|
358
|
+
<ref name="org-identifier"/>
|
359
|
+
</zeroOrMore>
|
360
|
+
<zeroOrMore>
|
361
|
+
<ref name="contact"/>
|
362
|
+
</zeroOrMore>
|
363
|
+
<optional>
|
364
|
+
<ref name="logo"/>
|
365
|
+
</optional>
|
366
|
+
</define>
|
364
367
|
<define name="orgname">
|
365
368
|
<element name="name">
|
366
369
|
<choice>
|
@@ -371,10 +374,10 @@
|
|
371
374
|
</define>
|
372
375
|
<define name="subdivision">
|
373
376
|
<element name="subdivision">
|
374
|
-
<
|
375
|
-
<
|
376
|
-
|
377
|
-
|
377
|
+
<optional>
|
378
|
+
<attribute name="type"/>
|
379
|
+
</optional>
|
380
|
+
<ref name="OrganizationType"/>
|
378
381
|
</element>
|
379
382
|
</define>
|
380
383
|
<define name="logo">
|
data/metanorma-ribose.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
31
31
|
|
32
|
-
spec.add_dependency "metanorma-generic", "~> 2.6.
|
32
|
+
spec.add_dependency "metanorma-generic", "~> 2.6.2"
|
33
33
|
|
34
34
|
spec.add_development_dependency "debug"
|
35
35
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-ribose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.6.
|
19
|
+
version: 2.6.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.6.
|
26
|
+
version: 2.6.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: debug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|