metanorma-ribose 2.5.6 → 2.5.8
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/base_convert.rb +6 -2
- data/lib/isodoc/ribose/presentation_xml_convert.rb +16 -8
- data/lib/isodoc/ribose/ribose.standard.xsl +502 -161
- data/lib/isodoc/ribose/xref.rb +34 -3
- data/lib/metanorma/ribose/isodoc.rng +1 -1
- 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: 4610f907d3022077b5cc2a16f0d05228c3e805bc7dc191b5133a681a1bf8d2d3
|
4
|
+
data.tar.gz: 63cecb2f77af07422987f3b09591045c243d0207b76f8fdbba752e27fc146c21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c15a22c66e48ae6ae92525dc682e40c10e7cee5a4a98111e244e5dd3d60dbb7c08c77b95f0d2a1f6b448124f89e8b21a497cc142fcc2b413c6122014d4b08a07
|
7
|
+
data.tar.gz: ba2a58f12b20d3b513e128b9cf0f82f0ba65516a283d33b31f4ef6c26254e9ec271040c4dcb074365feff3289fbf4bdb2989054cb5edea01b70871ce9a24e9e6
|
@@ -5,13 +5,17 @@ module IsoDoc
|
|
5
5
|
title_attr = { class: "IntroTitle" }
|
6
6
|
page_break(out)
|
7
7
|
out.div class: "Section3", id: clause["id"] do |div|
|
8
|
-
clause_name(clause, clause&.at(ns("./title")), div, title_attr)
|
8
|
+
clause_name(clause, clause&.at(ns("./fmt-title")), div, title_attr)
|
9
9
|
clause.elements.each do |e|
|
10
|
-
parse(e, div) unless e.name == "title"
|
10
|
+
parse(e, div) unless e.name == "fmt-title"
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
def sections_names
|
16
|
+
super << "executivesummary"
|
17
|
+
end
|
18
|
+
|
15
19
|
def is_clause?(name)
|
16
20
|
return true if name == "executivesummary"
|
17
21
|
|
@@ -5,34 +5,42 @@ require "metanorma-generic"
|
|
5
5
|
module IsoDoc
|
6
6
|
module Ribose
|
7
7
|
class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
|
8
|
-
|
8
|
+
# KILL
|
9
|
+
def annex1x(elem)
|
9
10
|
lbl = @xrefs.anchor(elem["id"], :label)
|
10
11
|
prefix_name(elem, "<br/><br/>", lbl, "title")
|
11
12
|
end
|
12
13
|
|
14
|
+
def annex_delim(_elem)
|
15
|
+
"<br/><br/>"
|
16
|
+
end
|
17
|
+
|
13
18
|
def middle_title(docxml); end
|
14
19
|
|
15
20
|
def termsource1(elem)
|
16
|
-
mod = elem.at(ns("./modification")) and
|
17
|
-
termsource_modification(mod)
|
18
21
|
elem.children = l10n("<strong>#{@i18n.source}:</strong> " \
|
19
22
|
"#{to_xml(elem.children).strip}")
|
20
23
|
elem&.next_element&.name == "termsource" and elem.next = "; "
|
21
24
|
end
|
22
25
|
|
23
26
|
def preface_rearrange(doc)
|
24
|
-
preface_move(doc.
|
27
|
+
preface_move(doc.xpath(ns("//preface/abstract")),
|
25
28
|
%w(foreword executivesummary introduction clause acknowledgements), doc)
|
26
|
-
preface_move(doc.
|
29
|
+
preface_move(doc.xpath(ns("//preface/foreword")),
|
27
30
|
%w(executivesummary introduction clause acknowledgements), doc)
|
28
|
-
preface_move(doc.
|
31
|
+
preface_move(doc.xpath(ns("//preface/executivesummary")),
|
29
32
|
%w(introduction clause acknowledgements), doc)
|
30
|
-
preface_move(doc.
|
33
|
+
preface_move(doc.xpath(ns("//preface/introduction")),
|
31
34
|
%w(clause acknowledgements), doc)
|
32
|
-
preface_move(doc.
|
35
|
+
preface_move(doc.xpath(ns("//preface/acknowledgements")),
|
33
36
|
%w(), doc)
|
34
37
|
end
|
35
38
|
|
39
|
+
def clause(docxml)
|
40
|
+
super
|
41
|
+
docxml.xpath(ns("//executivesummary | //appendix")).each { |x| clause1(x) }
|
42
|
+
end
|
43
|
+
|
36
44
|
include Init
|
37
45
|
end
|
38
46
|
end
|
@@ -423,32 +423,38 @@
|
|
423
423
|
</fo:page-sequence>
|
424
424
|
<!-- END Cover page -->
|
425
425
|
|
426
|
-
<!-- ToC pages -->
|
427
|
-
<fo:page-sequence master-reference="document" force-page-count="no-force"> <!-- master-reference="toc" -->
|
428
|
-
<xsl:call-template name="insertHeaderFooter">
|
429
|
-
<xsl:with-param name="section">toc</xsl:with-param>
|
430
|
-
</xsl:call-template>
|
431
|
-
<fo:flow flow-name="xsl-region-body">
|
432
|
-
|
433
|
-
<xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:clause[@type = 'toc']"/>
|
434
|
-
|
435
|
-
<xsl:apply-templates select="/ribose:rsd-standard/ribose:boilerplate/ribose:legal-statement"/>
|
436
|
-
|
437
|
-
<xsl:apply-templates select="/ribose:rsd-standard/ribose:boilerplate/ribose:feedback-statement"/>
|
438
|
-
|
439
|
-
</fo:flow>
|
440
|
-
</fo:page-sequence>
|
441
|
-
<!-- ============== -->
|
442
|
-
<!-- END ToC pages -->
|
443
|
-
<!-- ============== -->
|
444
|
-
|
445
426
|
<xsl:variable name="updated_xml">
|
446
427
|
<xsl:call-template name="updateXML"/>
|
447
428
|
<!-- <xsl:copy-of select="."/> -->
|
448
429
|
</xsl:variable>
|
449
430
|
|
431
|
+
<xsl:if test="$debug = 'true'">
|
432
|
+
<redirect:write file="contents_.xml"> <!-- {java:getTime(java:java.util.Date.new())} -->
|
433
|
+
<xsl:copy-of select="$contents"/>
|
434
|
+
</redirect:write>
|
435
|
+
</xsl:if>
|
436
|
+
|
450
437
|
<xsl:for-each select="xalan:nodeset($updated_xml)/*">
|
451
438
|
|
439
|
+
<!-- ToC pages -->
|
440
|
+
<fo:page-sequence master-reference="document" force-page-count="no-force"> <!-- master-reference="toc" -->
|
441
|
+
<xsl:call-template name="insertHeaderFooter">
|
442
|
+
<xsl:with-param name="section">toc</xsl:with-param>
|
443
|
+
</xsl:call-template>
|
444
|
+
<fo:flow flow-name="xsl-region-body">
|
445
|
+
|
446
|
+
<xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:clause[@type = 'toc']"/>
|
447
|
+
|
448
|
+
<xsl:apply-templates select="/ribose:rsd-standard/ribose:boilerplate/ribose:legal-statement"/>
|
449
|
+
|
450
|
+
<xsl:apply-templates select="/ribose:rsd-standard/ribose:boilerplate/ribose:feedback-statement"/>
|
451
|
+
|
452
|
+
</fo:flow>
|
453
|
+
</fo:page-sequence>
|
454
|
+
<!-- ============== -->
|
455
|
+
<!-- END ToC pages -->
|
456
|
+
<!-- ============== -->
|
457
|
+
|
452
458
|
<xsl:variable name="updated_xml_with_pages">
|
453
459
|
<xsl:call-template name="processPrefaceAndMainSectionsRibose_items"/>
|
454
460
|
</xsl:variable>
|
@@ -689,10 +695,10 @@
|
|
689
695
|
<!-- ============================= -->
|
690
696
|
|
691
697
|
<!-- element with title -->
|
692
|
-
<xsl:template match="*[ribose:title]" mode="contents">
|
698
|
+
<xsl:template match="*[ribose:title or ribose:fmt-title]" mode="contents">
|
693
699
|
<xsl:variable name="level">
|
694
700
|
<xsl:call-template name="getLevel">
|
695
|
-
<xsl:with-param name="depth" select="ribose:title/@depth"/>
|
701
|
+
<xsl:with-param name="depth" select="ribose:fmt-title/@depth | ribose:title/@depth"/>
|
696
702
|
</xsl:call-template>
|
697
703
|
</xsl:variable>
|
698
704
|
|
@@ -1316,7 +1322,7 @@
|
|
1316
1322
|
</xsl:if>
|
1317
1323
|
</xsl:template>
|
1318
1324
|
|
1319
|
-
<xsl:strip-space elements="ribose:xref"/>
|
1325
|
+
<!-- <xsl:strip-space elements="ribose:xref"/> -->
|
1320
1326
|
|
1321
1327
|
<xsl:variable name="namespace_full" select="namespace-uri(/*)"/> <!-- example: https://www.metanorma.org/ns/iso -->
|
1322
1328
|
<xsl:variable name="root_element" select="local-name(/*)"/> <!-- example: iso-standard -->
|
@@ -2345,6 +2351,10 @@
|
|
2345
2351
|
|
2346
2352
|
<xsl:template name="refine_termnote-name-style">
|
2347
2353
|
|
2354
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
2355
|
+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
|
2356
|
+
</xsl:if> -->
|
2357
|
+
|
2348
2358
|
</xsl:template>
|
2349
2359
|
|
2350
2360
|
<xsl:attribute-set name="termnote-p-style">
|
@@ -3065,9 +3075,21 @@
|
|
3065
3075
|
<xsl:template name="processTables_Contents">
|
3066
3076
|
<tables>
|
3067
3077
|
<xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
|
3068
|
-
<
|
3069
|
-
<xsl:
|
3070
|
-
|
3078
|
+
<xsl:choose>
|
3079
|
+
<xsl:when test="*[local-name() = 'fmt-name']">
|
3080
|
+
<xsl:variable name="fmt_name">
|
3081
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
|
3082
|
+
</xsl:variable>
|
3083
|
+
<table id="{@id}" alt-text="{normalize-space($fmt_name)}">
|
3084
|
+
<xsl:copy-of select="$fmt_name"/>
|
3085
|
+
</table>
|
3086
|
+
</xsl:when>
|
3087
|
+
<xsl:otherwise>
|
3088
|
+
<table id="{@id}" alt-text="{*[local-name() = 'name']}">
|
3089
|
+
<xsl:copy-of select="*[local-name() = 'name']"/>
|
3090
|
+
</table>
|
3091
|
+
</xsl:otherwise>
|
3092
|
+
</xsl:choose>
|
3071
3093
|
</xsl:for-each>
|
3072
3094
|
</tables>
|
3073
3095
|
</xsl:template>
|
@@ -3075,9 +3097,21 @@
|
|
3075
3097
|
<xsl:template name="processFigures_Contents">
|
3076
3098
|
<figures>
|
3077
3099
|
<xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(*[local-name() = 'name'], 'Figure ') and normalize-space(@id) != '']">
|
3078
|
-
<
|
3079
|
-
<xsl:
|
3080
|
-
|
3100
|
+
<xsl:choose>
|
3101
|
+
<xsl:when test="*[local-name() = 'fmt-name']">
|
3102
|
+
<xsl:variable name="fmt_name">
|
3103
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
|
3104
|
+
</xsl:variable>
|
3105
|
+
<figure id="{@id}" alt-text="{normalize-space($fmt_name)}">
|
3106
|
+
<xsl:copy-of select="$fmt_name"/>
|
3107
|
+
</figure>
|
3108
|
+
</xsl:when>
|
3109
|
+
<xsl:otherwise>
|
3110
|
+
<figure id="{@id}" alt-text="{*[local-name() = 'name']}">
|
3111
|
+
<xsl:copy-of select="*[local-name() = 'name']"/>
|
3112
|
+
</figure>
|
3113
|
+
</xsl:otherwise>
|
3114
|
+
</xsl:choose>
|
3081
3115
|
</xsl:for-each>
|
3082
3116
|
</figures>
|
3083
3117
|
</xsl:template>
|
@@ -7837,6 +7871,8 @@
|
|
7837
7871
|
|
7838
7872
|
<fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
|
7839
7873
|
|
7874
|
+
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab"/>
|
7875
|
+
|
7840
7876
|
<xsl:call-template name="refine_note-name-style"/>
|
7841
7877
|
|
7842
7878
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
@@ -7893,10 +7929,6 @@
|
|
7893
7929
|
|
7894
7930
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
7895
7931
|
|
7896
|
-
<xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
|
7897
|
-
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
7898
|
-
</xsl:if>
|
7899
|
-
|
7900
7932
|
<xsl:call-template name="refine_termnote-name-style"/>
|
7901
7933
|
|
7902
7934
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
@@ -8046,15 +8078,27 @@
|
|
8046
8078
|
<!-- Example: Dimensions in millimeters -->
|
8047
8079
|
<xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
|
8048
8080
|
|
8081
|
+
<xsl:variable name="show_figure_key_in_block_container">
|
8082
|
+
true
|
8083
|
+
</xsl:variable>
|
8084
|
+
|
8049
8085
|
<fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
|
8050
8086
|
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
8051
8087
|
</fo:block>
|
8052
|
-
|
8053
|
-
|
8054
|
-
|
8055
|
-
|
8088
|
+
|
8089
|
+
<xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
|
8090
|
+
<xsl:call-template name="showFigureKey"/>
|
8091
|
+
</xsl:if>
|
8056
8092
|
|
8057
8093
|
</fo:block-container>
|
8094
|
+
|
8095
|
+
</xsl:template>
|
8096
|
+
|
8097
|
+
<xsl:template name="showFigureKey">
|
8098
|
+
<xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
|
8099
|
+
<xsl:call-template name="note"/>
|
8100
|
+
</xsl:for-each>
|
8101
|
+
<xsl:call-template name="fn_display_figure"/>
|
8058
8102
|
</xsl:template>
|
8059
8103
|
|
8060
8104
|
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
@@ -8250,6 +8294,22 @@
|
|
8250
8294
|
</xsl:if>
|
8251
8295
|
</xsl:template>
|
8252
8296
|
|
8297
|
+
<xsl:template name="getImageSrc">
|
8298
|
+
<xsl:choose>
|
8299
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8300
|
+
<xsl:choose>
|
8301
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8302
|
+
<xsl:value-of select="@src"/>
|
8303
|
+
</xsl:when>
|
8304
|
+
<xsl:otherwise>
|
8305
|
+
<xsl:value-of select="concat($basepath, @src)"/>
|
8306
|
+
</xsl:otherwise>
|
8307
|
+
</xsl:choose>
|
8308
|
+
</xsl:when>
|
8309
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
8310
|
+
</xsl:choose>
|
8311
|
+
</xsl:template>
|
8312
|
+
|
8253
8313
|
<xsl:template name="getImageScale">
|
8254
8314
|
<xsl:param name="indent"/>
|
8255
8315
|
<xsl:variable name="indent_left">
|
@@ -8259,19 +8319,7 @@
|
|
8259
8319
|
</xsl:choose>
|
8260
8320
|
</xsl:variable>
|
8261
8321
|
<xsl:variable name="img_src">
|
8262
|
-
<xsl:
|
8263
|
-
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8264
|
-
<xsl:choose>
|
8265
|
-
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8266
|
-
<xsl:value-of select="@src"/>
|
8267
|
-
</xsl:when>
|
8268
|
-
<xsl:otherwise>
|
8269
|
-
<xsl:value-of select="concat($basepath, @src)"/>
|
8270
|
-
</xsl:otherwise>
|
8271
|
-
</xsl:choose>
|
8272
|
-
</xsl:when>
|
8273
|
-
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
8274
|
-
</xsl:choose>
|
8322
|
+
<xsl:call-template name="getImageSrc"/>
|
8275
8323
|
</xsl:variable>
|
8276
8324
|
|
8277
8325
|
<xsl:variable name="image_width_effective">
|
@@ -8279,10 +8327,15 @@
|
|
8279
8327
|
<xsl:value-of select="$width_effective - number($indent_left)"/>
|
8280
8328
|
|
8281
8329
|
</xsl:variable>
|
8330
|
+
<xsl:variable name="image_height_effective" select="$height_effective - number($indent_left)"/>
|
8282
8331
|
<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
|
8283
8332
|
<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
|
8284
8333
|
<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
|
8285
|
-
<xsl:variable name="scale"
|
8334
|
+
<xsl:variable name="scale">
|
8335
|
+
|
8336
|
+
<xsl:value-of select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
8337
|
+
|
8338
|
+
</xsl:variable>
|
8286
8339
|
<xsl:value-of select="$scale"/>
|
8287
8340
|
</xsl:template>
|
8288
8341
|
|
@@ -8835,20 +8888,48 @@
|
|
8835
8888
|
<xsl:template match="*[local-name() = 'emf']"/>
|
8836
8889
|
|
8837
8890
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
8891
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
|
8892
|
+
<xsl:apply-templates mode="contents"/>
|
8893
|
+
<xsl:text> </xsl:text>
|
8894
|
+
</xsl:if>
|
8895
|
+
</xsl:template>
|
8896
|
+
|
8897
|
+
<xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="contents"/>
|
8898
|
+
|
8899
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fmt-name'] | *[local-name() = 'table']/*[local-name() = 'fmt-name'] | *[local-name() = 'permission']/*[local-name() = 'fmt-name'] | *[local-name() = 'recommendation']/*[local-name() = 'fmt-name'] | *[local-name() = 'requirement']/*[local-name() = 'fmt-name']" mode="contents">
|
8838
8900
|
<xsl:apply-templates mode="contents"/>
|
8839
8901
|
<xsl:text> </xsl:text>
|
8840
8902
|
</xsl:template>
|
8841
8903
|
|
8842
8904
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
|
8905
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
|
8906
|
+
<xsl:apply-templates mode="bookmarks"/>
|
8907
|
+
<xsl:text> </xsl:text>
|
8908
|
+
</xsl:if>
|
8909
|
+
</xsl:template>
|
8910
|
+
|
8911
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fmt-name'] | *[local-name() = 'table']/*[local-name() = 'fmt-name'] | *[local-name() = 'permission']/*[local-name() = 'fmt-name'] | *[local-name() = 'recommendation']/*[local-name() = 'fmt-name'] | *[local-name() = 'requirement']/*[local-name() = 'fmt-name'] | *[local-name() = 'sourcecode']/*[local-name() = 'fmt-name']" mode="bookmarks">
|
8843
8912
|
<xsl:apply-templates mode="bookmarks"/>
|
8844
8913
|
<xsl:text> </xsl:text>
|
8845
8914
|
</xsl:template>
|
8846
8915
|
|
8847
8916
|
<xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
|
8917
|
+
<xsl:if test="not(../following-sibling::*[1][local-name() = 'fmt-name'])">
|
8918
|
+
<xsl:value-of select="."/>
|
8919
|
+
</xsl:if>
|
8920
|
+
</xsl:template>
|
8921
|
+
|
8922
|
+
<xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'fmt-name']/text()" mode="contents" priority="2">
|
8848
8923
|
<xsl:value-of select="."/>
|
8849
8924
|
</xsl:template>
|
8850
8925
|
|
8851
8926
|
<xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
|
8927
|
+
<xsl:if test="not(../following-sibling::*[1][local-name() = 'fmt-name'])">
|
8928
|
+
<xsl:value-of select="."/>
|
8929
|
+
</xsl:if>
|
8930
|
+
</xsl:template>
|
8931
|
+
|
8932
|
+
<xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'fmt-name']//text()" mode="bookmarks" priority="2">
|
8852
8933
|
<xsl:value-of select="."/>
|
8853
8934
|
</xsl:template>
|
8854
8935
|
|
@@ -8869,7 +8950,7 @@
|
|
8869
8950
|
</xsl:template>
|
8870
8951
|
|
8871
8952
|
<!-- special case: ignore section-title if @depth different than @depth of parent clause, or @depth of parent clause = 1 -->
|
8872
|
-
<xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title']/@depth or ../*[local-name() = 'title']/@depth = 1)]" priority="3" mode="contents"/>
|
8953
|
+
<xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title' or local-name() = 'fmt-title']/@depth or ../*[local-name() = 'title' or local-name() = 'fmt-title']/@depth = 1)]" priority="3" mode="contents"/>
|
8873
8954
|
|
8874
8955
|
<xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" name="contents_section-title" mode="contents">
|
8875
8956
|
<xsl:variable name="level">
|
@@ -8881,6 +8962,9 @@
|
|
8881
8962
|
<xsl:variable name="section">
|
8882
8963
|
<xsl:choose>
|
8883
8964
|
<xsl:when test="@type = 'section-title'"/>
|
8965
|
+
<xsl:when test="*[local-name() = 'span'][@class = 'fmt-caption-delim']">
|
8966
|
+
<xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
|
8967
|
+
</xsl:when>
|
8884
8968
|
<xsl:otherwise>
|
8885
8969
|
<xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
8886
8970
|
</xsl:otherwise>
|
@@ -8903,6 +8987,19 @@
|
|
8903
8987
|
|
8904
8988
|
<xsl:variable name="title">
|
8905
8989
|
<xsl:choose>
|
8990
|
+
<!-- https://github.com/metanorma/mn-native-pdf/issues/770 -->
|
8991
|
+
<xsl:when test="*[local-name() = 'span'][@class = 'fmt-caption-delim']">
|
8992
|
+
<xsl:choose>
|
8993
|
+
<xsl:when test="@type = 'section-title'">
|
8994
|
+
<xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
|
8995
|
+
<xsl:text>: </xsl:text>
|
8996
|
+
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
|
8997
|
+
</xsl:when>
|
8998
|
+
<xsl:otherwise>
|
8999
|
+
<xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
|
9000
|
+
</xsl:otherwise>
|
9001
|
+
</xsl:choose>
|
9002
|
+
</xsl:when>
|
8906
9003
|
<xsl:when test="*[local-name() = 'tab']">
|
8907
9004
|
<xsl:choose>
|
8908
9005
|
<xsl:when test="@type = 'section-title'">
|
@@ -8938,7 +9035,7 @@
|
|
8938
9035
|
<xsl:apply-templates mode="bookmarks"/>
|
8939
9036
|
</xsl:template>
|
8940
9037
|
|
8941
|
-
<xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
|
9038
|
+
<xsl:template match="*[local-name() = 'title' or local-name() = 'name' or local-name() = 'fmt-title' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
|
8942
9039
|
<xsl:apply-templates select="."/>
|
8943
9040
|
</xsl:template>
|
8944
9041
|
|
@@ -8951,6 +9048,10 @@
|
|
8951
9048
|
<xsl:apply-templates mode="contents"/>
|
8952
9049
|
</xsl:template>
|
8953
9050
|
|
9051
|
+
<xsl:template match="*[local-name() = 'semx']" mode="contents">
|
9052
|
+
<xsl:apply-templates mode="contents"/>
|
9053
|
+
</xsl:template>
|
9054
|
+
|
8954
9055
|
<xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
8955
9056
|
<xsl:apply-templates mode="bookmarks"/>
|
8956
9057
|
</xsl:template>
|
@@ -8960,9 +9061,14 @@
|
|
8960
9061
|
<xsl:apply-templates mode="bookmarks"/>
|
8961
9062
|
</xsl:template>
|
8962
9063
|
|
9064
|
+
<xsl:template match="*[local-name() = 'semx']" mode="bookmarks">
|
9065
|
+
<xsl:apply-templates mode="bookmarks"/>
|
9066
|
+
</xsl:template>
|
9067
|
+
|
8963
9068
|
<!-- Bookmarks -->
|
8964
9069
|
<xsl:template name="addBookmarks">
|
8965
9070
|
<xsl:param name="contents"/>
|
9071
|
+
<xsl:param name="contents_addon"/>
|
8966
9072
|
<xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
|
8967
9073
|
<xsl:if test="$contents_nodes//item">
|
8968
9074
|
<fo:bookmark-tree>
|
@@ -9060,6 +9166,9 @@
|
|
9060
9166
|
</xsl:otherwise>
|
9061
9167
|
</xsl:choose>
|
9062
9168
|
|
9169
|
+
<!-- for $namespace = 'nist-sp' $namespace = 'ogc' $namespace = 'ogc-white-paper' -->
|
9170
|
+
<xsl:copy-of select="$contents_addon"/>
|
9171
|
+
|
9063
9172
|
</fo:bookmark-tree>
|
9064
9173
|
</xsl:if>
|
9065
9174
|
</xsl:template>
|
@@ -9213,6 +9322,16 @@
|
|
9213
9322
|
<!-- ====== -->
|
9214
9323
|
<!-- ====== -->
|
9215
9324
|
<xsl:template match="*[local-name() = 'title']" mode="contents_item">
|
9325
|
+
<xsl:param name="mode">bookmarks</xsl:param>
|
9326
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-title'])">
|
9327
|
+
<xsl:apply-templates mode="contents_item">
|
9328
|
+
<xsl:with-param name="mode" select="$mode"/>
|
9329
|
+
</xsl:apply-templates>
|
9330
|
+
<!-- <xsl:text> </xsl:text> -->
|
9331
|
+
</xsl:if>
|
9332
|
+
</xsl:template>
|
9333
|
+
|
9334
|
+
<xsl:template match="*[local-name() = 'fmt-title']" mode="contents_item">
|
9216
9335
|
<xsl:param name="mode">bookmarks</xsl:param>
|
9217
9336
|
<xsl:apply-templates mode="contents_item">
|
9218
9337
|
<xsl:with-param name="mode" select="$mode"/>
|
@@ -9220,12 +9339,38 @@
|
|
9220
9339
|
<!-- <xsl:text> </xsl:text> -->
|
9221
9340
|
</xsl:template>
|
9222
9341
|
|
9342
|
+
<xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim']" mode="contents_item" priority="3">
|
9343
|
+
<xsl:apply-templates mode="contents_item"/>
|
9344
|
+
</xsl:template>
|
9345
|
+
|
9346
|
+
<xsl:template match="*[local-name() = 'semx']" mode="contents_item">
|
9347
|
+
<xsl:apply-templates mode="contents_item"/>
|
9348
|
+
</xsl:template>
|
9349
|
+
|
9350
|
+
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="contents_item"/>
|
9351
|
+
|
9223
9352
|
<xsl:template name="getSection">
|
9224
|
-
<xsl:
|
9353
|
+
<xsl:choose>
|
9354
|
+
<xsl:when test="*[local-name() = 'fmt-title']">
|
9355
|
+
<xsl:variable name="fmt_title_section">
|
9356
|
+
<xsl:copy-of select="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']][1]/preceding-sibling::node()[not(local-name() = 'review')]"/>
|
9357
|
+
</xsl:variable>
|
9358
|
+
<xsl:value-of select="normalize-space($fmt_title_section)"/>
|
9359
|
+
</xsl:when>
|
9360
|
+
<xsl:otherwise>
|
9361
|
+
<xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
9362
|
+
</xsl:otherwise>
|
9363
|
+
</xsl:choose>
|
9225
9364
|
</xsl:template>
|
9226
9365
|
|
9227
9366
|
<xsl:template name="getName">
|
9228
9367
|
<xsl:choose>
|
9368
|
+
<xsl:when test="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']]">
|
9369
|
+
<xsl:copy-of select="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']][1]/following-sibling::node()"/>
|
9370
|
+
</xsl:when>
|
9371
|
+
<xsl:when test="*[local-name() = 'fmt-title']">
|
9372
|
+
<xsl:copy-of select="*[local-name() = 'fmt-title']/node()"/>
|
9373
|
+
</xsl:when>
|
9229
9374
|
<xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
|
9230
9375
|
<xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
|
9231
9376
|
</xsl:when>
|
@@ -9332,6 +9477,15 @@
|
|
9332
9477
|
</xsl:template>
|
9333
9478
|
|
9334
9479
|
<xsl:template match="*[local-name() = 'name']" mode="contents_item">
|
9480
|
+
<xsl:param name="mode">bookmarks</xsl:param>
|
9481
|
+
<xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
|
9482
|
+
<xsl:apply-templates mode="contents_item">
|
9483
|
+
<xsl:with-param name="mode" select="$mode"/>
|
9484
|
+
</xsl:apply-templates>
|
9485
|
+
</xsl:if>
|
9486
|
+
</xsl:template>
|
9487
|
+
|
9488
|
+
<xsl:template match="*[local-name() = 'fmt-name']" mode="contents_item">
|
9335
9489
|
<xsl:param name="mode">bookmarks</xsl:param>
|
9336
9490
|
<xsl:apply-templates mode="contents_item">
|
9337
9491
|
<xsl:with-param name="mode" select="$mode"/>
|
@@ -10173,107 +10327,108 @@
|
|
10173
10327
|
-->
|
10174
10328
|
<xsl:template match="*[local-name() = 'example']">
|
10175
10329
|
|
10176
|
-
|
10330
|
+
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
|
10177
10331
|
|
10178
|
-
|
10179
|
-
|
10180
|
-
<xsl:call-template name="refine_example-style"/>
|
10332
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
10181
10333
|
|
10182
|
-
|
10183
|
-
<xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
|
10184
|
-
inline
|
10185
|
-
</xsl:variable>
|
10334
|
+
<xsl:call-template name="refine_example-style"/>
|
10186
10335
|
|
10187
|
-
|
10336
|
+
<xsl:variable name="fo_element">
|
10337
|
+
<xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
|
10338
|
+
inline
|
10339
|
+
</xsl:variable>
|
10188
10340
|
|
10189
|
-
|
10341
|
+
<fo:block-container margin-left="0mm" role="SKIP">
|
10190
10342
|
|
10191
|
-
|
10343
|
+
<xsl:choose>
|
10192
10344
|
|
10193
|
-
|
10194
|
-
<fo:block>
|
10195
|
-
<xsl:apply-templates select="*[local-name()='name']">
|
10196
|
-
<xsl:with-param name="fo_element" select="$fo_element"/>
|
10197
|
-
</xsl:apply-templates>
|
10198
|
-
</fo:block>
|
10345
|
+
<xsl:when test="contains(normalize-space($fo_element), 'block')">
|
10199
10346
|
|
10200
|
-
|
10201
|
-
|
10202
|
-
|
10203
|
-
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
|
10347
|
+
<!-- display name 'EXAMPLE' in a separate block -->
|
10348
|
+
<fo:block>
|
10349
|
+
<xsl:apply-templates select="*[local-name()='name']">
|
10204
10350
|
<xsl:with-param name="fo_element" select="$fo_element"/>
|
10205
10351
|
</xsl:apply-templates>
|
10352
|
+
</fo:block>
|
10353
|
+
|
10354
|
+
<fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
|
10355
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
10356
|
+
<xsl:variable name="example_body">
|
10357
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
|
10358
|
+
<xsl:with-param name="fo_element" select="$fo_element"/>
|
10359
|
+
</xsl:apply-templates>
|
10360
|
+
</xsl:variable>
|
10361
|
+
<xsl:choose>
|
10362
|
+
<xsl:when test="xalan:nodeset($example_body)/*">
|
10363
|
+
<xsl:copy-of select="$example_body"/>
|
10364
|
+
</xsl:when>
|
10365
|
+
<xsl:otherwise><fo:block/><!-- prevent empty block-container --></xsl:otherwise>
|
10366
|
+
</xsl:choose>
|
10367
|
+
</fo:block-container>
|
10368
|
+
</fo:block-container>
|
10369
|
+
</xsl:when> <!-- end block -->
|
10370
|
+
|
10371
|
+
<xsl:when test="contains(normalize-space($fo_element), 'list')">
|
10372
|
+
|
10373
|
+
<xsl:variable name="provisional_distance_between_starts_">
|
10374
|
+
7
|
10206
10375
|
</xsl:variable>
|
10207
|
-
<xsl:
|
10208
|
-
|
10209
|
-
|
10210
|
-
|
10211
|
-
|
10212
|
-
</xsl:choose>
|
10213
|
-
</fo:block-container>
|
10214
|
-
</fo:block-container>
|
10215
|
-
</xsl:when> <!-- end block -->
|
10376
|
+
<xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
|
10377
|
+
<xsl:variable name="indent_">
|
10378
|
+
0
|
10379
|
+
</xsl:variable>
|
10380
|
+
<xsl:variable name="indent" select="normalize-space($indent_)"/>
|
10216
10381
|
|
10217
|
-
|
10382
|
+
<fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
|
10383
|
+
<fo:list-item>
|
10384
|
+
<fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
|
10385
|
+
<fo:block>
|
10386
|
+
<xsl:apply-templates select="*[local-name()='name']">
|
10387
|
+
<xsl:with-param name="fo_element">block</xsl:with-param>
|
10388
|
+
</xsl:apply-templates>
|
10389
|
+
</fo:block>
|
10390
|
+
</fo:list-item-label>
|
10391
|
+
<fo:list-item-body start-indent="body-start()">
|
10392
|
+
<fo:block>
|
10393
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
|
10394
|
+
<xsl:with-param name="fo_element" select="$fo_element"/>
|
10395
|
+
</xsl:apply-templates>
|
10396
|
+
</fo:block>
|
10397
|
+
</fo:list-item-body>
|
10398
|
+
</fo:list-item>
|
10399
|
+
</fo:list-block>
|
10400
|
+
</xsl:when> <!-- end list -->
|
10218
10401
|
|
10219
|
-
|
10220
|
-
7
|
10221
|
-
</xsl:variable>
|
10222
|
-
<xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
|
10223
|
-
<xsl:variable name="indent_">
|
10224
|
-
0
|
10225
|
-
</xsl:variable>
|
10226
|
-
<xsl:variable name="indent" select="normalize-space($indent_)"/>
|
10402
|
+
<xsl:otherwise> <!-- inline -->
|
10227
10403
|
|
10228
|
-
|
10229
|
-
|
10230
|
-
|
10231
|
-
|
10232
|
-
|
10233
|
-
|
10234
|
-
|
10235
|
-
</fo:block>
|
10236
|
-
</fo:list-item-label>
|
10237
|
-
<fo:list-item-body start-indent="body-start()">
|
10238
|
-
<fo:block>
|
10239
|
-
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
|
10404
|
+
<!-- display 'EXAMPLE' and first element in the same line -->
|
10405
|
+
<fo:block>
|
10406
|
+
<xsl:apply-templates select="*[local-name()='name']">
|
10407
|
+
<xsl:with-param name="fo_element" select="$fo_element"/>
|
10408
|
+
</xsl:apply-templates>
|
10409
|
+
<fo:inline>
|
10410
|
+
<xsl:apply-templates select="*[not(local-name() = 'name')][1]">
|
10240
10411
|
<xsl:with-param name="fo_element" select="$fo_element"/>
|
10241
10412
|
</xsl:apply-templates>
|
10242
|
-
</fo:
|
10243
|
-
</fo:
|
10244
|
-
</fo:list-item>
|
10245
|
-
</fo:list-block>
|
10246
|
-
</xsl:when> <!-- end list -->
|
10247
|
-
|
10248
|
-
<xsl:otherwise> <!-- inline -->
|
10413
|
+
</fo:inline>
|
10414
|
+
</fo:block>
|
10249
10415
|
|
10250
|
-
|
10251
|
-
|
10252
|
-
|
10253
|
-
|
10254
|
-
|
10255
|
-
|
10256
|
-
|
10257
|
-
|
10258
|
-
|
10259
|
-
|
10260
|
-
|
10416
|
+
<xsl:if test="*[not(local-name() = 'name')][position() > 1]">
|
10417
|
+
<!-- display further elements in blocks -->
|
10418
|
+
<fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
|
10419
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
10420
|
+
<xsl:apply-templates select="*[not(local-name() = 'name')][position() > 1]">
|
10421
|
+
<xsl:with-param name="fo_element" select="'block'"/>
|
10422
|
+
</xsl:apply-templates>
|
10423
|
+
</fo:block-container>
|
10424
|
+
</fo:block-container>
|
10425
|
+
</xsl:if>
|
10426
|
+
</xsl:otherwise> <!-- end inline -->
|
10261
10427
|
|
10262
|
-
|
10263
|
-
|
10264
|
-
|
10265
|
-
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
10266
|
-
<xsl:apply-templates select="*[not(local-name() = 'name')][position() > 1]">
|
10267
|
-
<xsl:with-param name="fo_element" select="'block'"/>
|
10268
|
-
</xsl:apply-templates>
|
10269
|
-
</fo:block-container>
|
10270
|
-
</fo:block-container>
|
10271
|
-
</xsl:if>
|
10272
|
-
</xsl:otherwise> <!-- end inline -->
|
10428
|
+
</xsl:choose>
|
10429
|
+
</fo:block-container>
|
10430
|
+
</fo:block-container>
|
10273
10431
|
|
10274
|
-
</xsl:choose>
|
10275
|
-
</fo:block-container>
|
10276
|
-
</fo:block-container>
|
10277
10432
|
</xsl:template>
|
10278
10433
|
|
10279
10434
|
<xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
|
@@ -10656,6 +10811,15 @@
|
|
10656
10811
|
|
10657
10812
|
</xsl:template> <!-- tab -->
|
10658
10813
|
|
10814
|
+
<xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
|
10815
|
+
<xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
|
10816
|
+
|
10817
|
+
<xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab">
|
10818
|
+
|
10819
|
+
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
10820
|
+
|
10821
|
+
</xsl:template>
|
10822
|
+
|
10659
10823
|
<xsl:template name="insertNonBreakSpaces">
|
10660
10824
|
<xsl:param name="count"/>
|
10661
10825
|
<xsl:if test="$count > 0">
|
@@ -12191,6 +12355,10 @@
|
|
12191
12355
|
<!-- - Remove semantic xml part -->
|
12192
12356
|
<!-- - Remove image/emf (EMF vector image for Word) -->
|
12193
12357
|
<!-- - add @id, redundant for table auto-layout algorithm -->
|
12358
|
+
<!-- - process 'passthrough' element -->
|
12359
|
+
<!-- - split math by element with @linebreak into maths -->
|
12360
|
+
<!-- - rename fmt-title to title, fmt-name to name and another changes to convert new presentation XML to -->
|
12361
|
+
<!-- - old XML without significant changes in XSLT -->
|
12194
12362
|
<!-- =========================================================================== -->
|
12195
12363
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
12196
12364
|
<xsl:copy>
|
@@ -12198,6 +12366,12 @@
|
|
12198
12366
|
</xsl:copy>
|
12199
12367
|
</xsl:template>
|
12200
12368
|
|
12369
|
+
<xsl:template match="@*|node()" mode="update_xml_pres">
|
12370
|
+
<xsl:copy>
|
12371
|
+
<xsl:apply-templates select="@*|node()" mode="update_xml_pres"/>
|
12372
|
+
</xsl:copy>
|
12373
|
+
</xsl:template>
|
12374
|
+
|
12201
12375
|
<!-- change section's order based on @displayorder value -->
|
12202
12376
|
<xsl:template match="*[local-name() = 'preface']" mode="update_xml_step1">
|
12203
12377
|
<xsl:copy>
|
@@ -12274,7 +12448,7 @@
|
|
12274
12448
|
</xsl:template>
|
12275
12449
|
|
12276
12450
|
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
12277
|
-
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
|
12451
|
+
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
|
12278
12452
|
<xsl:copy>
|
12279
12453
|
<xsl:copy-of select="@*"/>
|
12280
12454
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -12293,14 +12467,17 @@
|
|
12293
12467
|
|
12294
12468
|
<!-- remove semantic xml -->
|
12295
12469
|
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
|
12470
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_pres"/>
|
12296
12471
|
|
12297
12472
|
<!-- remove image/emf -->
|
12298
12473
|
<xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
|
12474
|
+
<xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_pres"/>
|
12299
12475
|
|
12300
12476
|
<!-- remove preprocess-xslt -->
|
12301
12477
|
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
|
12478
|
+
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_pres"/>
|
12302
12479
|
|
12303
|
-
<xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
12480
|
+
<xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
12304
12481
|
<xsl:copy-of select="."/>
|
12305
12482
|
</xsl:template>
|
12306
12483
|
|
@@ -12382,6 +12559,77 @@
|
|
12382
12559
|
<xsl:copy-of select="$maths"/>
|
12383
12560
|
</xsl:template>
|
12384
12561
|
|
12562
|
+
<!-- update new Presentation XML -->
|
12563
|
+
<xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="update_xml_step1"/>
|
12564
|
+
<xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="update_xml_pres"/>
|
12565
|
+
<xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_step1"/>
|
12566
|
+
<xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_pres"/>
|
12567
|
+
<xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
|
12568
|
+
<xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_pres"/>
|
12569
|
+
|
12570
|
+
<xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_step1">
|
12571
|
+
<xsl:copy>
|
12572
|
+
<xsl:apply-templates select="@*" mode="update_xml_step1"/>
|
12573
|
+
<xsl:copy-of select="preceding-sibling::*[1][local-name() = 'section-title']/@depth"/>
|
12574
|
+
<xsl:apply-templates select="node()" mode="update_xml_step1"/>
|
12575
|
+
</xsl:copy>
|
12576
|
+
</xsl:template>
|
12577
|
+
<xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_pres">
|
12578
|
+
<xsl:copy>
|
12579
|
+
<xsl:apply-templates select="@*" mode="update_xml_pres"/>
|
12580
|
+
<xsl:copy-of select="preceding-sibling::*[1][local-name() = 'section-title']/@depth"/>
|
12581
|
+
<xsl:apply-templates select="node()" mode="update_xml_pres"/>
|
12582
|
+
</xsl:copy>
|
12583
|
+
</xsl:template>
|
12584
|
+
|
12585
|
+
<xsl:template match="*[local-name() = 'fmt-title']"/>
|
12586
|
+
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
|
12587
|
+
<xsl:element name="title" namespace="{$namespace_full}">
|
12588
|
+
<xsl:copy-of select="@*"/>
|
12589
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12590
|
+
</xsl:element>
|
12591
|
+
</xsl:template>
|
12592
|
+
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
|
12593
|
+
<xsl:element name="title" namespace="{$namespace_full}">
|
12594
|
+
<xsl:copy-of select="@*"/>
|
12595
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
12596
|
+
</xsl:element>
|
12597
|
+
</xsl:template>
|
12598
|
+
|
12599
|
+
<xsl:template match="*[local-name() = 'fmt-name']"/>
|
12600
|
+
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
|
12601
|
+
<xsl:element name="name" namespace="{$namespace_full}">
|
12602
|
+
<xsl:copy-of select="@*"/>
|
12603
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12604
|
+
</xsl:element>
|
12605
|
+
</xsl:template>
|
12606
|
+
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_pres">
|
12607
|
+
<xsl:element name="name" namespace="{$namespace_full}">
|
12608
|
+
<xsl:copy-of select="@*"/>
|
12609
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
12610
|
+
</xsl:element>
|
12611
|
+
</xsl:template>
|
12612
|
+
|
12613
|
+
<xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
|
12614
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12615
|
+
</xsl:template>
|
12616
|
+
<xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_pres" priority="3">
|
12617
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
12618
|
+
</xsl:template>
|
12619
|
+
|
12620
|
+
<xsl:template match="*[local-name() = 'semx']" mode="update_xml_step1">
|
12621
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12622
|
+
</xsl:template>
|
12623
|
+
<xsl:template match="*[local-name() = 'semx']" mode="update_xml_pres">
|
12624
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
12625
|
+
</xsl:template>
|
12626
|
+
|
12627
|
+
<xsl:template match="*[local-name() = 'fmt-xref-label']"/>
|
12628
|
+
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_step1"/>
|
12629
|
+
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_pres"/>
|
12630
|
+
|
12631
|
+
<!-- END: update new Presentation XML -->
|
12632
|
+
|
12385
12633
|
<!-- =========================================================================== -->
|
12386
12634
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
12387
12635
|
<!-- =========================================================================== -->
|
@@ -12574,7 +12822,7 @@
|
|
12574
12822
|
<xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
|
12575
12823
|
<xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
|
12576
12824
|
|
12577
|
-
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
12825
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::*[local-name() = 'name'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
12578
12826
|
|
12579
12827
|
<xsl:variable name="parent" select="local-name(..)"/>
|
12580
12828
|
|
@@ -13153,6 +13401,7 @@
|
|
13153
13401
|
</pdf:catalog>
|
13154
13402
|
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
13155
13403
|
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
13404
|
+
<!-- Commented after upgrade to Apache FOP 2.10
|
13156
13405
|
<rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" rdf:about="">
|
13157
13406
|
<pdfaExtension:schemas>
|
13158
13407
|
<rdf:Bag>
|
@@ -13185,7 +13434,7 @@
|
|
13185
13434
|
</rdf:li>
|
13186
13435
|
</rdf:Bag>
|
13187
13436
|
</pdfaExtension:schemas>
|
13188
|
-
</rdf:Description>
|
13437
|
+
</rdf:Description> -->
|
13189
13438
|
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
13190
13439
|
<!-- Dublin Core properties go here -->
|
13191
13440
|
<dc:title>
|
@@ -13232,7 +13481,7 @@
|
|
13232
13481
|
<xsl:variable name="dc_description">
|
13233
13482
|
<xsl:variable name="abstract">
|
13234
13483
|
|
13235
|
-
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
|
13484
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'fmt-title']) and not(ancestor::*[local-name() = 'title']) and not(ancestor::*[local-name() = 'fmt-xref-label'])]"/>
|
13236
13485
|
|
13237
13486
|
</xsl:variable>
|
13238
13487
|
<rdf:Alt>
|
@@ -13777,31 +14026,123 @@
|
|
13777
14026
|
|
13778
14027
|
<!-- END: insert cover page image -->
|
13779
14028
|
|
13780
|
-
|
14029
|
+
<!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
|
14030
|
+
<xsl:variable name="regex_ja_spec_">[
|
14031
|
+
<!-- Rotate 90° clockwise -->
|
14032
|
+
\u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
|
14033
|
+
\uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
|
14034
|
+
\u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
|
14035
|
+
\uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
|
14036
|
+
\u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
|
14037
|
+
\uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
|
14038
|
+
\u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
|
14039
|
+
\uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
|
14040
|
+
\u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
|
14041
|
+
\u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
|
14042
|
+
\u3010 <!-- U+3010 LEFT BLACK LENTICULAR BRACKET (【) -->
|
14043
|
+
\u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
|
14044
|
+
\u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
|
14045
|
+
\u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
|
14046
|
+
\uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
|
14047
|
+
\u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
|
14048
|
+
\uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
|
14049
|
+
\u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
|
14050
|
+
\u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
|
14051
|
+
\u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
|
14052
|
+
\u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
|
14053
|
+
\uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
|
14054
|
+
\u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
|
14055
|
+
\uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
|
14056
|
+
\u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
|
14057
|
+
\u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
|
14058
|
+
\u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
|
14059
|
+
\u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
|
14060
|
+
|
14061
|
+
\u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
|
14062
|
+
\u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
|
14063
|
+
\u301C <!-- U+301C WAVE DASH (〜) -->
|
14064
|
+
\u3030 <!-- U+3030 WAVY DASH (〰 )-->
|
14065
|
+
\u30FC <!-- U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK (ー) -->
|
14066
|
+
\u2329 <!-- U+2329 LEFT-POINTING ANGLE BRACKET (〈) -->
|
14067
|
+
\u232A <!-- U+232A RIGHT-POINTING ANGLE BRACKET (〉) -->
|
14068
|
+
\u3018 <!-- U+3018 LEFT WHITE TORTOISE SHELL BRACKET (〘) -->
|
14069
|
+
\u3019 <!-- U+3019 RIGHT WHITE TORTOISE SHELL BRACKET (〙) -->
|
14070
|
+
\u30A0 <!-- U+30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN (゠) -->
|
14071
|
+
\uFE59 <!-- U+FE59 SMALL LEFT PARENTHESIS (﹙) -->
|
14072
|
+
\uFE5A <!-- U+FE5A SMALL RIGHT PARENTHESIS (﹚) -->
|
14073
|
+
\uFE5B <!-- U+FE5B SMALL LEFT CURLY BRACKET (﹛) -->
|
14074
|
+
\uFE5C <!-- U+FE5C SMALL RIGHT CURLY BRACKET (﹜) -->
|
14075
|
+
\uFE5D <!-- U+FE5D SMALL LEFT TORTOISE SHELL BRACKET (﹝) -->
|
14076
|
+
\uFE5E <!-- U+FE5E SMALL RIGHT TORTOISE SHELL BRACKET (﹞) -->
|
14077
|
+
\uFF5C <!-- U+FF5C FULLWIDTH VERTICAL LINE (|) -->
|
14078
|
+
\uFF5F <!-- U+FF5F FULLWIDTH LEFT WHITE PARENTHESIS (⦅) -->
|
14079
|
+
\uFF60 <!-- U+FF60 FULLWIDTH RIGHT WHITE PARENTHESIS (⦆) -->
|
14080
|
+
\uFFE3 <!-- U+FFE3 FULLWIDTH MACRON ( ̄) -->
|
14081
|
+
\uFF3F <!-- U+FF3F FULLWIDTH LOW LINE (_) -->
|
14082
|
+
\uFF5E <!-- U+FF5E FULLWIDTH TILDE (~) -->
|
14083
|
+
<!-- Rotate 180° -->
|
14084
|
+
\u309C <!-- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜) -->
|
14085
|
+
\u3002 <!-- U+3002 IDEOGRAPHIC FULL STOP (。) -->
|
14086
|
+
\uFE52 <!-- U+FE52 SMALL FULL STOP (﹒) -->
|
14087
|
+
\uFF0E <!-- U+FF0E FULLWIDTH FULL STOP (.) -->
|
14088
|
+
]</xsl:variable>
|
14089
|
+
<xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
|
13781
14090
|
<xsl:template name="insertVerticalChar">
|
13782
14091
|
<xsl:param name="str"/>
|
13783
14092
|
<xsl:param name="writing-mode">lr-tb</xsl:param>
|
13784
14093
|
<xsl:param name="reference-orientation">90</xsl:param>
|
13785
|
-
<xsl:
|
13786
|
-
|
13787
|
-
|
13788
|
-
|
13789
|
-
|
13790
|
-
|
13791
|
-
<xsl:
|
13792
|
-
|
13793
|
-
<xsl:
|
14094
|
+
<xsl:param name="add_zero_width_space">false</xsl:param>
|
14095
|
+
<xsl:choose>
|
14096
|
+
<xsl:when test="ancestor::*[local-name() = 'span'][@class = 'norotate']">
|
14097
|
+
<xsl:value-of select="$str"/>
|
14098
|
+
</xsl:when>
|
14099
|
+
<xsl:otherwise>
|
14100
|
+
<xsl:if test="string-length($str) > 0">
|
14101
|
+
<xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
|
14102
|
+
<xsl:variable name="char" select="substring($str,1,1)"/>
|
14103
|
+
<fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
|
14104
|
+
<xsl:if test="normalize-space($writing-mode) != ''">
|
14105
|
+
<xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
|
14106
|
+
<xsl:attribute name="reference-orientation">90</xsl:attribute>
|
14107
|
+
</xsl:if>
|
14108
|
+
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
|
14109
|
+
<xsl:attribute name="reference-orientation">0</xsl:attribute>
|
14110
|
+
</xsl:if>
|
14111
|
+
<xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
|
14112
|
+
<!-- Rotate 180°:
|
14113
|
+
U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
|
14114
|
+
U+3002 IDEOGRAPHIC FULL STOP (。)
|
14115
|
+
U+FE52 SMALL FULL STOP (﹒)
|
14116
|
+
U+FF0E FULLWIDTH FULL STOP (.)
|
14117
|
+
-->
|
14118
|
+
<xsl:attribute name="reference-orientation">-90</xsl:attribute>
|
14119
|
+
</xsl:if>
|
14120
|
+
<fo:block-container width="1em">
|
14121
|
+
<fo:block line-height="1em">
|
14122
|
+
<xsl:choose>
|
14123
|
+
<xsl:when test="$horizontal_mode = 'true'">
|
14124
|
+
<xsl:value-of select="$str"/>
|
14125
|
+
</xsl:when>
|
14126
|
+
<xsl:otherwise>
|
14127
|
+
<xsl:value-of select="$char"/>
|
14128
|
+
</xsl:otherwise>
|
14129
|
+
</xsl:choose>
|
14130
|
+
</fo:block>
|
14131
|
+
</fo:block-container>
|
14132
|
+
</fo:inline-container>
|
14133
|
+
<xsl:if test="$add_zero_width_space = 'true' and ($char = ',' or $char = '.' or $char = ' ' or $char = '·' or $char = ')' or $char = ']' or $char = '}')"><xsl:value-of select="$zero_width_space"/></xsl:if>
|
14134
|
+
|
14135
|
+
<xsl:if test="$horizontal_mode = 'false'">
|
14136
|
+
<xsl:call-template name="insertVerticalChar">
|
14137
|
+
<xsl:with-param name="str" select="substring($str, 2)"/>
|
14138
|
+
<xsl:with-param name="writing-mode" select="$writing-mode"/>
|
14139
|
+
<xsl:with-param name="reference-orientation" select="$reference-orientation"/>
|
14140
|
+
<xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
|
14141
|
+
</xsl:call-template>
|
14142
|
+
</xsl:if>
|
13794
14143
|
</xsl:if>
|
13795
|
-
|
13796
|
-
|
13797
|
-
</fo:block-container>
|
13798
|
-
</fo:inline-container>
|
13799
|
-
<xsl:call-template name="insertVerticalChar">
|
13800
|
-
<xsl:with-param name="str" select="substring($str, 2)"/>
|
13801
|
-
<xsl:with-param name="writing-mode" select="$writing-mode"/>
|
13802
|
-
<xsl:with-param name="reference-orientation" select="$reference-orientation"/>
|
13803
|
-
</xsl:call-template>
|
13804
|
-
</xsl:if>
|
14144
|
+
</xsl:otherwise>
|
14145
|
+
</xsl:choose>
|
13805
14146
|
</xsl:template>
|
13806
14147
|
|
13807
14148
|
<xsl:template name="number-to-words">
|
data/lib/isodoc/ribose/xref.rb
CHANGED
@@ -6,7 +6,8 @@ module IsoDoc
|
|
6
6
|
end
|
7
7
|
|
8
8
|
class Xref < IsoDoc::Generic::Xref
|
9
|
-
|
9
|
+
# KILL
|
10
|
+
def annex_name_lblx(clause, num)
|
10
11
|
obl = l10n("(#{@labels['inform_annex']})")
|
11
12
|
clause["obligation"] == "normative" and
|
12
13
|
obl = l10n("(#{@labels['norm_annex']})")
|
@@ -28,7 +29,8 @@ module IsoDoc
|
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
31
|
-
|
32
|
+
# KILL
|
33
|
+
def section_names1x(clause, num, level)
|
32
34
|
@anchors[clause["id"]] =
|
33
35
|
{ label: num, level: level, xref: num }
|
34
36
|
# subclauses are not prefixed with "Clause"
|
@@ -39,8 +41,25 @@ module IsoDoc
|
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
44
|
+
# subclauses are not prefixed with "Clause"
|
45
|
+
# retaining subtype for the semantics
|
46
|
+
def section_name_anchors(clause, num, level)
|
47
|
+
if clause["type"] == "section"
|
48
|
+
xref = labelled_autonum(@labels["section"], num)
|
49
|
+
label = labelled_autonum(@labels["section"], num)
|
50
|
+
@anchors[clause["id"]] =
|
51
|
+
{ label:, xref:, elem: @labels["section"],
|
52
|
+
title: clause_title(clause), level: level, type: "clause" }
|
53
|
+
elsif level > 1
|
54
|
+
#num = semx(clause, num)
|
55
|
+
@anchors[clause["id"]] =
|
56
|
+
{ label: num, level: level, xref: num, subtype: "clause" }
|
57
|
+
else super end
|
58
|
+
end
|
59
|
+
|
42
60
|
# we can reference 0-number clauses in introduction
|
43
|
-
|
61
|
+
# # KILL
|
62
|
+
def introduction_namesx(clause)
|
44
63
|
clause.nil? and return
|
45
64
|
clause.at(ns("./clause")) and
|
46
65
|
@anchors[clause["id"]] = { label: "0", level: 1, type: "clause",
|
@@ -49,6 +68,18 @@ module IsoDoc
|
|
49
68
|
clause.xpath(ns("./clause")).each do |c|
|
50
69
|
section_names1(c, i.increment(c).print, 2)
|
51
70
|
end
|
71
|
+
end
|
72
|
+
# we can reference 0-number clauses in introduction
|
73
|
+
def introduction_names(clause)
|
74
|
+
clause.nil? and return
|
75
|
+
clause.at(ns("./clause")) and
|
76
|
+
@anchors[clause["id"]] = { label: nil, level: 1, type: "clause",
|
77
|
+
xref: clause.at(ns("./title"))&.text }
|
78
|
+
#i = Counter.new(0, prefix: "0")
|
79
|
+
i = Counter.new(0)
|
80
|
+
clause.xpath(ns("./clause")).each do |c|
|
81
|
+
section_names1(c, semx(clause, "0"), i.increment(c).print, 2)
|
82
|
+
end
|
52
83
|
end
|
53
84
|
end
|
54
85
|
end
|
@@ -17,7 +17,7 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
-
<!-- VERSION v1.4.
|
20
|
+
<!-- VERSION v1.4.1 -->
|
21
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">
|
22
22
|
<include href="reqt.rng"/>
|
23
23
|
<include href="basicdoc.rng">
|
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(">= 3.1.0")
|
31
31
|
|
32
|
-
spec.add_dependency "metanorma-generic", "~> 2.7.
|
32
|
+
spec.add_dependency "metanorma-generic", "~> 2.7.4"
|
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.5.
|
4
|
+
version: 2.5.8
|
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-12-10 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.7.
|
19
|
+
version: 2.7.4
|
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.7.
|
26
|
+
version: 2.7.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: debug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|