metanorma-iho 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfa68a7ffe1430399e0dae0f788dd4de9d933479e31436f64499856bb76e1753
4
- data.tar.gz: 14207a7b252242d513aec10c13fe406c74f4f1716dc2cebb11e467f6c8778d62
3
+ metadata.gz: 7ae738e44bf15f8616585eefcf73748f06a1f19e1512f3fa5e8cc3673fcdecd1
4
+ data.tar.gz: 8fbc1044cc8bfb84a6198ec0b57762b5b00d0773e709d0e0776d888905863088
5
5
  SHA512:
6
- metadata.gz: 31cddfdd884b8d3b7544f93ed192292200d7501e32d510b93fa02f86cf12ba41c84e6ab88b1e5ae27f9c0d39bab00774bf245a52fcc6a01eed6d489b231f99c1
7
- data.tar.gz: 442ac35c26009e19f29e832ce7aeccf49c7bacea6876eeeeb22fae1d50828a2803a6b6f11a22721bc30b2084f7db7889e531a4788f0e3367bc516a39f3ce1480
6
+ metadata.gz: 98bccac147327950cbe4a9eb25237000391f094d571650e1eba37b423e9e65209a32637c66e84fa3ddf0eacc97a4bc8ddf36eb8c1f2572a20609fa97f9282e14
7
+ data.tar.gz: 606940728ca24bdef678f528b9cf0658592c50e3c7a04a5231bd38a01d86095bb9134d893894d4e75e1b2abd1a6b31ecbf17053c0efdacc013e17ad26b0af0a8
@@ -82,6 +82,9 @@ p kbd, dt kbd, li kbd, label kbd, legend kbd, caption kbd, th kbd, td kbd,
82
82
  p samp, dt samp, li samp, label samp, legend samp, caption samp, th samp, td samp {
83
83
  font-size: {{monospacefontsize}}; }
84
84
 
85
+ sub, sup {
86
+ font-size: 0.75em; }
87
+
85
88
  article, aside, details, figcaption, figure,
86
89
  footer, header, hgroup, menu, nav, section {
87
90
  display: block; }
@@ -1,4 +1,4 @@
1
1
  table_of_contents: Contents
2
- clause: Chapter
3
- subclause: Section
2
+ clause: Section
3
+ subclause: Clause
4
4
  dochistory: Document History
@@ -4081,6 +4081,7 @@
4081
4081
 
4082
4082
  <fo:block role="SKIP">
4083
4083
  <xsl:apply-templates/>
4084
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
4084
4085
  </fo:block>
4085
4086
  </fo:table-cell>
4086
4087
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -4144,6 +4145,8 @@
4144
4145
 
4145
4146
  <xsl:if test="$isGenerateTableIF = 'true'"> <fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
4146
4147
 
4148
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
4149
+
4147
4150
  </fo:block>
4148
4151
  </fo:table-cell>
4149
4152
  </xsl:template> <!-- td -->
@@ -7005,14 +7008,16 @@
7005
7008
  <xsl:template match="*[local-name()='link']" name="link">
7006
7009
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
7007
7010
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
7011
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
7008
7012
  <xsl:variable name="target">
7009
7013
  <xsl:choose>
7010
7014
  <xsl:when test="@updatetype = 'true'">
7011
7015
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
7012
7016
  </xsl:when>
7013
7017
  <!-- link to the PDF attachment -->
7014
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
7015
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
7018
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
7019
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
7020
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
7016
7021
  </xsl:when>
7017
7022
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
7018
7023
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -7043,6 +7048,11 @@
7043
7048
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7044
7049
  </xsl:if>
7045
7050
 
7051
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
7052
+ <xsl:attribute name="color">inherit</xsl:attribute>
7053
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
7054
+ </xsl:if>
7055
+
7046
7056
  <xsl:call-template name="refine_link-style"/>
7047
7057
 
7048
7058
  <xsl:choose>
@@ -7053,6 +7063,9 @@
7053
7063
  <xsl:call-template name="insert_basic_link">
7054
7064
  <xsl:with-param name="element">
7055
7065
  <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
7066
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
7067
+ <xsl:attribute name="role">Annot</xsl:attribute>
7068
+ </xsl:if>
7056
7069
  <xsl:choose>
7057
7070
  <xsl:when test="normalize-space(.) = ''">
7058
7071
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -7065,6 +7078,10 @@
7065
7078
  </xsl:otherwise>
7066
7079
  </xsl:choose>
7067
7080
  </fo:basic-link>
7081
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
7082
+ <!-- reserve space at right for PaperClip icon -->
7083
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
7084
+ </xsl:if>
7068
7085
  </xsl:with-param>
7069
7086
  </xsl:call-template>
7070
7087
  </xsl:otherwise>
@@ -12574,9 +12591,14 @@
12574
12591
  </x:xmpmeta>
12575
12592
  <!-- add attachments -->
12576
12593
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12577
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
12578
-
12579
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
12594
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
12595
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
12596
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
12597
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
12598
+ <!-- Todo: need update -->
12599
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12600
+
12601
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
12580
12602
  <xsl:attribute name="src">
12581
12603
  <xsl:choose>
12582
12604
  <xsl:when test="normalize-space() != ''">
@@ -12592,18 +12614,27 @@
12592
12614
  <xsl:if test="$description != ''">
12593
12615
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12594
12616
  </xsl:if>
12617
+ <xsl:if test="$afrelationship != ''">
12618
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12619
+ </xsl:if>
12595
12620
  </pdf:embedded-file>
12596
12621
  </xsl:for-each>
12597
12622
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
12598
12623
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
12599
12624
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
12600
12625
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
12626
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
12601
12627
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12602
12628
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12603
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
12629
+ <!-- Todo: need update -->
12630
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12631
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
12604
12632
  <xsl:if test="$description != ''">
12605
12633
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12606
12634
  </xsl:if>
12635
+ <xsl:if test="$afrelationship != ''">
12636
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12637
+ </xsl:if>
12607
12638
  </pdf:embedded-file>
12608
12639
  </xsl:for-each>
12609
12640
  </xsl:if>
@@ -12623,6 +12654,12 @@
12623
12654
  <!-- Get or calculate depth of the element -->
12624
12655
  <xsl:template name="getLevel">
12625
12656
  <xsl:param name="depth"/>
12657
+ <!-- <xsl:message>
12658
+ <xsl:choose>
12659
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
12660
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
12661
+ </xsl:choose>
12662
+ </xsl:message> -->
12626
12663
  <xsl:choose>
12627
12664
  <xsl:when test="normalize-space(@depth) != ''">
12628
12665
  <xsl:value-of select="@depth"/>
@@ -12643,8 +12680,27 @@
12643
12680
  <xsl:when test="ancestor::*[local-name() = 'preface']">
12644
12681
  <xsl:value-of select="$level_total - 2"/>
12645
12682
  </xsl:when>
12683
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
12684
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
12685
+ <xsl:choose>
12686
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12687
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
12688
+ </xsl:when>
12689
+ <xsl:otherwise>
12690
+ <xsl:value-of select="$level_total - 2"/>
12691
+ </xsl:otherwise>
12692
+ </xsl:choose>
12693
+ </xsl:when>
12646
12694
  <xsl:when test="ancestor::*[local-name() = 'sections']">
12647
- <xsl:value-of select="$level_total - 1"/>
12695
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
12696
+ <xsl:choose>
12697
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12698
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
12699
+ </xsl:when>
12700
+ <xsl:otherwise>
12701
+ <xsl:value-of select="$level_total - 1"/>
12702
+ </xsl:otherwise>
12703
+ </xsl:choose>
12648
12704
  </xsl:when>
12649
12705
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
12650
12706
  <xsl:value-of select="$level_total - 1"/>
@@ -12652,6 +12708,17 @@
12652
12708
  <xsl:when test="parent::*[local-name() = 'annex']">
12653
12709
  <xsl:value-of select="$level_total - 1"/>
12654
12710
  </xsl:when>
12711
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
12712
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
12713
+ <xsl:choose>
12714
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12715
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
12716
+ </xsl:when>
12717
+ <xsl:otherwise>
12718
+ <xsl:value-of select="$level_total - 1"/>
12719
+ </xsl:otherwise>
12720
+ </xsl:choose>
12721
+ </xsl:when>
12655
12722
  <xsl:when test="ancestor::*[local-name() = 'annex']">
12656
12723
  <xsl:value-of select="$level_total"/>
12657
12724
  </xsl:when>
@@ -13010,6 +13077,20 @@
13010
13077
 
13011
13078
  <!-- END: insert cover page image -->
13012
13079
 
13080
+ <xsl:template name="insertVerticalChar">
13081
+ <xsl:param name="str"/>
13082
+ <xsl:if test="string-length($str) &gt; 0">
13083
+ <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
13084
+ <fo:block-container width="1em">
13085
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
13086
+ </fo:block-container>
13087
+ </fo:inline-container>
13088
+ <xsl:call-template name="insertVerticalChar">
13089
+ <xsl:with-param name="str" select="substring($str, 2)"/>
13090
+ </xsl:call-template>
13091
+ </xsl:if>
13092
+ </xsl:template>
13093
+
13013
13094
  <xsl:template name="number-to-words">
13014
13095
  <xsl:param name="number"/>
13015
13096
  <xsl:param name="first"/>
@@ -13297,4 +13378,18 @@
13297
13378
  </xsl:if>
13298
13379
  </xsl:template>
13299
13380
 
13381
+ <xsl:template match="@*|node()" mode="set_table_role_skip">
13382
+ <xsl:copy>
13383
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
13384
+ </xsl:copy>
13385
+ </xsl:template>
13386
+
13387
+ <xsl:template match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
13388
+ <xsl:copy>
13389
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
13390
+ <xsl:attribute name="role">SKIP</xsl:attribute>
13391
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
13392
+ </xsl:copy>
13393
+ </xsl:template>
13394
+
13300
13395
  </xsl:stylesheet>
@@ -4081,6 +4081,7 @@
4081
4081
 
4082
4082
  <fo:block role="SKIP">
4083
4083
  <xsl:apply-templates/>
4084
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
4084
4085
  </fo:block>
4085
4086
  </fo:table-cell>
4086
4087
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -4144,6 +4145,8 @@
4144
4145
 
4145
4146
  <xsl:if test="$isGenerateTableIF = 'true'"> <fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
4146
4147
 
4148
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
4149
+
4147
4150
  </fo:block>
4148
4151
  </fo:table-cell>
4149
4152
  </xsl:template> <!-- td -->
@@ -7005,14 +7008,16 @@
7005
7008
  <xsl:template match="*[local-name()='link']" name="link">
7006
7009
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
7007
7010
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
7011
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
7008
7012
  <xsl:variable name="target">
7009
7013
  <xsl:choose>
7010
7014
  <xsl:when test="@updatetype = 'true'">
7011
7015
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
7012
7016
  </xsl:when>
7013
7017
  <!-- link to the PDF attachment -->
7014
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
7015
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
7018
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
7019
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
7020
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
7016
7021
  </xsl:when>
7017
7022
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
7018
7023
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -7043,6 +7048,11 @@
7043
7048
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7044
7049
  </xsl:if>
7045
7050
 
7051
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
7052
+ <xsl:attribute name="color">inherit</xsl:attribute>
7053
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
7054
+ </xsl:if>
7055
+
7046
7056
  <xsl:call-template name="refine_link-style"/>
7047
7057
 
7048
7058
  <xsl:choose>
@@ -7053,6 +7063,9 @@
7053
7063
  <xsl:call-template name="insert_basic_link">
7054
7064
  <xsl:with-param name="element">
7055
7065
  <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
7066
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
7067
+ <xsl:attribute name="role">Annot</xsl:attribute>
7068
+ </xsl:if>
7056
7069
  <xsl:choose>
7057
7070
  <xsl:when test="normalize-space(.) = ''">
7058
7071
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -7065,6 +7078,10 @@
7065
7078
  </xsl:otherwise>
7066
7079
  </xsl:choose>
7067
7080
  </fo:basic-link>
7081
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
7082
+ <!-- reserve space at right for PaperClip icon -->
7083
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
7084
+ </xsl:if>
7068
7085
  </xsl:with-param>
7069
7086
  </xsl:call-template>
7070
7087
  </xsl:otherwise>
@@ -12574,9 +12591,14 @@
12574
12591
  </x:xmpmeta>
12575
12592
  <!-- add attachments -->
12576
12593
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12577
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
12578
-
12579
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
12594
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
12595
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
12596
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
12597
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
12598
+ <!-- Todo: need update -->
12599
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12600
+
12601
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
12580
12602
  <xsl:attribute name="src">
12581
12603
  <xsl:choose>
12582
12604
  <xsl:when test="normalize-space() != ''">
@@ -12592,18 +12614,27 @@
12592
12614
  <xsl:if test="$description != ''">
12593
12615
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12594
12616
  </xsl:if>
12617
+ <xsl:if test="$afrelationship != ''">
12618
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12619
+ </xsl:if>
12595
12620
  </pdf:embedded-file>
12596
12621
  </xsl:for-each>
12597
12622
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
12598
12623
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
12599
12624
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
12600
12625
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
12626
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
12601
12627
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12602
12628
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12603
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
12629
+ <!-- Todo: need update -->
12630
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12631
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
12604
12632
  <xsl:if test="$description != ''">
12605
12633
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12606
12634
  </xsl:if>
12635
+ <xsl:if test="$afrelationship != ''">
12636
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12637
+ </xsl:if>
12607
12638
  </pdf:embedded-file>
12608
12639
  </xsl:for-each>
12609
12640
  </xsl:if>
@@ -12623,6 +12654,12 @@
12623
12654
  <!-- Get or calculate depth of the element -->
12624
12655
  <xsl:template name="getLevel">
12625
12656
  <xsl:param name="depth"/>
12657
+ <!-- <xsl:message>
12658
+ <xsl:choose>
12659
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
12660
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
12661
+ </xsl:choose>
12662
+ </xsl:message> -->
12626
12663
  <xsl:choose>
12627
12664
  <xsl:when test="normalize-space(@depth) != ''">
12628
12665
  <xsl:value-of select="@depth"/>
@@ -12643,8 +12680,27 @@
12643
12680
  <xsl:when test="ancestor::*[local-name() = 'preface']">
12644
12681
  <xsl:value-of select="$level_total - 2"/>
12645
12682
  </xsl:when>
12683
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
12684
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
12685
+ <xsl:choose>
12686
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12687
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
12688
+ </xsl:when>
12689
+ <xsl:otherwise>
12690
+ <xsl:value-of select="$level_total - 2"/>
12691
+ </xsl:otherwise>
12692
+ </xsl:choose>
12693
+ </xsl:when>
12646
12694
  <xsl:when test="ancestor::*[local-name() = 'sections']">
12647
- <xsl:value-of select="$level_total - 1"/>
12695
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
12696
+ <xsl:choose>
12697
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12698
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
12699
+ </xsl:when>
12700
+ <xsl:otherwise>
12701
+ <xsl:value-of select="$level_total - 1"/>
12702
+ </xsl:otherwise>
12703
+ </xsl:choose>
12648
12704
  </xsl:when>
12649
12705
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
12650
12706
  <xsl:value-of select="$level_total - 1"/>
@@ -12652,6 +12708,17 @@
12652
12708
  <xsl:when test="parent::*[local-name() = 'annex']">
12653
12709
  <xsl:value-of select="$level_total - 1"/>
12654
12710
  </xsl:when>
12711
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
12712
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
12713
+ <xsl:choose>
12714
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12715
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
12716
+ </xsl:when>
12717
+ <xsl:otherwise>
12718
+ <xsl:value-of select="$level_total - 1"/>
12719
+ </xsl:otherwise>
12720
+ </xsl:choose>
12721
+ </xsl:when>
12655
12722
  <xsl:when test="ancestor::*[local-name() = 'annex']">
12656
12723
  <xsl:value-of select="$level_total"/>
12657
12724
  </xsl:when>
@@ -13010,6 +13077,20 @@
13010
13077
 
13011
13078
  <!-- END: insert cover page image -->
13012
13079
 
13080
+ <xsl:template name="insertVerticalChar">
13081
+ <xsl:param name="str"/>
13082
+ <xsl:if test="string-length($str) &gt; 0">
13083
+ <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
13084
+ <fo:block-container width="1em">
13085
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
13086
+ </fo:block-container>
13087
+ </fo:inline-container>
13088
+ <xsl:call-template name="insertVerticalChar">
13089
+ <xsl:with-param name="str" select="substring($str, 2)"/>
13090
+ </xsl:call-template>
13091
+ </xsl:if>
13092
+ </xsl:template>
13093
+
13013
13094
  <xsl:template name="number-to-words">
13014
13095
  <xsl:param name="number"/>
13015
13096
  <xsl:param name="first"/>
@@ -13297,4 +13378,18 @@
13297
13378
  </xsl:if>
13298
13379
  </xsl:template>
13299
13380
 
13381
+ <xsl:template match="@*|node()" mode="set_table_role_skip">
13382
+ <xsl:copy>
13383
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
13384
+ </xsl:copy>
13385
+ </xsl:template>
13386
+
13387
+ <xsl:template match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
13388
+ <xsl:copy>
13389
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
13390
+ <xsl:attribute name="role">SKIP</xsl:attribute>
13391
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
13392
+ </xsl:copy>
13393
+ </xsl:template>
13394
+
13300
13395
  </xsl:stylesheet>
@@ -117,6 +117,10 @@ _bib)
117
117
  end
118
118
  end
119
119
 
120
+ def clausedelim
121
+ ""
122
+ end
123
+
120
124
  include Init
121
125
  end
122
126
  end
@@ -6,6 +6,10 @@ module IsoDoc
6
6
  end
7
7
 
8
8
  class Xref < IsoDoc::Generic::Xref
9
+ def hiersep
10
+ "-"
11
+ end
12
+
9
13
  def annexlbl(cond)
10
14
  cond ? @labels["appendix"] : @labels["annex"]
11
15
  end
@@ -21,18 +25,31 @@ module IsoDoc
21
25
  @anchors[clause["id"]] =
22
26
  { label: annex_name_lbl(clause, num), type: "clause", elem: lbl,
23
27
  xref: l10n("#{lbl} #{num}"), level: 1, value: num }
24
- if @klass.single_term_clause?(clause)
25
- annex_names1(clause.at(ns("./references | ./terms | ./definitions")),
26
- num.to_s, 1)
27
- else
28
- i = Counter.new
29
- clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
30
- .each do |c|
31
- i.increment(c)
32
- annex_names1(c, "#{num}.#{i.print}", 2)
33
- end
28
+ annex_names_recurse(clause, num)
29
+ annex_asset_names(clause, num, lbl)
30
+ end
31
+
32
+ def annex_names_recurse(clause, num)
33
+ @klass.single_term_clause?(clause) and
34
+ return annex_names1(clause.at(ns("./references | ./terms | ./definitions")),
35
+ num.to_s, 1)
36
+ i = Counter.new
37
+ clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
38
+ .each do |c|
39
+ i.increment(c)
40
+ annex_names1(c, "#{num}.#{i.print}", 2)
34
41
  end
42
+ end
43
+
44
+ def annex_asset_names(clause, num, lbl)
45
+ @annex_prefix = lbl
35
46
  hierarchical_asset_names(clause, num)
47
+ @annex_prefix = nil
48
+ end
49
+
50
+ def anchor_struct_value(lbl, elem)
51
+ @annex_prefix and lbl = l10n("#{@annex_prefix} #{lbl}")
52
+ super
36
53
  end
37
54
 
38
55
  def clause_order_main(docxml)
@@ -105,6 +122,22 @@ module IsoDoc
105
122
  section_names1(c, i.increment(c).print, level + 1)
106
123
  end
107
124
  end
125
+
126
+ def middle_sections
127
+ "//sections/clause | #{@klass.norm_ref_xpath} | " \
128
+ "//sections/terms | //sections/definitions | //sections/clause"
129
+ end
130
+
131
+ def middle_section_asset_names(doc)
132
+ doc.xpath(ns(middle_sections)).each do |c|
133
+ hierarchical_asset_names(c, @anchors[c["id"]][:label])
134
+ end
135
+ end
136
+
137
+ def preface_names(clause)
138
+ super
139
+ sequential_asset_names(clause, container: true)
140
+ end
108
141
  end
109
142
  end
110
143
  end
@@ -5,6 +5,7 @@
5
5
 
6
6
  This work is copyright. Apart from any use permitted in accordance with the Berne Convention for the Protection of Literary and Artistic Works (1886), and except in the circumstances described below, no part may be translated, reproduced by any process, adapted, communicated or commercially exploited without prior written permission from the International Hydrographic Organization (IHO). Copyright in some of the material in this publication may be owned by another party and permission for the translation and/or reproduction of that material must be obtained from the owner.
7
7
 
8
+
8
9
  == license-statement
9
10
  === {blank}
10
11
  This document or partial material from this document may be translated, reproduced or distributed for general information, on no more than a cost recovery basis. Copies may not be sold or distributed for profit or gain without prior written agreement of the IHO and any other copyright holders.
@@ -12,9 +13,9 @@ This document or partial material from this document may be translated, reproduc
12
13
  In the event that this document or partial material from this document is reproduced, translated or distributed under the terms described above, the following statements are to be included:
13
14
 
14
15
  ____
15
- _"Material from IHO publication [reference to extract: Title, Edition] is reproduced with the permission of the International Hydrographic Organization (IHO) Secretariat (Permission No ……./…) acting for the International Hydrographic Organization (IHO), which does not accept responsibility for the correctness of the material as reproduced: in case of doubt, the IHO's authentic text shall prevail. The incorporation of material sourced from IHO shall not be construed as constituting an endorsement by IHO of this product."_
16
+ "Material from IHO publication [reference to extract: Title, Edition] is reproduced with the permission of the International Hydrographic Organization (IHO) Secretariat (Permission No ……./…) acting for the International Hydrographic Organization (IHO), which does not accept responsibility for the correctness of the material as reproduced: in case of doubt, the IHOs authentic text shall prevail. The incorporation of material sourced from IHO shall not be construed as constituting an endorsement by IHO of this product."
16
17
 
17
- _"This [document/publication] is a translation of IHO [document/publication] [name]. The IHO has not checked this translation and therefore takes no responsibility for its accuracy. In case of doubt the source version of [name] in [language] should be consulted."_
18
+ "This [document/publication] is a translation of IHO [document/publication] [name]. The IHO has not checked this translation and therefore takes no responsibility for its accuracy. In case of doubt the source version of [name] in [language] should be consulted."
18
19
  ____
19
20
 
20
21
  The IHO Logo or other identifiers shall not be used in any derived product without prior written permission from the IHO.
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "1.0.3".freeze
3
+ VERSION = "1.0.4".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.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-16 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic