metanorma-cc 2.5.3 → 2.5.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 66c15830e8c03cdf33a31399e79c7c877c8571d01e026ce58ed957f3775af78d
4
- data.tar.gz: 34da7c69025deca892b3f0ce14c6085d1006ccf9e046c60ab77fb79d1a0cf849
3
+ metadata.gz: b2b31d0ca70ffb8903d190d7d3087f046dea778e8f7b053f547c77575df1d3a1
4
+ data.tar.gz: 21528facf9965a72f2aea590f444a4865ecf763e25dc6e2a868a23070c8b9946
5
5
  SHA512:
6
- metadata.gz: 4d793ea61e587754be9e0875b925a4574604aec112bc557333c1fb5e8d2bb50836126e82c83c9ae0f1f32dec0b5a200d897fc4aaf03272c08256f2c21c5846dd
7
- data.tar.gz: 026f27420bc99c78745abf79453b6a8cefe5699f91347a9a6695f0e642e3ab4d412bee6719ddbb0b0e641fcd06e89c23037d6af0d2bd153e7868fcabdafbf06a
6
+ metadata.gz: 8eda576b445cfb830153034c92892d889fd337e8796eb123283336cfb1c8d13cb8278ae32cb9f833ace1c96e8350bbe4bfb5f0f2adb0a344bd25120d0e1a66cc
7
+ data.tar.gz: df11767ebbdd870b1b98e70376e385c8fb93cee07b021beb58a58187c2b8c212e6da7f09963879eb7b292903995102bd9c3c257be9eb8f623d32a78bf22b9977
@@ -1,10 +1,10 @@
1
1
  require "isodoc"
2
2
 
3
3
  module IsoDoc
4
- module CC
4
+ module Cc
5
5
  module BaseConvert
6
6
  def configuration
7
- Metanorma::CC.configuration
7
+ Metanorma::Cc.configuration
8
8
  end
9
9
  end
10
10
  end
@@ -355,21 +355,21 @@
355
355
 
356
356
  <xsl:template name="insertListOf_Item">
357
357
  <fo:block role="TOCI">
358
- <fo:list-block provisional-distance-between-starts="8mm">
359
- <fo:list-item>
360
- <fo:list-item-label end-indent="label-end()">
358
+ <fo:list-block provisional-distance-between-starts="8mm" role="SKIP">
359
+ <fo:list-item role="SKIP">
360
+ <fo:list-item-label end-indent="label-end()" role="SKIP">
361
361
  <fo:block/>
362
362
  </fo:list-item-label>
363
- <fo:list-item-body start-indent="body-start()">
364
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
363
+ <fo:list-item-body start-indent="body-start()" role="SKIP">
364
+ <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm" role="SKIP">
365
365
  <fo:basic-link internal-destination="{@id}">
366
366
  <xsl:call-template name="setAltText">
367
367
  <xsl:with-param name="value" select="@alt-text"/>
368
368
  </xsl:call-template>
369
369
  <xsl:apply-templates select="." mode="contents"/>
370
- <fo:inline keep-together.within-line="always">
370
+ <fo:inline keep-together.within-line="always" role="SKIP">
371
371
  <fo:leader leader-pattern="dots"/>
372
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
372
+ <fo:inline role="SKIP"><fo:wrapper role="artifact"><fo:page-number-citation ref-id="{@id}"/></fo:wrapper></fo:inline>
373
373
  </fo:inline>
374
374
  </fo:basic-link>
375
375
  </fo:block>
@@ -380,10 +380,12 @@
380
380
  </xsl:template>
381
381
 
382
382
  <xsl:template match="csd:preface//csd:clause[@type = 'toc']" priority="3">
383
- <fo:block-container font-weight="bold" line-height="115%">
383
+ <fo:block-container font-weight="bold" line-height="115%" role="SKIP">
384
+ <!-- render 'Contents' outside if role="TOC" -->
385
+ <xsl:apply-templates select="*[local-name() = 'title']"/>
384
386
  <fo:block role="TOC">
385
387
 
386
- <xsl:apply-templates/>
388
+ <xsl:apply-templates select="node()[not(local-name() = 'title')]"/>
387
389
 
388
390
  <xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC -->
389
391
 
@@ -394,33 +396,35 @@
394
396
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
395
397
  </xsl:if>
396
398
 
397
- <fo:list-block>
398
- <xsl:attribute name="provisional-distance-between-starts">
399
- <xsl:choose>
400
- <!-- skip 0 section without subsections -->
401
- <xsl:when test="@section != ''">8mm</xsl:when> <!-- and not(@display-section = 'false') -->
402
- <xsl:otherwise>0mm</xsl:otherwise>
403
- </xsl:choose>
404
- </xsl:attribute>
405
- <fo:list-item>
406
- <fo:list-item-label end-indent="label-end()">
407
- <fo:block>
408
- <xsl:value-of select="@section"/>
409
- </fo:block>
410
- </fo:list-item-label>
411
- <fo:list-item-body start-indent="body-start()">
412
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
413
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
414
- <xsl:apply-templates select="title"/>
415
- <fo:inline keep-together.within-line="always">
416
- <fo:leader leader-pattern="dots"/>
417
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
418
- </fo:inline>
419
- </fo:basic-link>
420
- </fo:block>
421
- </fo:list-item-body>
422
- </fo:list-item>
423
- </fo:list-block>
399
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section} {title}"> <!-- link at this level needs for PDF structure tags -->
400
+ <fo:list-block role="SKIP">
401
+ <xsl:attribute name="provisional-distance-between-starts">
402
+ <xsl:choose>
403
+ <!-- skip 0 section without subsections -->
404
+ <xsl:when test="@section != ''">8mm</xsl:when> <!-- and not(@display-section = 'false') -->
405
+ <xsl:otherwise>0mm</xsl:otherwise>
406
+ </xsl:choose>
407
+ </xsl:attribute>
408
+ <fo:list-item role="SKIP">
409
+ <fo:list-item-label end-indent="label-end()" role="SKIP">
410
+ <fo:block role="SKIP" id="__internal_layout__toc_label_{@id}">
411
+ <xsl:value-of select="@section"/>
412
+ </fo:block>
413
+ </fo:list-item-label>
414
+ <fo:list-item-body start-indent="body-start()" role="SKIP">
415
+ <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm" role="SKIP">
416
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}" role="SKIP">
417
+ <xsl:apply-templates select="title"/>
418
+ <fo:inline keep-together.within-line="always" role="SKIP">
419
+ <fo:leader leader-pattern="dots"/>
420
+ <fo:inline role="SKIP"><fo:wrapper role="artifact"><fo:page-number-citation ref-id="{@id}"/></fo:wrapper></fo:inline>
421
+ </fo:inline>
422
+ </fo:basic-link>
423
+ </fo:block>
424
+ </fo:list-item-body>
425
+ </fo:list-item>
426
+ </fo:list-block>
427
+ </fo:basic-link>
424
428
  </fo:block>
425
429
  </xsl:for-each>
426
430
 
@@ -3961,7 +3965,8 @@
3961
3965
  </xsl:choose>
3962
3966
  </xsl:variable>
3963
3967
  <xsl:variable name="current_fn_number_text">
3964
- <xsl:value-of select="$current_fn_number"/>
3968
+
3969
+ <xsl:value-of select="$current_fn_number"/>
3965
3970
 
3966
3971
  </xsl:variable>
3967
3972
 
@@ -3997,8 +4002,10 @@
3997
4002
 
3998
4003
  <xsl:call-template name="insert_basic_link">
3999
4004
  <xsl:with-param name="element">
4000
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
4001
- <xsl:copy-of select="$current_fn_number_text"/>
4005
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
4006
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
4007
+ <xsl:copy-of select="$current_fn_number_text"/>
4008
+ </fo:inline>
4002
4009
  </fo:basic-link>
4003
4010
  </xsl:with-param>
4004
4011
  </xsl:call-template>
@@ -4279,7 +4286,7 @@
4279
4286
 
4280
4287
  <xsl:call-template name="refine_fn-reference-style"/>
4281
4288
 
4282
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4289
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4283
4290
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
4284
4291
  <xsl:attribute name="internal-destination">
4285
4292
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -5280,9 +5287,19 @@
5280
5287
  </fo:inline>
5281
5288
  </xsl:template>
5282
5289
 
5283
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
5290
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
5291
+ <xsl:param name="txt"/>
5284
5292
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
5285
- <xsl:variable name="text" select="."/>
5293
+ <xsl:variable name="text">
5294
+ <xsl:choose>
5295
+ <xsl:when test="$txt != ''">
5296
+ <xsl:value-of select="$txt"/>
5297
+ </xsl:when>
5298
+ <xsl:otherwise>
5299
+ <xsl:value-of select="."/>
5300
+ </xsl:otherwise>
5301
+ </xsl:choose>
5302
+ </xsl:variable>
5286
5303
  <xsl:variable name="ratio_">
5287
5304
  0.75
5288
5305
  </xsl:variable>
@@ -6728,9 +6745,12 @@
6728
6745
  <xsl:apply-templates/>
6729
6746
  </xsl:when>
6730
6747
  <xsl:otherwise>
6748
+ <xsl:variable name="alt_text">
6749
+ <xsl:call-template name="getAltText"/>
6750
+ </xsl:variable>
6731
6751
  <xsl:call-template name="insert_basic_link">
6732
6752
  <xsl:with-param name="element">
6733
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6753
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
6734
6754
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
6735
6755
  <xsl:attribute name="role">Annot</xsl:attribute>
6736
6756
  </xsl:if>
@@ -6757,6 +6777,14 @@
6757
6777
  </fo:inline>
6758
6778
  </xsl:template> <!-- link -->
6759
6779
 
6780
+ <xsl:template name="getAltText">
6781
+ <xsl:choose>
6782
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
6783
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
6784
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
6785
+ </xsl:choose>
6786
+ </xsl:template>
6787
+
6760
6788
  <!-- ======================== -->
6761
6789
  <!-- Appendix processing -->
6762
6790
  <!-- ======================== -->
@@ -6787,7 +6815,7 @@
6787
6815
  <xsl:template match="*[local-name() = 'callout']">
6788
6816
  <xsl:choose>
6789
6817
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
6790
- <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
6818
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
6791
6819
  </xsl:choose>
6792
6820
  </xsl:template>
6793
6821
 
@@ -6816,7 +6844,10 @@
6816
6844
  <xsl:template match="*[local-name() = 'xref']">
6817
6845
  <xsl:call-template name="insert_basic_link">
6818
6846
  <xsl:with-param name="element">
6819
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6847
+ <xsl:variable name="alt_text">
6848
+ <xsl:call-template name="getAltText"/>
6849
+ </xsl:variable>
6850
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
6820
6851
  <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
6821
6852
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6822
6853
  </xsl:if>
@@ -9297,12 +9328,14 @@
9297
9328
 
9298
9329
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
9299
9330
 
9300
- <xsl:variable name="provisional_distance_between_starts">
9331
+ <xsl:variable name="provisional_distance_between_starts_">
9301
9332
  7
9302
9333
  </xsl:variable>
9303
- <xsl:variable name="indent">
9334
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
9335
+ <xsl:variable name="indent_">
9304
9336
  0
9305
9337
  </xsl:variable>
9338
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
9306
9339
 
9307
9340
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
9308
9341
  <fo:list-item>
@@ -10032,14 +10065,17 @@
10032
10065
  </xsl:when>
10033
10066
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
10034
10067
 
10035
- <xsl:variable name="label">
10068
+ <xsl:variable name="type" select="../@type"/>
10036
10069
 
10037
- <xsl:variable name="type" select="../@type"/>
10070
+ <xsl:variable name="label">
10038
10071
 
10039
10072
  <xsl:variable name="style_prefix_">
10040
10073
  <xsl:if test="$type = 'roman'">
10041
10074
  <!-- Example: (i) -->
10042
10075
  </xsl:if>
10076
+ <xsl:if test="$type = 'alphabet'">
10077
+
10078
+ </xsl:if>
10043
10079
  </xsl:variable>
10044
10080
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
10045
10081
 
@@ -10065,13 +10101,15 @@
10065
10101
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
10066
10102
  <xsl:value-of select="$style_prefix"/>
10067
10103
  </xsl:if>
10104
+
10068
10105
  <xsl:value-of select="@label"/>
10106
+
10069
10107
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
10070
10108
  <xsl:value-of select="$style_suffix"/>
10071
10109
  </xsl:if>
10072
10110
  </xsl:variable>
10073
10111
 
10074
- <xsl:value-of select="normalize-space($label)"/>
10112
+ <xsl:value-of select="normalize-space($label)"/>
10075
10113
 
10076
10114
  </xsl:when>
10077
10115
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -12273,7 +12311,8 @@
12273
12311
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
12274
12312
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
12275
12313
  <!-- Todo: need update -->
12276
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12314
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
12315
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
12277
12316
 
12278
12317
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
12279
12318
  <xsl:attribute name="src">
@@ -12294,6 +12333,9 @@
12294
12333
  <xsl:if test="$afrelationship != ''">
12295
12334
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12296
12335
  </xsl:if>
12336
+ <xsl:if test="$volatile != ''">
12337
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
12338
+ </xsl:if>
12297
12339
  </pdf:embedded-file>
12298
12340
  </xsl:for-each>
12299
12341
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -12304,14 +12346,18 @@
12304
12346
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12305
12347
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12306
12348
  <!-- Todo: need update -->
12307
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12349
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
12350
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
12308
12351
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
12309
12352
  <xsl:if test="$description != ''">
12310
12353
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12311
12354
  </xsl:if>
12312
12355
  <xsl:if test="$afrelationship != ''">
12313
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12314
- </xsl:if>
12356
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12357
+ </xsl:if>
12358
+ <xsl:if test="$volatile != ''">
12359
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
12360
+ </xsl:if>
12315
12361
  </pdf:embedded-file>
12316
12362
  </xsl:for-each>
12317
12363
  </xsl:if>
@@ -12358,10 +12404,31 @@
12358
12404
  <xsl:value-of select="$level_total - 2"/>
12359
12405
  </xsl:when>
12360
12406
  <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
12361
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
12407
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
12408
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
12409
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
12410
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
12411
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
12412
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
12413
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
12414
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
12415
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
12416
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
12417
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
12362
12418
  <xsl:choose>
12363
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12364
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
12419
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
12420
+ <xsl:value-of select="number($curr_clause_depth)"/>
12421
+ </xsl:when>
12422
+ <xsl:otherwise>
12423
+ <xsl:value-of select="$level_total - 2"/>
12424
+ </xsl:otherwise>
12425
+ </xsl:choose>
12426
+ </xsl:when>
12427
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
12428
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
12429
+ <xsl:choose>
12430
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
12431
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
12365
12432
  </xsl:when>
12366
12433
  <xsl:otherwise>
12367
12434
  <xsl:value-of select="$level_total - 2"/>
@@ -12369,7 +12436,7 @@
12369
12436
  </xsl:choose>
12370
12437
  </xsl:when>
12371
12438
  <xsl:when test="ancestor::*[local-name() = 'sections']">
12372
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
12439
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
12373
12440
  <xsl:choose>
12374
12441
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12375
12442
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -4,7 +4,7 @@ require_relative "init"
4
4
  require "isodoc"
5
5
 
6
6
  module IsoDoc
7
- module CC
7
+ module Cc
8
8
  # A {Converter} implementation that generates CC output, and a document
9
9
  # schema encapsulation of the document for validation
10
10
  class HtmlConvert < IsoDoc::Generic::HtmlConvert
@@ -1,8 +1,8 @@
1
1
  module IsoDoc
2
- module CC
2
+ module Cc
3
3
  class I18n < IsoDoc::Generic::I18n
4
4
  def configuration
5
- Metanorma::CC.configuration
5
+ Metanorma::Cc.configuration
6
6
  end
7
7
  end
8
8
  end
@@ -4,7 +4,7 @@ require_relative "xref"
4
4
  require_relative "i18n"
5
5
 
6
6
  module IsoDoc
7
- module CC
7
+ module Cc
8
8
  module Init
9
9
  def metadata_init(lang, script, locale, i18n)
10
10
  @meta = Metadata.new(lang, script, locale, i18n)
@@ -2,10 +2,10 @@ require "isodoc"
2
2
  require "metanorma/cc"
3
3
 
4
4
  module IsoDoc
5
- module CC
5
+ module Cc
6
6
  class Metadata < IsoDoc::Generic::Metadata
7
7
  def configuration
8
- Metanorma::CC.configuration
8
+ Metanorma::Cc.configuration
9
9
  end
10
10
 
11
11
  def initialize(lang, script, locale, labels)
@@ -3,7 +3,7 @@ require "metanorma-generic"
3
3
  require "isodoc"
4
4
 
5
5
  module IsoDoc
6
- module CC
6
+ module Cc
7
7
  class PdfConvert < IsoDoc::Generic::PdfConvert
8
8
  def initialize(options)
9
9
  @libdir = File.dirname(__FILE__)
@@ -3,7 +3,7 @@ require "metanorma-generic"
3
3
  require "isodoc"
4
4
 
5
5
  module IsoDoc
6
- module CC
6
+ module Cc
7
7
  class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
8
8
  def annex1(elem)
9
9
  lbl = @xrefs.anchor(elem["id"], :label)
@@ -4,7 +4,7 @@ require_relative "init"
4
4
  require "isodoc"
5
5
 
6
6
  module IsoDoc
7
- module CC
7
+ module Cc
8
8
  # A {Converter} implementation that generates CSD output, and a document
9
9
  # schema encapsulation of the document for validation
10
10
  class WordConvert < IsoDoc::Generic::WordConvert
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module CC
2
+ module Cc
3
3
  class Xref < IsoDoc::Generic::Xref
4
4
  end
5
5
  end
@@ -72,6 +72,9 @@ standards defining organization, and that is rendered in a distinct manner</a:do
72
72
  from other documents in the same doctype</a:documentation>
73
73
  </ref>
74
74
  </optional>
75
+ <ref name="flavor">
76
+ <a:documentation>Flavour of Metanorma used to process this document</a:documentation>
77
+ </ref>
75
78
  <optional>
76
79
  <ref name="editorialgroup">
77
80
  <a:documentation>Groups associated with the production of the standards document, typically within
@@ -113,6 +116,16 @@ a standards definition organization</a:documentation>
113
116
  <define name="DocumentSubtype">
114
117
  <text/>
115
118
  </define>
119
+ <define name="flavor">
120
+ <element name="flavor">
121
+ <ref name="MetanormaFlavor"/>
122
+ </element>
123
+ </define>
124
+ <define name="MetanormaFlavor">
125
+ <a:documentation>This is in fact an enum, as of this writing: standoc iso generic ietf ieee itu nist ogc csa cc iho ribose jis iec bsi bipm plateau.
126
+ However we prefer not to hardcode it, given ongoing extension.</a:documentation>
127
+ <text/>
128
+ </define>
116
129
  <define name="editorialgroup">
117
130
  <a:documentation>A group associated with the production of the standards document, typically within
118
131
  a standards definition organization</a:documentation>
@@ -1382,18 +1382,7 @@ Applies whether the resource has already been created or not, and whether it is
1382
1382
  <define name="bdate">
1383
1383
  <a:documentation>Significant date in the lifecycle of the bibliographic item, including its production and its access</a:documentation>
1384
1384
  <element name="date">
1385
- <attribute name="type">
1386
- <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1387
- <choice>
1388
- <ref name="BibliographicDateType"/>
1389
- <text/>
1390
- </choice>
1391
- </attribute>
1392
- <optional>
1393
- <attribute name="text">
1394
- <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1395
- </attribute>
1396
- </optional>
1385
+ <ref name="bDateAttributes"/>
1397
1386
  <optional>
1398
1387
  <choice>
1399
1388
  <group>
@@ -1416,6 +1405,20 @@ Applies whether the resource has already been created or not, and whether it is
1416
1405
  </optional>
1417
1406
  </element>
1418
1407
  </define>
1408
+ <define name="bDateAttributes">
1409
+ <attribute name="type">
1410
+ <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1411
+ <choice>
1412
+ <ref name="BibliographicDateType"/>
1413
+ <text/>
1414
+ </choice>
1415
+ </attribute>
1416
+ <optional>
1417
+ <attribute name="text">
1418
+ <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1419
+ </attribute>
1420
+ </optional>
1421
+ </define>
1419
1422
  <define name="docidentifier">
1420
1423
  <a:documentation>An identifier of a bibliographic item in an international standard scheme</a:documentation>
1421
1424
  <element name="docidentifier">
@@ -1884,6 +1887,10 @@ Detailed in https://www.relaton.org/model/relations/</a:documentation>
1884
1887
  <value>hasAnnotation</value>
1885
1888
  <value>draftOf</value>
1886
1889
  <value>hasDraft</value>
1890
+ <value>preliminaryDraftOf</value>
1891
+ <value>hasPreliminaryDraft</value>
1892
+ <value>revisionDraftOf</value>
1893
+ <value>hasRevisionDraft</value>
1887
1894
  <value>editionOf</value>
1888
1895
  <value>hasEdition</value>
1889
1896
  <value>updates</value>
@@ -8,12 +8,12 @@ require "metanorma/generic/converter"
8
8
  require_relative "validate_section"
9
9
 
10
10
  module Metanorma
11
- module CC
11
+ module Cc
12
12
  class Converter < Metanorma::Generic::Converter
13
13
  register_for "cc"
14
14
 
15
15
  def configuration
16
- Metanorma::CC.configuration
16
+ Metanorma::Cc.configuration
17
17
  end
18
18
 
19
19
  def metadata_committee(node, xml)
@@ -43,23 +43,23 @@ module Metanorma
43
43
  end
44
44
 
45
45
  def html_converter(node)
46
- IsoDoc::CC::HtmlConvert.new(html_extract_attributes(node))
46
+ IsoDoc::Cc::HtmlConvert.new(html_extract_attributes(node))
47
47
  end
48
48
 
49
49
  def pdf_converter(node)
50
50
  return if node.attr("no-pdf")
51
51
 
52
- IsoDoc::CC::PdfConvert.new(pdf_extract_attributes(node))
52
+ IsoDoc::Cc::PdfConvert.new(pdf_extract_attributes(node))
53
53
  end
54
54
 
55
55
  def doc_converter(node)
56
- IsoDoc::CC::WordConvert.new(doc_extract_attributes(node))
56
+ IsoDoc::Cc::WordConvert.new(doc_extract_attributes(node))
57
57
  end
58
58
 
59
59
  def presentation_xml_converter(node)
60
- IsoDoc::CC::PresentationXMLConvert
60
+ IsoDoc::Cc::PresentationXMLConvert
61
61
  .new(doc_extract_attributes(node)
62
- .merge(output_formats: ::Metanorma::CC::Processor.new.output_formats))
62
+ .merge(output_formats: ::Metanorma::Cc::Processor.new.output_formats))
63
63
  end
64
64
  end
65
65
  end
@@ -1,10 +1,10 @@
1
1
  require "metanorma/processor"
2
2
 
3
3
  module Metanorma
4
- module CC
4
+ module Cc
5
5
  class Processor < Metanorma::Generic::Processor
6
6
  def configuration
7
- Metanorma::CC.configuration
7
+ Metanorma::Cc.configuration
8
8
  end
9
9
 
10
10
  def initialize
@@ -22,20 +22,20 @@ module Metanorma
22
22
  end
23
23
 
24
24
  def version
25
- "Metanorma::CC #{Metanorma::CC::VERSION}"
25
+ "Metanorma::Cc #{Metanorma::Cc::VERSION}"
26
26
  end
27
27
 
28
28
  def output(isodoc_node, inname, outname, format, options={})
29
29
  options_preprocess(options)
30
30
  case format
31
31
  when :html
32
- IsoDoc::CC::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
32
+ IsoDoc::Cc::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
33
33
  when :doc
34
- IsoDoc::CC::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
34
+ IsoDoc::Cc::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
35
35
  when :pdf
36
- IsoDoc::CC::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
36
+ IsoDoc::Cc::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
37
37
  when :presentation
38
- IsoDoc::CC::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
38
+ IsoDoc::Cc::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
39
39
  else
40
40
  super
41
41
  end
@@ -24,6 +24,7 @@
24
24
  <optional>
25
25
  <ref name="docsubtype"/>
26
26
  </optional>
27
+ <ref name="flavor"/>
27
28
  <ref name="editorialgroup"/>
28
29
  <zeroOrMore>
29
30
  <ref name="ics"/>
@@ -2,7 +2,7 @@ require "nokogiri"
2
2
  require "metanorma-generic"
3
3
 
4
4
  module Metanorma
5
- module CC
5
+ module Cc
6
6
  class Converter < Metanorma::Generic::Converter
7
7
  def section_validate(doc)
8
8
  advisory = doc.root.at("//bibdata/ext[doctype = 'advisory']")
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
- module CC
3
- VERSION = "2.5.3".freeze
2
+ module Cc
3
+ VERSION = "2.5.4".freeze
4
4
  end
5
5
  end
data/lib/metanorma/cc.rb CHANGED
@@ -3,7 +3,7 @@ require "metanorma-generic"
3
3
  require_relative "./cc/processor"
4
4
 
5
5
  module Metanorma
6
- module CC
6
+ module Cc
7
7
  class Configuration < Metanorma::Generic::Configuration
8
8
  def initialize(*args)
9
9
  super
@@ -28,5 +28,5 @@ module Metanorma
28
28
  configure {}
29
29
  end
30
30
  end
31
- Metanorma::Registry.instance.register(Metanorma::CC::Processor)
31
+ Metanorma::Registry.instance.register(Metanorma::Cc::Processor)
32
32
 
data/lib/metanorma-cc.rb CHANGED
@@ -8,5 +8,5 @@ require "metanorma"
8
8
 
9
9
  if defined? Metanorma::Registry
10
10
  require_relative "metanorma/cc"
11
- Metanorma::Registry.instance.register(Metanorma::CC::Processor)
11
+ Metanorma::Registry.instance.register(Metanorma::Cc::Processor)
12
12
  end
data/metanorma-cc.gemspec CHANGED
@@ -4,7 +4,7 @@ require "metanorma/cc/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "metanorma-cc"
7
- spec.version = Metanorma::CC::VERSION
7
+ spec.version = Metanorma::Cc::VERSION
8
8
  spec.authors = ["Ribose Inc."]
9
9
  spec.email = ["open.source@ribose.com"]
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.3
4
+ version: 2.5.4
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-09-30 00:00:00.000000000 Z
11
+ date: 2024-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic