metanorma-ogc 2.6.0 → 2.6.2

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: a3c9e7230287337f9903c6e2628a5fb7b47ef3c8318e0a404d783564db1776c9
4
- data.tar.gz: cb7741ebe5cf3875f498388f88cd52c20bb67ff0801ed9f91384a92ed7e2d445
3
+ metadata.gz: 35680f6a9dbf6cebb472698a3d3665ec78f9d81735ec9068c0068cf26326b82e
4
+ data.tar.gz: 4cc255a9dbf73b58c30492a0bfa107cbfa6379f418c8cd18bc4aeeb1ec9f7c85
5
5
  SHA512:
6
- metadata.gz: 4ea130e97e8ad1a5d7500c1f624ef62b89295921e4b112c0ca7e0ad46be1de1cd0e48e5270a2c9e3206d2b710b3396ab4f1a03eee009ce610e4ad004ec483f81
7
- data.tar.gz: a3018511b9c1cca08f3c5d6c8ed8c6f500d1aebb839d352bef4724933bdfb74c36e34c1c18f0b6e421865a4cd78c68ab049e4ca3056dd0d010dab0d73c01bfdc
6
+ metadata.gz: 906b73d6e8fe1ce05aa7bd62b7df4923fd0b64ab711a286e96553f16a8d25da0bd8be4badadf585d92234f7a265a3b9f6c201a20113f071dac576dc6c1afbd70
7
+ data.tar.gz: 1a4f85e5ba023bd4531b903579749f618f61c47a5ab0a847e4c3c06e8d23b334d47bc8b6f822d17d0723fb3c1d4339f1d43773d916ee593da7da1ca23ea98286
@@ -232,7 +232,7 @@ h6:hover > a.anchor,
232
232
  background-color: #777;
233
233
  color: white;
234
234
  cursor: pointer;
235
- padding: 12px 0;
235
+ padding: 3px 0;
236
236
  margin: 0;
237
237
  width: 100%;
238
238
  border: none;
@@ -1107,7 +1107,7 @@ p.Biblio, p.NormRef {
1107
1107
  margin-left: 2em; }
1108
1108
 
1109
1109
  /* Blocks */
1110
- .SourceTitle {
1110
+ .SourceTitle, .FigureTitle {
1111
1111
  font-weight: 700;
1112
1112
  font-size: 1em;
1113
1113
  text-align: center; }
@@ -424,7 +424,7 @@ p.Biblio, p.NormRef {
424
424
 
425
425
  /* Blocks */
426
426
 
427
- .SourceTitle {
427
+ .SourceTitle, .FigureTitle {
428
428
  @include blockTitle();
429
429
  }
430
430
 
@@ -1,71 +1,12 @@
1
- <script>
2
- $("#toc").on('click', 'li', function(e) {
3
- $(this).parent().find('li.toc-active').removeClass('toc-active');
4
- $(this).addClass('toc-active');
5
- });
6
- </script>
7
-
8
- <script>
9
- //TOC toggle animation
10
- $('#toggle').on('click', function(){
11
- if( $('nav').is(':visible') ) {
12
- $('nav').animate({ 'left': '-353px' }, 'slow', function(){
13
- $('nav').hide();
14
- });
15
- $('body').animate({ 'margin-left': '-333px' }, 'slow');
16
- }
17
- else {
18
- $('nav').show();
19
- $('nav').animate({ 'left': '0px' }, 'slow');
20
- $('body').animate({ 'margin-left': '0' }, 'slow');
21
- }
22
- });
23
- </script>
24
-
25
1
  <script>
26
- // Scroll to top button
27
- window.onscroll = function() {scrollFunction()};
28
-
29
- function scrollFunction() {
30
- if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
31
- document.getElementById("myBtn").style.display = "block";
32
- } else {
33
- document.getElementById("myBtn").style.display = "none";
34
- }
35
- }
36
-
37
- // When the user clicks on the button, scroll to the top of the document
38
- function topFunction() {
39
- document.body.scrollTop = 0;
40
- document.documentElement.scrollTop = 0;
41
- }
42
- </script>
43
-
44
- <script>
45
- // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
46
- //
47
- // AnchorJS - v4.2.2 - 2020-04-20
48
- // https://www.bryanbraun.com/anchorjs/
49
- // Copyright (c) 2020 Bryan Braun; Licensed MIT
50
- //
51
- // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
52
- !function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function f(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.ariaLabel=A.hasOwnProperty("ariaLabel")?A.ariaLabel:"Anchor",A.class=A.hasOwnProperty("class")?A.class:"",A.base=A.hasOwnProperty("base")?A.base:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64,A.titleText=A.hasOwnProperty("titleText")?A.titleText:""}function p(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],f(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,i,n,o,s,a,r,c,h,l,u,d=[];if(f(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),0===(e=p(A=A||"h2, h3, h4, h5, h6")).length)return this;for(!function(){if(null!==document.head.querySelector("style.anchorjs"))return;var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(e):document.head.insertBefore(e,A);e.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",e.sheet.cssRules.length),e.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",e.sheet.cssRules.length),e.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",e.sheet.cssRules.length),e.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',e.sheet.cssRules.length)}(),t=document.querySelectorAll("[id]"),i=[].map.call(t,function(A){return A.id}),o=0;o<e.length;o++)if(this.hasAnchorJSLink(e[o]))d.push(o);else{if(e[o].hasAttribute("id"))n=e[o].getAttribute("id");else if(e[o].hasAttribute("data-anchor-id"))n=e[o].getAttribute("data-anchor-id");else{for(c=r=this.urlify(e[o].textContent),a=0;void 0!==s&&(c=r+"-"+a),a+=1,-1!==(s=i.indexOf(c)););s=void 0,i.push(c),e[o].setAttribute("id",c),n=c}(h=document.createElement("a")).className="anchorjs-link "+this.options.class,h.setAttribute("aria-label",this.options.ariaLabel),h.setAttribute("data-anchorjs-icon",this.options.icon),this.options.titleText&&(h.title=this.options.titleText),u=document.querySelector("base")?window.location.pathname+window.location.search:"",u=this.options.base||u,h.href=u+"#"+n,"always"===l&&(h.style.opacity="1"),""===this.options.icon&&(h.style.font="1em/1 anchorjs-icons","left"===this.options.placement&&(h.style.lineHeight="inherit")),"left"===this.options.placement?(h.style.position="absolute",h.style.marginLeft="-1em",h.style.paddingRight="0.5em",e[o].insertBefore(h,e[o].firstChild)):(h.style.paddingLeft="0.375em",e[o].appendChild(h))}for(o=0;o<d.length;o++)e.splice(d[o]-o,1);return this.elements=this.elements.concat(e),this},this.remove=function(A){for(var e,t,i=p(A),n=0;n<i.length;n++)(t=i[n].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(i[n]))&&this.elements.splice(e,1),i[n].removeChild(t));return this},this.removeAll=function(){this.remove(this.elements)},this.urlify=function(A){return this.options.truncate||f(this.options),A.trim().replace(/\'/gi,"").replace(/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\\n\t\b\v]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),t=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||t||!1}}});
53
- // @license-end
54
- </script>
55
- <script>
56
- /*
57
- $(document).ready(function() {
58
- $('[id^=toc]').each(function ()
59
- {
60
- var currentToc = $(this);
61
- var url = window.location.href;
62
- currentToc.wrap("<a href='" + url + "#" + currentToc.attr("id") + "' </a>");
63
- });
64
- });
65
- */
66
- anchors.options = {
67
- placement: 'left'
68
- };
69
- anchors.add('h1, h2, h3, h4');
2
+ const activeBtns = document.querySelectorAll('.collapsible.active')
3
+
4
+ // check if there are any active buttons, and open the content for each of them as default
5
+ if (activeBtns.length) {
6
+ activeBtns.forEach(btn => {
7
+ const content = btn.nextElementSibling
8
+ content.style.maxHeight = content.scrollHeight + 'px'
9
+ })
10
+ }
70
11
  </script>
71
12
 
@@ -140,6 +140,37 @@ module IsoDoc
140
140
  html
141
141
  end
142
142
 
143
+ def figure_parse1(node, out)
144
+ out.div **figure_attrs(node) do |div|
145
+ node.children.each do |n|
146
+ figure_key(out) if n.name == "dl"
147
+ parse(n, div) unless n.name == "name"
148
+ end
149
+ end
150
+ figure_name_parse(node, out, node.at(ns("./name")))
151
+ end
152
+
153
+ def html_cleanup(html)
154
+ collapsible(super)
155
+ end
156
+
157
+ def collapsible(html)
158
+ html.xpath("//*[@class = 'sourcecode' or @class = 'figure']")
159
+ .each do |d|
160
+ d["class"] += " hidable"
161
+ d.previous = "<p class='collapsible active'>&#xa0;</p>"
162
+ end
163
+ html
164
+ end
165
+
166
+ def inject_script(doc)
167
+ a = super.split(%{</body>})
168
+ scripts = File.read(File.join(File.dirname(__FILE__),
169
+ "html/scripts.html"),
170
+ encoding: "UTF-8")
171
+ "#{a[0]}#{scripts}#{a[1]}"
172
+ end
173
+
143
174
  # to pass on to imported _coverpage.scss
144
175
  def scss_fontheader(is_html_css)
145
176
  super + <<~SCSS
@@ -20,17 +20,23 @@ toc_recommendations: List of Recommendations
20
20
  table_of_figures: Table of Figures
21
21
  security_empty: No security considerations have been made for this document.
22
22
  internal_terms_boilerplate: |
23
- <p>This document uses the terms defined in <link target="https://portal.ogc.org/public_ogc/directives/directives.php">OGC Policy Directive 49</link>, which is based on the ISO/IEC Directives, Part 2, Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to conform to this document and OGC documents do not use the equivalent phrases in the ISO/IEC Directives, Part 2.</p>
24
- <p>This document also uses terms defined in the OGC Standard for Modular specifications (<link target="https://portal.opengeospatial.org/files/?artifact_id=34762">OGC 08-131r3</link>), also known as the 'ModSpec'. The definitions of terms such as standard, specification, requirement, and conformance test are provided in the ModSpec.</p>
25
- <p>For the purposes of this document, the following additional terms and definitions apply.</p>
23
+ This document uses the terms defined in https://portal.ogc.org/public_ogc/directives/directives.php[OGC Policy Directive 49], which is based on the ISO/IEC Directives, Part 2, Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to conform to this document and OGC documents do not use the equivalent phrases in the ISO/IEC Directives, Part 2.
24
+
25
+ This document also uses terms defined in the OGC Standard for Modular specifications (https://portal.opengeospatial.org/files/?artifact_id=34762[OGC 08-131r3]), also known as the 'ModSpec'. The definitions of terms such as standard, specification, requirement, and conformance test are provided in the ModSpec.
26
+
27
+ For the purposes of this document, the following additional terms and definitions apply.
26
28
  external_terms_boilerplate: |
27
- <p>This document uses the terms defined in <link target="https://portal.ogc.org/public_ogc/directives/directives.php">OGC Policy Directive 49</link>, which is based on the ISO/IEC Directives, Part 2, Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to conform to this document and OGC documents do not use the equivalent phrases in the ISO/IEC Directives, Part 2.</p>
28
- <p>This document also uses terms defined in the OGC Standard for Modular specifications (<link target="https://portal.opengeospatial.org/files/?artifact_id=34762">OGC 08-131r3</link>), also known as the 'ModSpec'. The definitions of terms such as standard, specification, requirement, and conformance test are provided in the ModSpec.</p>
29
- <p>For the purposes of this document, the terms and definitions given in % additionally apply.</p>
29
+ This document uses the terms defined in https://portal.ogc.org/public_ogc/directives/directives.php[OGC Policy Directive 49], which is based on the ISO/IEC Directives, Part 2, Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to conform to this document and OGC documents do not use the equivalent phrases in the ISO/IEC Directives, Part 2.
30
+
31
+ This document also uses terms defined in the OGC Standard for Modular specifications (https://portal.opengeospatial.org/files/?artifact_id=34762[OGC 08-131r3]), also known as the 'ModSpec'. The definitions of terms such as standard, specification, requirement, and conformance test are provided in the ModSpec.
32
+
33
+ For the purposes of this document, the terms and definitions given in % additionally apply.
30
34
  internal_external_terms_boilerplate: |
31
- <p>This document uses the terms defined in <link target="https://portal.ogc.org/public_ogc/directives/directives.php">OGC Policy Directive 49</link>, which is based on the ISO/IEC Directives, Part 2, Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to conform to this document and OGC documents do not use the equivalent phrases in the ISO/IEC Directives, Part 2.</p>
32
- <p>This document also uses terms defined in the OGC Standard for Modular specifications (<link target="https://portal.opengeospatial.org/files/?artifact_id=34762">OGC 08-131r3</link>), also known as the 'ModSpec'. The definitions of terms such as standard, specification, requirement, and conformance test are provided in the ModSpec.</p>
33
- <p>For the purposes of this document, the terms and definitions given in % and the following additionally apply.</p>
35
+ This document uses the terms defined in https://portal.ogc.org/public_ogc/directives/directives.php[OGC Policy Directive 49], which is based on the ISO/IEC Directives, Part 2, Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to conform to this document and OGC documents do not use the equivalent phrases in the ISO/IEC Directives, Part 2.
36
+
37
+ This document also uses terms defined in the OGC Standard for Modular specifications (https://portal.opengeospatial.org/files/?artifact_id=34762[OGC 08-131r3]), also known as the 'ModSpec'. The definitions of terms such as standard, specification, requirement, and conformance test are provided in the ModSpec.
38
+
39
+ For the purposes of this document, the terms and definitions given in % and the following additionally apply.
34
40
  term_defined_in: "(%)"
35
41
  submission_date: Submission Date
36
42
  approval_date: Approval Date
@@ -817,7 +817,7 @@
817
817
  <xsl:choose>
818
818
  <xsl:when test="@level = 1">
819
819
  <fo:list-block provisional-distance-between-starts="8mm">
820
- <xsl:if test="@type = 'annex'">
820
+ <xsl:if test="@type = 'annex' or (@type = 'references' and normalize-space(@section) = '')">
821
821
  <xsl:attribute name="provisional-distance-between-starts">0mm</xsl:attribute>
822
822
  </xsl:if>
823
823
  <fo:list-item>
@@ -8103,6 +8103,12 @@
8103
8103
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
8104
8104
  <attachment filename="{@name}"/>
8105
8105
  </xsl:for-each>
8106
+ <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
8107
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
8108
+ <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
8109
+ <attachment filename="{$attachment_path}"/>
8110
+ </xsl:for-each>
8111
+ </xsl:if>
8106
8112
  </xsl:variable>
8107
8113
  <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
8108
8114
 
@@ -8115,7 +8121,7 @@
8115
8121
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
8116
8122
  </xsl:when>
8117
8123
  <!-- link to the PDF attachment -->
8118
- <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
8124
+ <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
8119
8125
  <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
8120
8126
  </xsl:when>
8121
8127
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -8770,7 +8776,16 @@
8770
8776
  </xsl:variable>
8771
8777
  <xsl:variable name="img_src">
8772
8778
  <xsl:choose>
8773
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
8779
+ <xsl:when test="not(starts-with(@src, 'data:'))">
8780
+ <xsl:choose>
8781
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
8782
+ <xsl:value-of select="@src"/>
8783
+ </xsl:when>
8784
+ <xsl:otherwise>
8785
+ <xsl:value-of select="concat($basepath, @src)"/>
8786
+ </xsl:otherwise>
8787
+ </xsl:choose>
8788
+ </xsl:when>
8774
8789
  <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
8775
8790
  </xsl:choose>
8776
8791
  </xsl:variable>
@@ -8783,7 +8798,7 @@
8783
8798
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
8784
8799
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
8785
8800
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
8786
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8801
+ <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8787
8802
  <xsl:value-of select="$scale"/>
8788
8803
  </xsl:template>
8789
8804
 
@@ -8802,7 +8817,14 @@
8802
8817
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
8803
8818
  </xsl:when>
8804
8819
  <xsl:when test="not(starts-with(@src, 'data:'))">
8805
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8820
+ <xsl:choose>
8821
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
8822
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
8823
+ </xsl:when>
8824
+ <xsl:otherwise>
8825
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8826
+ </xsl:otherwise>
8827
+ </xsl:choose>
8806
8828
  </xsl:when>
8807
8829
  <xsl:otherwise>
8808
8830
  <xsl:value-of select="@src"/>
@@ -8824,7 +8846,14 @@
8824
8846
  </xsl:when>
8825
8847
  <xsl:when test="not(starts-with(@src, 'data:'))">
8826
8848
  <xsl:variable name="src">
8827
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8849
+ <xsl:choose>
8850
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
8851
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
8852
+ </xsl:when>
8853
+ <xsl:otherwise>
8854
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8855
+ </xsl:otherwise>
8856
+ </xsl:choose>
8828
8857
  </xsl:variable>
8829
8858
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
8830
8859
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -13608,6 +13637,39 @@
13608
13637
  </pdf:catalog>
13609
13638
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
13610
13639
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
13640
+ <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="">
13641
+ <pdfaExtension:schemas>
13642
+ <rdf:Bag>
13643
+ <rdf:li rdf:parseType="Resource">
13644
+ <pdfaSchema:namespaceURI>http://www.aiim.org/pdfua/ns/id/</pdfaSchema:namespaceURI>
13645
+ <pdfaSchema:prefix>pdfuaid</pdfaSchema:prefix>
13646
+ <pdfaSchema:schema>PDF/UA identification schema</pdfaSchema:schema>
13647
+ <pdfaSchema:property>
13648
+ <rdf:Seq>
13649
+ <rdf:li rdf:parseType="Resource">
13650
+ <pdfaProperty:category>internal</pdfaProperty:category>
13651
+ <pdfaProperty:description>PDF/UA version identifier</pdfaProperty:description>
13652
+ <pdfaProperty:name>part</pdfaProperty:name>
13653
+ <pdfaProperty:valueType>Integer</pdfaProperty:valueType>
13654
+ </rdf:li>
13655
+ <rdf:li rdf:parseType="Resource">
13656
+ <pdfaProperty:category>internal</pdfaProperty:category>
13657
+ <pdfaProperty:description>PDF/UA amendment identifier</pdfaProperty:description>
13658
+ <pdfaProperty:name>amd</pdfaProperty:name>
13659
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
13660
+ </rdf:li>
13661
+ <rdf:li rdf:parseType="Resource">
13662
+ <pdfaProperty:category>internal</pdfaProperty:category>
13663
+ <pdfaProperty:description>PDF/UA corrigenda identifier</pdfaProperty:description>
13664
+ <pdfaProperty:name>corr</pdfaProperty:name>
13665
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
13666
+ </rdf:li>
13667
+ </rdf:Seq>
13668
+ </pdfaSchema:property>
13669
+ </rdf:li>
13670
+ </rdf:Bag>
13671
+ </pdfaExtension:schemas>
13672
+ </rdf:Description>
13611
13673
  <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
13612
13674
  <!-- Dublin Core properties go here -->
13613
13675
  <dc:title>
@@ -13618,33 +13680,57 @@
13618
13680
 
13619
13681
  </xsl:for-each>
13620
13682
  </xsl:variable>
13621
- <xsl:choose>
13622
- <xsl:when test="normalize-space($title) != ''">
13623
- <xsl:value-of select="$title"/>
13624
- </xsl:when>
13625
- <xsl:otherwise>
13626
- <xsl:text> </xsl:text>
13627
- </xsl:otherwise>
13628
- </xsl:choose>
13683
+ <rdf:Alt>
13684
+ <rdf:li xml:lang="x-default">
13685
+ <xsl:choose>
13686
+ <xsl:when test="normalize-space($title) != ''">
13687
+ <xsl:value-of select="$title"/>
13688
+ </xsl:when>
13689
+ <xsl:otherwise>
13690
+ <xsl:text> </xsl:text>
13691
+ </xsl:otherwise>
13692
+ </xsl:choose>
13693
+ </rdf:li>
13694
+ </rdf:Alt>
13629
13695
  </dc:title>
13630
- <dc:creator>
13696
+ <xsl:variable name="dc_creator">
13631
13697
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
13632
13698
 
13633
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
13634
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
13635
- <xsl:if test="position() != last()">; </xsl:if>
13636
- </xsl:for-each>
13699
+ <rdf:Seq>
13700
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
13701
+ <rdf:li>
13702
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
13703
+ </rdf:li>
13704
+ <!-- <xsl:if test="position() != last()">; </xsl:if> -->
13705
+ </xsl:for-each>
13706
+ </rdf:Seq>
13637
13707
 
13638
13708
  </xsl:for-each>
13639
- </dc:creator>
13640
- <dc:description>
13709
+ </xsl:variable>
13710
+ <xsl:if test="normalize-space($dc_creator) != ''">
13711
+ <dc:creator>
13712
+ <xsl:copy-of select="$dc_creator"/>
13713
+ </dc:creator>
13714
+ </xsl:if>
13715
+
13716
+ <xsl:variable name="dc_description">
13641
13717
  <xsl:variable name="abstract">
13642
13718
 
13643
13719
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
13644
13720
 
13645
13721
  </xsl:variable>
13646
- <xsl:value-of select="normalize-space($abstract)"/>
13647
- </dc:description>
13722
+ <rdf:Alt>
13723
+ <rdf:li xml:lang="x-default">
13724
+ <xsl:value-of select="normalize-space($abstract)"/>
13725
+ </rdf:li>
13726
+ </rdf:Alt>
13727
+ </xsl:variable>
13728
+ <xsl:if test="normalize-space($dc_description)">
13729
+ <dc:description>
13730
+ <xsl:copy-of select="$dc_description"/>
13731
+ </dc:description>
13732
+ </xsl:if>
13733
+
13648
13734
  <pdf:Keywords>
13649
13735
  <xsl:call-template name="insertKeywords">
13650
13736
  <xsl:with-param name="meta">true</xsl:with-param>
@@ -13659,26 +13745,37 @@
13659
13745
  </x:xmpmeta>
13660
13746
  <!-- add attachments -->
13661
13747
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
13662
- <xsl:choose>
13663
- <xsl:when test="normalize-space() != ''">
13664
- <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
13665
- <pdf:embedded-file src="{$src_attachment}" filename="{@name}"/>
13666
- </xsl:when>
13667
- <xsl:otherwise>
13668
- <!-- _{filename}_attachments -->
13669
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
13670
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
13671
- <pdf:embedded-file src="{$url}" filename="{@name}"/>
13672
- </xsl:otherwise>
13673
- </xsl:choose>
13748
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
13749
+
13750
+ <pdf:embedded-file filename="{@name}">
13751
+ <xsl:attribute name="src">
13752
+ <xsl:choose>
13753
+ <xsl:when test="normalize-space() != ''">
13754
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
13755
+ <xsl:value-of select="$src_attachment"/>
13756
+ </xsl:when>
13757
+ <xsl:otherwise>
13758
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
13759
+ <xsl:value-of select="$url"/>
13760
+ </xsl:otherwise>
13761
+ </xsl:choose>
13762
+ </xsl:attribute>
13763
+ <xsl:if test="$description != ''">
13764
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13765
+ </xsl:if>
13766
+ </pdf:embedded-file>
13674
13767
  </xsl:for-each>
13675
13768
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
13676
13769
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
13677
13770
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
13678
13771
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
13679
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
13680
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
13681
- <pdf:embedded-file src="{$url}" filename="{$filename_embedded}"/>
13772
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13773
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13774
+ <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
13775
+ <xsl:if test="$description != ''">
13776
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13777
+ </xsl:if>
13778
+ </pdf:embedded-file>
13682
13779
  </xsl:for-each>
13683
13780
  </xsl:if>
13684
13781
  </xsl:template> <!-- addPDFUAmeta -->
@@ -14056,7 +14153,14 @@
14056
14153
  <xsl:value-of select="$src"/>
14057
14154
  </xsl:when>
14058
14155
  <xsl:otherwise>
14059
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
14156
+ <xsl:choose>
14157
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
14158
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
14159
+ </xsl:when>
14160
+ <xsl:otherwise>
14161
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
14162
+ </xsl:otherwise>
14163
+ </xsl:choose>
14060
14164
  </xsl:otherwise>
14061
14165
  </xsl:choose>
14062
14166
  </xsl:template>