metanorma-un 0.12.15 → 0.12.17
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 +4 -4
 - data/lib/isodoc/un/html/htmlstyle.css +40 -0
 - data/lib/isodoc/un/un.plenary-attachment.xsl +98 -26
 - data/lib/isodoc/un/un.plenary.xsl +98 -26
 - data/lib/isodoc/un/un.recommendation.xsl +98 -26
 - data/lib/metanorma/un/basicdoc.rng +71 -6
 - data/lib/metanorma/un/biblio.rng +3 -1
 - data/lib/metanorma/un/isodoc.rng +3 -0
 - data/lib/metanorma/un/reqt.rng +3 -0
 - data/lib/metanorma/un/version.rb +1 -1
 - data/metanorma-un.gemspec +1 -1
 - metadata +4 -4
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: f5f6b24d93decf498c086763d0941676076dab27298cd20aec18809c43e0280a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: eccb7feb1829db83f4c029d3f019ecf38c9f23ac16e79f5f165fe4dcfbe5a2d3
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 66791acea79635a043524ccbaa5377efa866fb4297d8f17824a2e0471773bc46918f483bcace73d2e4b6f904d1f60c78ed23808b3735852d8b5c9db5b452f622
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: b371258f4f65c7c8e3aa03de22f77967c1b195c4eceba545014da418b0295f1e4ad56928c3c6c6bf77785bc9b69ae2213d94887ca641dae73e7764a754e5cc4f
         
     | 
| 
         @@ -229,6 +229,46 @@ h6:hover > a.anchor, 
     | 
|
| 
       229 
229 
     | 
    
         
             
            .inline-header:hover > a.anchor {
         
     | 
| 
       230 
230 
     | 
    
         
             
              visibility: visible; }
         
     | 
| 
       231 
231 
     | 
    
         | 
| 
      
 232 
     | 
    
         
            +
            /* collapsible snippets: collapsible before hidable */
         
     | 
| 
      
 233 
     | 
    
         
            +
            .hidable {
         
     | 
| 
      
 234 
     | 
    
         
            +
              max-height: 0;
         
     | 
| 
      
 235 
     | 
    
         
            +
              overflow: hidden;
         
     | 
| 
      
 236 
     | 
    
         
            +
              transition: max-height 0.2s ease-out; }
         
     | 
| 
      
 237 
     | 
    
         
            +
             
     | 
| 
      
 238 
     | 
    
         
            +
            .collapsible {
         
     | 
| 
      
 239 
     | 
    
         
            +
              background-color: #777;
         
     | 
| 
      
 240 
     | 
    
         
            +
              color: white;
         
     | 
| 
      
 241 
     | 
    
         
            +
              cursor: pointer;
         
     | 
| 
      
 242 
     | 
    
         
            +
              padding: 12px 0;
         
     | 
| 
      
 243 
     | 
    
         
            +
              margin: 0;
         
     | 
| 
      
 244 
     | 
    
         
            +
              width: 100%;
         
     | 
| 
      
 245 
     | 
    
         
            +
              border: none;
         
     | 
| 
      
 246 
     | 
    
         
            +
              text-align: left;
         
     | 
| 
      
 247 
     | 
    
         
            +
              outline: none;
         
     | 
| 
      
 248 
     | 
    
         
            +
              font-size: 15px; }
         
     | 
| 
      
 249 
     | 
    
         
            +
             
     | 
| 
      
 250 
     | 
    
         
            +
            .active, .collapsible:hover {
         
     | 
| 
      
 251 
     | 
    
         
            +
              background-color: #555; }
         
     | 
| 
      
 252 
     | 
    
         
            +
             
     | 
| 
      
 253 
     | 
    
         
            +
            .collapsible:after {
         
     | 
| 
      
 254 
     | 
    
         
            +
              content: '\25bc';
         
     | 
| 
      
 255 
     | 
    
         
            +
              color: white;
         
     | 
| 
      
 256 
     | 
    
         
            +
              font-weight: bold;
         
     | 
| 
      
 257 
     | 
    
         
            +
              float: right;
         
     | 
| 
      
 258 
     | 
    
         
            +
              margin-left: 12px;
         
     | 
| 
      
 259 
     | 
    
         
            +
              margin-right: 12px; }
         
     | 
| 
      
 260 
     | 
    
         
            +
             
     | 
| 
      
 261 
     | 
    
         
            +
            .active:after {
         
     | 
| 
      
 262 
     | 
    
         
            +
              content: "\25b2"; }
         
     | 
| 
      
 263 
     | 
    
         
            +
             
     | 
| 
      
 264 
     | 
    
         
            +
            /* collapsible: */
         
     | 
| 
      
 265 
     | 
    
         
            +
            .collapsible + .hidable {
         
     | 
| 
      
 266 
     | 
    
         
            +
              margin-top: 0; }
         
     | 
| 
      
 267 
     | 
    
         
            +
             
     | 
| 
      
 268 
     | 
    
         
            +
            .collapsible:not(.active) + .hidable {
         
     | 
| 
      
 269 
     | 
    
         
            +
              overflow: hidden;
         
     | 
| 
      
 270 
     | 
    
         
            +
              padding: 0; }
         
     | 
| 
      
 271 
     | 
    
         
            +
             
     | 
| 
       232 
272 
     | 
    
         
             
            #standard-band {
         
     | 
| 
       233 
273 
     | 
    
         
             
              background-color: #0AC442; }
         
     | 
| 
       234 
274 
     | 
    
         | 
| 
         @@ -2720,13 +2720,35 @@ 
     | 
|
| 
       2720 
2720 
     | 
    
         
             
            			</xsl:for-each>
         
     | 
| 
       2721 
2721 
     | 
    
         
             
            		</xsl:element>
         
     | 
| 
       2722 
2722 
     | 
    
         | 
| 
       2723 
     | 
    
         
            -
            		<xsl:call-template name=" 
     | 
| 
      
 2723 
     | 
    
         
            +
            		<xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
         
     | 
| 
       2724 
2724 
     | 
    
         | 
| 
       2725 
     | 
    
         
            -
            		<xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
         
     | 
| 
      
 2725 
     | 
    
         
            +
            		<!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
         
     | 
| 
       2726 
2726 
     | 
    
         | 
| 
       2727 
2727 
     | 
    
         
             
            		<!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
         
     | 
| 
       2728 
2728 
     | 
    
         
             
            	</xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
         
     | 
| 
       2729 
2729 
     | 
    
         | 
| 
      
 2730 
     | 
    
         
            +
            	<xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
         
     | 
| 
      
 2731 
     | 
    
         
            +
            		<xsl:for-each select="/*/*[local-name()='annex'] |           /*/*[local-name()='bibliography']/*[not(@normative='true')] |           /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]] |          /*/*[local-name()='indexsect']">
         
     | 
| 
      
 2732 
     | 
    
         
            +
            			<xsl:sort select="@displayorder" data-type="number"/>
         
     | 
| 
      
 2733 
     | 
    
         
            +
            			<xsl:choose>
         
     | 
| 
      
 2734 
     | 
    
         
            +
            				<xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
         
     | 
| 
      
 2735 
     | 
    
         
            +
            					<xsl:element name="page_sequence" namespace="{$namespace_full}">
         
     | 
| 
      
 2736 
     | 
    
         
            +
            						<xsl:attribute name="main_page_sequence"/>
         
     | 
| 
      
 2737 
     | 
    
         
            +
            						<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
         
     | 
| 
      
 2738 
     | 
    
         
            +
            					</xsl:element>
         
     | 
| 
      
 2739 
     | 
    
         
            +
            				</xsl:when>
         
     | 
| 
      
 2740 
     | 
    
         
            +
            				<xsl:otherwise> <!-- bibliography -->
         
     | 
| 
      
 2741 
     | 
    
         
            +
            					<xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
         
     | 
| 
      
 2742 
     | 
    
         
            +
            						<xsl:element name="page_sequence" namespace="{$namespace_full}">
         
     | 
| 
      
 2743 
     | 
    
         
            +
            							<xsl:attribute name="main_page_sequence"/>
         
     | 
| 
      
 2744 
     | 
    
         
            +
            							<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
         
     | 
| 
      
 2745 
     | 
    
         
            +
            						</xsl:element>
         
     | 
| 
      
 2746 
     | 
    
         
            +
            					</xsl:element>
         
     | 
| 
      
 2747 
     | 
    
         
            +
            				</xsl:otherwise>
         
     | 
| 
      
 2748 
     | 
    
         
            +
            			</xsl:choose>
         
     | 
| 
      
 2749 
     | 
    
         
            +
            		</xsl:for-each>
         
     | 
| 
      
 2750 
     | 
    
         
            +
            	</xsl:template>
         
     | 
| 
      
 2751 
     | 
    
         
            +
             
     | 
| 
       2730 
2752 
     | 
    
         
             
            	<xsl:template name="insertAnnexInSeparatePageSequences">
         
     | 
| 
       2731 
2753 
     | 
    
         
             
            		<xsl:for-each select="/*/*[local-name()='annex']">
         
     | 
| 
       2732 
2754 
     | 
    
         
             
            			<xsl:sort select="@displayorder" data-type="number"/>
         
     | 
| 
         @@ -6917,6 +6939,12 @@ 
     | 
|
| 
       6917 
6939 
     | 
    
         
             
            		<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
         
     | 
| 
       6918 
6940 
     | 
    
         
             
            			<attachment filename="{@name}"/>
         
     | 
| 
       6919 
6941 
     | 
    
         
             
            		</xsl:for-each>
         
     | 
| 
      
 6942 
     | 
    
         
            +
            		<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
         
     | 
| 
      
 6943 
     | 
    
         
            +
            			<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
         
     | 
| 
      
 6944 
     | 
    
         
            +
            				<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
         
     | 
| 
      
 6945 
     | 
    
         
            +
            				<attachment filename="{$attachment_path}"/>
         
     | 
| 
      
 6946 
     | 
    
         
            +
            			</xsl:for-each>
         
     | 
| 
      
 6947 
     | 
    
         
            +
            		</xsl:if>
         
     | 
| 
       6920 
6948 
     | 
    
         
             
            	</xsl:variable>
         
     | 
| 
       6921 
6949 
     | 
    
         
             
            	<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
         
     | 
| 
       6922 
6950 
     | 
    
         | 
| 
         @@ -6929,7 +6957,7 @@ 
     | 
|
| 
       6929 
6957 
     | 
    
         
             
            					<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
         
     | 
| 
       6930 
6958 
     | 
    
         
             
            				</xsl:when>
         
     | 
| 
       6931 
6959 
     | 
    
         
             
            				<!-- link to the PDF attachment -->
         
     | 
| 
       6932 
     | 
    
         
            -
            				<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
         
     | 
| 
      
 6960 
     | 
    
         
            +
            				<xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
         
     | 
| 
       6933 
6961 
     | 
    
         
             
            					<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
         
     | 
| 
       6934 
6962 
     | 
    
         
             
            				</xsl:when>
         
     | 
| 
       6935 
6963 
     | 
    
         
             
            				<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
         
     | 
| 
         @@ -7589,7 +7617,16 @@ 
     | 
|
| 
       7589 
7617 
     | 
    
         
             
            		</xsl:variable>
         
     | 
| 
       7590 
7618 
     | 
    
         
             
            		<xsl:variable name="img_src">
         
     | 
| 
       7591 
7619 
     | 
    
         
             
            			<xsl:choose>
         
     | 
| 
       7592 
     | 
    
         
            -
            				<xsl:when test="not(starts-with(@src, 'data:'))" 
     | 
| 
      
 7620 
     | 
    
         
            +
            				<xsl:when test="not(starts-with(@src, 'data:'))">
         
     | 
| 
      
 7621 
     | 
    
         
            +
            					<xsl:choose>
         
     | 
| 
      
 7622 
     | 
    
         
            +
            						<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         
     | 
| 
      
 7623 
     | 
    
         
            +
            							<xsl:value-of select="@src"/>
         
     | 
| 
      
 7624 
     | 
    
         
            +
            						</xsl:when>
         
     | 
| 
      
 7625 
     | 
    
         
            +
            						<xsl:otherwise>
         
     | 
| 
      
 7626 
     | 
    
         
            +
            							<xsl:value-of select="concat($basepath, @src)"/>
         
     | 
| 
      
 7627 
     | 
    
         
            +
            						</xsl:otherwise>
         
     | 
| 
      
 7628 
     | 
    
         
            +
            					</xsl:choose>
         
     | 
| 
      
 7629 
     | 
    
         
            +
            				</xsl:when>
         
     | 
| 
       7593 
7630 
     | 
    
         
             
            				<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
         
     | 
| 
       7594 
7631 
     | 
    
         
             
            			</xsl:choose>
         
     | 
| 
       7595 
7632 
     | 
    
         
             
            		</xsl:variable>
         
     | 
| 
         @@ -7602,7 +7639,7 @@ 
     | 
|
| 
       7602 
7639 
     | 
    
         
             
            		<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
         
     | 
| 
       7603 
7640 
     | 
    
         
             
            		<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
         
     | 
| 
       7604 
7641 
     | 
    
         
             
            		<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
         
     | 
| 
       7605 
     | 
    
         
            -
            		<xsl:variable name="scale" select="java:org.metanorma.fop. 
     | 
| 
      
 7642 
     | 
    
         
            +
            		<xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
         
     | 
| 
       7606 
7643 
     | 
    
         
             
            		<xsl:value-of select="$scale"/>
         
     | 
| 
       7607 
7644 
     | 
    
         
             
            	</xsl:template>
         
     | 
| 
       7608 
7645 
     | 
    
         | 
| 
         @@ -7621,7 +7658,14 @@ 
     | 
|
| 
       7621 
7658 
     | 
    
         
             
            				<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
         
     | 
| 
       7622 
7659 
     | 
    
         
             
            			</xsl:when>
         
     | 
| 
       7623 
7660 
     | 
    
         
             
            			<xsl:when test="not(starts-with(@src, 'data:'))">
         
     | 
| 
       7624 
     | 
    
         
            -
            				<xsl: 
     | 
| 
      
 7661 
     | 
    
         
            +
            				<xsl:choose>
         
     | 
| 
      
 7662 
     | 
    
         
            +
            					<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         
     | 
| 
      
 7663 
     | 
    
         
            +
            						<xsl:value-of select="concat('url(file:///', @src, ')')"/>
         
     | 
| 
      
 7664 
     | 
    
         
            +
            					</xsl:when>
         
     | 
| 
      
 7665 
     | 
    
         
            +
            					<xsl:otherwise>
         
     | 
| 
      
 7666 
     | 
    
         
            +
            						<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
         
     | 
| 
      
 7667 
     | 
    
         
            +
            					</xsl:otherwise>
         
     | 
| 
      
 7668 
     | 
    
         
            +
            				</xsl:choose>
         
     | 
| 
       7625 
7669 
     | 
    
         
             
            			</xsl:when>
         
     | 
| 
       7626 
7670 
     | 
    
         
             
            			<xsl:otherwise>
         
     | 
| 
       7627 
7671 
     | 
    
         
             
            				<xsl:value-of select="@src"/>
         
     | 
| 
         @@ -7643,7 +7687,14 @@ 
     | 
|
| 
       7643 
7687 
     | 
    
         
             
            			</xsl:when>
         
     | 
| 
       7644 
7688 
     | 
    
         
             
            			<xsl:when test="not(starts-with(@src, 'data:'))">
         
     | 
| 
       7645 
7689 
     | 
    
         
             
            				<xsl:variable name="src">
         
     | 
| 
       7646 
     | 
    
         
            -
            					<xsl: 
     | 
| 
      
 7690 
     | 
    
         
            +
            					<xsl:choose>
         
     | 
| 
      
 7691 
     | 
    
         
            +
            						<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         
     | 
| 
      
 7692 
     | 
    
         
            +
            							<xsl:value-of select="concat('url(file:///', @src, ')')"/>
         
     | 
| 
      
 7693 
     | 
    
         
            +
            						</xsl:when>
         
     | 
| 
      
 7694 
     | 
    
         
            +
            						<xsl:otherwise>
         
     | 
| 
      
 7695 
     | 
    
         
            +
            							<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
         
     | 
| 
      
 7696 
     | 
    
         
            +
            						</xsl:otherwise>
         
     | 
| 
      
 7697 
     | 
    
         
            +
            					</xsl:choose>
         
     | 
| 
       7647 
7698 
     | 
    
         
             
            				</xsl:variable>
         
     | 
| 
       7648 
7699 
     | 
    
         
             
            				<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
         
     | 
| 
       7649 
7700 
     | 
    
         
             
            				<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
         
     | 
| 
         @@ -11535,10 +11586,12 @@ 
     | 
|
| 
       11535 
11586 
     | 
    
         
             
            	<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
         
     | 
| 
       11536 
11587 
     | 
    
         
             
            		<xsl:copy>
         
     | 
| 
       11537 
11588 
     | 
    
         
             
            			<xsl:copy-of select="@*"/>
         
     | 
| 
       11538 
     | 
    
         
            -
            			<xsl: 
     | 
| 
       11539 
     | 
    
         
            -
             
     | 
| 
       11540 
     | 
    
         
            -
             
     | 
| 
       11541 
     | 
    
         
            -
            				<xsl: 
     | 
| 
      
 11589 
     | 
    
         
            +
            			<xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
         
     | 
| 
      
 11590 
     | 
    
         
            +
            				<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
         
     | 
| 
      
 11591 
     | 
    
         
            +
            				<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
         
     | 
| 
      
 11592 
     | 
    
         
            +
            				<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
         
     | 
| 
      
 11593 
     | 
    
         
            +
            					<xsl:value-of select="normalize-space(.)"/>
         
     | 
| 
      
 11594 
     | 
    
         
            +
            				</xsl:if>
         
     | 
| 
       11542 
11595 
     | 
    
         
             
            			</xsl:if>
         
     | 
| 
       11543 
11596 
     | 
    
         
             
            		</xsl:copy>
         
     | 
| 
       11544 
11597 
     | 
    
         
             
            	</xsl:template>
         
     | 
| 
         @@ -12411,25 +12464,37 @@ 
     | 
|
| 
       12411 
12464 
     | 
    
         
             
            		</x:xmpmeta>
         
     | 
| 
       12412 
12465 
     | 
    
         
             
            		<!-- add attachments -->
         
     | 
| 
       12413 
12466 
     | 
    
         
             
            		<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
         
     | 
| 
       12414 
     | 
    
         
            -
            			<xsl: 
     | 
| 
       12415 
     | 
    
         
            -
             
     | 
| 
       12416 
     | 
    
         
            -
             
     | 
| 
       12417 
     | 
    
         
            -
            				 
     | 
| 
       12418 
     | 
    
         
            -
             
     | 
| 
       12419 
     | 
    
         
            -
             
     | 
| 
       12420 
     | 
    
         
            -
             
     | 
| 
       12421 
     | 
    
         
            -
             
     | 
| 
       12422 
     | 
    
         
            -
             
     | 
| 
       12423 
     | 
    
         
            -
             
     | 
| 
       12424 
     | 
    
         
            -
             
     | 
| 
      
 12467 
     | 
    
         
            +
            			<xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
         
     | 
| 
      
 12468 
     | 
    
         
            +
             
     | 
| 
      
 12469 
     | 
    
         
            +
            			<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
         
     | 
| 
      
 12470 
     | 
    
         
            +
            				<xsl:attribute name="src">
         
     | 
| 
      
 12471 
     | 
    
         
            +
            					<xsl:choose>
         
     | 
| 
      
 12472 
     | 
    
         
            +
            						<xsl:when test="normalize-space() != ''">
         
     | 
| 
      
 12473 
     | 
    
         
            +
            							<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(
|
|
)', '')"/> <!-- remove line breaks -->
         
     | 
| 
      
 12474 
     | 
    
         
            +
            							<xsl:value-of select="$src_attachment"/>
         
     | 
| 
      
 12475 
     | 
    
         
            +
            						</xsl:when>
         
     | 
| 
      
 12476 
     | 
    
         
            +
            						<xsl:otherwise>
         
     | 
| 
      
 12477 
     | 
    
         
            +
            							<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
         
     | 
| 
      
 12478 
     | 
    
         
            +
            							<xsl:value-of select="$url"/>
         
     | 
| 
      
 12479 
     | 
    
         
            +
            						</xsl:otherwise>
         
     | 
| 
      
 12480 
     | 
    
         
            +
            					</xsl:choose>
         
     | 
| 
      
 12481 
     | 
    
         
            +
            				</xsl:attribute>
         
     | 
| 
      
 12482 
     | 
    
         
            +
            				<xsl:if test="$description != ''">
         
     | 
| 
      
 12483 
     | 
    
         
            +
            					<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
         
     | 
| 
      
 12484 
     | 
    
         
            +
            				</xsl:if>
         
     | 
| 
      
 12485 
     | 
    
         
            +
            			</pdf:embedded-file>
         
     | 
| 
       12425 
12486 
     | 
    
         
             
            		</xsl:for-each>
         
     | 
| 
       12426 
12487 
     | 
    
         
             
            		<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
         
     | 
| 
       12427 
12488 
     | 
    
         
             
            		<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
         
     | 
| 
       12428 
12489 
     | 
    
         
             
            			<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
         
     | 
| 
       12429 
12490 
     | 
    
         
             
            				<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
         
     | 
| 
       12430 
     | 
    
         
            -
            				<xsl:variable name="url" select="concat('url(file:///',$ 
     | 
| 
       12431 
     | 
    
         
            -
            				<xsl:variable name=" 
     | 
| 
       12432 
     | 
    
         
            -
            				<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$ 
     | 
| 
      
 12491 
     | 
    
         
            +
            				<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
         
     | 
| 
      
 12492 
     | 
    
         
            +
            				<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
         
     | 
| 
      
 12493 
     | 
    
         
            +
            				<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
         
     | 
| 
      
 12494 
     | 
    
         
            +
            					<xsl:if test="$description != ''">
         
     | 
| 
      
 12495 
     | 
    
         
            +
            						<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
         
     | 
| 
      
 12496 
     | 
    
         
            +
            					</xsl:if>
         
     | 
| 
      
 12497 
     | 
    
         
            +
            				</pdf:embedded-file>
         
     | 
| 
       12433 
12498 
     | 
    
         
             
            			</xsl:for-each>
         
     | 
| 
       12434 
12499 
     | 
    
         
             
            		</xsl:if>
         
     | 
| 
       12435 
12500 
     | 
    
         
             
            	</xsl:template> <!-- addPDFUAmeta -->
         
     | 
| 
         @@ -12807,7 +12872,14 @@ 
     | 
|
| 
       12807 
12872 
     | 
    
         
             
            				<xsl:value-of select="$src"/>
         
     | 
| 
       12808 
12873 
     | 
    
         
             
            			</xsl:when>
         
     | 
| 
       12809 
12874 
     | 
    
         
             
            			<xsl:otherwise>
         
     | 
| 
       12810 
     | 
    
         
            -
            				<xsl: 
     | 
| 
      
 12875 
     | 
    
         
            +
            				<xsl:choose>
         
     | 
| 
      
 12876 
     | 
    
         
            +
            					<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         
     | 
| 
      
 12877 
     | 
    
         
            +
            						<xsl:value-of select="concat('url(file:///', @src, ')')"/>
         
     | 
| 
      
 12878 
     | 
    
         
            +
            					</xsl:when>
         
     | 
| 
      
 12879 
     | 
    
         
            +
            					<xsl:otherwise>
         
     | 
| 
      
 12880 
     | 
    
         
            +
            						<xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
         
     | 
| 
      
 12881 
     | 
    
         
            +
            					</xsl:otherwise>
         
     | 
| 
      
 12882 
     | 
    
         
            +
            				</xsl:choose>
         
     | 
| 
       12811 
12883 
     | 
    
         
             
            			</xsl:otherwise>
         
     | 
| 
       12812 
12884 
     | 
    
         
             
            		</xsl:choose>
         
     | 
| 
       12813 
12885 
     | 
    
         
             
            	</xsl:template>
         
     | 
| 
         @@ -2720,13 +2720,35 @@ 
     | 
|
| 
       2720 
2720 
     | 
    
         
             
            			</xsl:for-each>
         
     | 
| 
       2721 
2721 
     | 
    
         
             
            		</xsl:element>
         
     | 
| 
       2722 
2722 
     | 
    
         | 
| 
       2723 
     | 
    
         
            -
            		<xsl:call-template name=" 
     | 
| 
      
 2723 
     | 
    
         
            +
            		<xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
         
     | 
| 
       2724 
2724 
     | 
    
         | 
| 
       2725 
     | 
    
         
            -
            		<xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
         
     | 
| 
      
 2725 
     | 
    
         
            +
            		<!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
         
     | 
| 
       2726 
2726 
     | 
    
         | 
| 
       2727 
2727 
     | 
    
         
             
            		<!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
         
     | 
| 
       2728 
2728 
     | 
    
         
             
            	</xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
         
     | 
| 
       2729 
2729 
     | 
    
         | 
| 
      
 2730 
     | 
    
         
            +
            	<xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
         
     | 
| 
      
 2731 
     | 
    
         
            +
            		<xsl:for-each select="/*/*[local-name()='annex'] |           /*/*[local-name()='bibliography']/*[not(@normative='true')] |           /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]] |          /*/*[local-name()='indexsect']">
         
     | 
| 
      
 2732 
     | 
    
         
            +
            			<xsl:sort select="@displayorder" data-type="number"/>
         
     | 
| 
      
 2733 
     | 
    
         
            +
            			<xsl:choose>
         
     | 
| 
      
 2734 
     | 
    
         
            +
            				<xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
         
     | 
| 
      
 2735 
     | 
    
         
            +
            					<xsl:element name="page_sequence" namespace="{$namespace_full}">
         
     | 
| 
      
 2736 
     | 
    
         
            +
            						<xsl:attribute name="main_page_sequence"/>
         
     | 
| 
      
 2737 
     | 
    
         
            +
            						<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
         
     | 
| 
      
 2738 
     | 
    
         
            +
            					</xsl:element>
         
     | 
| 
      
 2739 
     | 
    
         
            +
            				</xsl:when>
         
     | 
| 
      
 2740 
     | 
    
         
            +
            				<xsl:otherwise> <!-- bibliography -->
         
     | 
| 
      
 2741 
     | 
    
         
            +
            					<xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
         
     | 
| 
      
 2742 
     | 
    
         
            +
            						<xsl:element name="page_sequence" namespace="{$namespace_full}">
         
     | 
| 
      
 2743 
     | 
    
         
            +
            							<xsl:attribute name="main_page_sequence"/>
         
     | 
| 
      
 2744 
     | 
    
         
            +
            							<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
         
     | 
| 
      
 2745 
     | 
    
         
            +
            						</xsl:element>
         
     | 
| 
      
 2746 
     | 
    
         
            +
            					</xsl:element>
         
     | 
| 
      
 2747 
     | 
    
         
            +
            				</xsl:otherwise>
         
     | 
| 
      
 2748 
     | 
    
         
            +
            			</xsl:choose>
         
     | 
| 
      
 2749 
     | 
    
         
            +
            		</xsl:for-each>
         
     | 
| 
      
 2750 
     | 
    
         
            +
            	</xsl:template>
         
     | 
| 
      
 2751 
     | 
    
         
            +
             
     | 
| 
       2730 
2752 
     | 
    
         
             
            	<xsl:template name="insertAnnexInSeparatePageSequences">
         
     | 
| 
       2731 
2753 
     | 
    
         
             
            		<xsl:for-each select="/*/*[local-name()='annex']">
         
     | 
| 
       2732 
2754 
     | 
    
         
             
            			<xsl:sort select="@displayorder" data-type="number"/>
         
     | 
| 
         @@ -6917,6 +6939,12 @@ 
     | 
|
| 
       6917 
6939 
     | 
    
         
             
            		<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
         
     | 
| 
       6918 
6940 
     | 
    
         
             
            			<attachment filename="{@name}"/>
         
     | 
| 
       6919 
6941 
     | 
    
         
             
            		</xsl:for-each>
         
     | 
| 
      
 6942 
     | 
    
         
            +
            		<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
         
     | 
| 
      
 6943 
     | 
    
         
            +
            			<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
         
     | 
| 
      
 6944 
     | 
    
         
            +
            				<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
         
     | 
| 
      
 6945 
     | 
    
         
            +
            				<attachment filename="{$attachment_path}"/>
         
     | 
| 
      
 6946 
     | 
    
         
            +
            			</xsl:for-each>
         
     | 
| 
      
 6947 
     | 
    
         
            +
            		</xsl:if>
         
     | 
| 
       6920 
6948 
     | 
    
         
             
            	</xsl:variable>
         
     | 
| 
       6921 
6949 
     | 
    
         
             
            	<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
         
     | 
| 
       6922 
6950 
     | 
    
         | 
| 
         @@ -6929,7 +6957,7 @@ 
     | 
|
| 
       6929 
6957 
     | 
    
         
             
            					<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
         
     | 
| 
       6930 
6958 
     | 
    
         
             
            				</xsl:when>
         
     | 
| 
       6931 
6959 
     | 
    
         
             
            				<!-- link to the PDF attachment -->
         
     | 
| 
       6932 
     | 
    
         
            -
            				<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
         
     | 
| 
      
 6960 
     | 
    
         
            +
            				<xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
         
     | 
| 
       6933 
6961 
     | 
    
         
             
            					<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
         
     | 
| 
       6934 
6962 
     | 
    
         
             
            				</xsl:when>
         
     | 
| 
       6935 
6963 
     | 
    
         
             
            				<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
         
     | 
| 
         @@ -7589,7 +7617,16 @@ 
     | 
|
| 
       7589 
7617 
     | 
    
         
             
            		</xsl:variable>
         
     | 
| 
       7590 
7618 
     | 
    
         
             
            		<xsl:variable name="img_src">
         
     | 
| 
       7591 
7619 
     | 
    
         
             
            			<xsl:choose>
         
     | 
| 
       7592 
     | 
    
         
            -
            				<xsl:when test="not(starts-with(@src, 'data:'))" 
     | 
| 
      
 7620 
     | 
    
         
            +
            				<xsl:when test="not(starts-with(@src, 'data:'))">
         
     | 
| 
      
 7621 
     | 
    
         
            +
            					<xsl:choose>
         
     | 
| 
      
 7622 
     | 
    
         
            +
            						<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         
     | 
| 
      
 7623 
     | 
    
         
            +
            							<xsl:value-of select="@src"/>
         
     | 
| 
      
 7624 
     | 
    
         
            +
            						</xsl:when>
         
     | 
| 
      
 7625 
     | 
    
         
            +
            						<xsl:otherwise>
         
     | 
| 
      
 7626 
     | 
    
         
            +
            							<xsl:value-of select="concat($basepath, @src)"/>
         
     | 
| 
      
 7627 
     | 
    
         
            +
            						</xsl:otherwise>
         
     | 
| 
      
 7628 
     | 
    
         
            +
            					</xsl:choose>
         
     | 
| 
      
 7629 
     | 
    
         
            +
            				</xsl:when>
         
     | 
| 
       7593 
7630 
     | 
    
         
             
            				<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
         
     | 
| 
       7594 
7631 
     | 
    
         
             
            			</xsl:choose>
         
     | 
| 
       7595 
7632 
     | 
    
         
             
            		</xsl:variable>
         
     | 
| 
         @@ -7602,7 +7639,7 @@ 
     | 
|
| 
       7602 
7639 
     | 
    
         
             
            		<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
         
     | 
| 
       7603 
7640 
     | 
    
         
             
            		<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
         
     | 
| 
       7604 
7641 
     | 
    
         
             
            		<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
         
     | 
| 
       7605 
     | 
    
         
            -
            		<xsl:variable name="scale" select="java:org.metanorma.fop. 
     | 
| 
      
 7642 
     | 
    
         
            +
            		<xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
         
     | 
| 
       7606 
7643 
     | 
    
         
             
            		<xsl:value-of select="$scale"/>
         
     | 
| 
       7607 
7644 
     | 
    
         
             
            	</xsl:template>
         
     | 
| 
       7608 
7645 
     | 
    
         | 
| 
         @@ -7621,7 +7658,14 @@ 
     | 
|
| 
       7621 
7658 
     | 
    
         
             
            				<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
         
     | 
| 
       7622 
7659 
     | 
    
         
             
            			</xsl:when>
         
     | 
| 
       7623 
7660 
     | 
    
         
             
            			<xsl:when test="not(starts-with(@src, 'data:'))">
         
     | 
| 
       7624 
     | 
    
         
            -
            				<xsl: 
     | 
| 
      
 7661 
     | 
    
         
            +
            				<xsl:choose>
         
     | 
| 
      
 7662 
     | 
    
         
            +
            					<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         
     | 
| 
      
 7663 
     | 
    
         
            +
            						<xsl:value-of select="concat('url(file:///', @src, ')')"/>
         
     | 
| 
      
 7664 
     | 
    
         
            +
            					</xsl:when>
         
     | 
| 
      
 7665 
     | 
    
         
            +
            					<xsl:otherwise>
         
     | 
| 
      
 7666 
     | 
    
         
            +
            						<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
         
     | 
| 
      
 7667 
     | 
    
         
            +
            					</xsl:otherwise>
         
     | 
| 
      
 7668 
     | 
    
         
            +
            				</xsl:choose>
         
     | 
| 
       7625 
7669 
     | 
    
         
             
            			</xsl:when>
         
     | 
| 
       7626 
7670 
     | 
    
         
             
            			<xsl:otherwise>
         
     | 
| 
       7627 
7671 
     | 
    
         
             
            				<xsl:value-of select="@src"/>
         
     | 
| 
         @@ -7643,7 +7687,14 @@ 
     | 
|
| 
       7643 
7687 
     | 
    
         
             
            			</xsl:when>
         
     | 
| 
       7644 
7688 
     | 
    
         
             
            			<xsl:when test="not(starts-with(@src, 'data:'))">
         
     | 
| 
       7645 
7689 
     | 
    
         
             
            				<xsl:variable name="src">
         
     | 
| 
       7646 
     | 
    
         
            -
            					<xsl: 
     | 
| 
      
 7690 
     | 
    
         
            +
            					<xsl:choose>
         
     | 
| 
      
 7691 
     | 
    
         
            +
            						<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         
     | 
| 
      
 7692 
     | 
    
         
            +
            							<xsl:value-of select="concat('url(file:///', @src, ')')"/>
         
     | 
| 
      
 7693 
     | 
    
         
            +
            						</xsl:when>
         
     | 
| 
      
 7694 
     | 
    
         
            +
            						<xsl:otherwise>
         
     | 
| 
      
 7695 
     | 
    
         
            +
            							<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
         
     | 
| 
      
 7696 
     | 
    
         
            +
            						</xsl:otherwise>
         
     | 
| 
      
 7697 
     | 
    
         
            +
            					</xsl:choose>
         
     | 
| 
       7647 
7698 
     | 
    
         
             
            				</xsl:variable>
         
     | 
| 
       7648 
7699 
     | 
    
         
             
            				<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
         
     | 
| 
       7649 
7700 
     | 
    
         
             
            				<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
         
     | 
| 
         @@ -11535,10 +11586,12 @@ 
     | 
|
| 
       11535 
11586 
     | 
    
         
             
            	<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
         
     | 
| 
       11536 
11587 
     | 
    
         
             
            		<xsl:copy>
         
     | 
| 
       11537 
11588 
     | 
    
         
             
            			<xsl:copy-of select="@*"/>
         
     | 
| 
       11538 
     | 
    
         
            -
            			<xsl: 
     | 
| 
       11539 
     | 
    
         
            -
             
     | 
| 
       11540 
     | 
    
         
            -
             
     | 
| 
       11541 
     | 
    
         
            -
            				<xsl: 
     | 
| 
      
 11589 
     | 
    
         
            +
            			<xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
         
     | 
| 
      
 11590 
     | 
    
         
            +
            				<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
         
     | 
| 
      
 11591 
     | 
    
         
            +
            				<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
         
     | 
| 
      
 11592 
     | 
    
         
            +
            				<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
         
     | 
| 
      
 11593 
     | 
    
         
            +
            					<xsl:value-of select="normalize-space(.)"/>
         
     | 
| 
      
 11594 
     | 
    
         
            +
            				</xsl:if>
         
     | 
| 
       11542 
11595 
     | 
    
         
             
            			</xsl:if>
         
     | 
| 
       11543 
11596 
     | 
    
         
             
            		</xsl:copy>
         
     | 
| 
       11544 
11597 
     | 
    
         
             
            	</xsl:template>
         
     | 
| 
         @@ -12411,25 +12464,37 @@ 
     | 
|
| 
       12411 
12464 
     | 
    
         
             
            		</x:xmpmeta>
         
     | 
| 
       12412 
12465 
     | 
    
         
             
            		<!-- add attachments -->
         
     | 
| 
       12413 
12466 
     | 
    
         
             
            		<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
         
     | 
| 
       12414 
     | 
    
         
            -
            			<xsl: 
     | 
| 
       12415 
     | 
    
         
            -
             
     | 
| 
       12416 
     | 
    
         
            -
             
     | 
| 
       12417 
     | 
    
         
            -
            				 
     | 
| 
       12418 
     | 
    
         
            -
             
     | 
| 
       12419 
     | 
    
         
            -
             
     | 
| 
       12420 
     | 
    
         
            -
             
     | 
| 
       12421 
     | 
    
         
            -
             
     | 
| 
       12422 
     | 
    
         
            -
             
     | 
| 
       12423 
     | 
    
         
            -
             
     | 
| 
       12424 
     | 
    
         
            -
             
     | 
| 
      
 12467 
     | 
    
         
            +
            			<xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
         
     | 
| 
      
 12468 
     | 
    
         
            +
             
     | 
| 
      
 12469 
     | 
    
         
            +
            			<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
         
     | 
| 
      
 12470 
     | 
    
         
            +
            				<xsl:attribute name="src">
         
     | 
| 
      
 12471 
     | 
    
         
            +
            					<xsl:choose>
         
     | 
| 
      
 12472 
     | 
    
         
            +
            						<xsl:when test="normalize-space() != ''">
         
     | 
| 
      
 12473 
     | 
    
         
            +
            							<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(
|
|
)', '')"/> <!-- remove line breaks -->
         
     | 
| 
      
 12474 
     | 
    
         
            +
            							<xsl:value-of select="$src_attachment"/>
         
     | 
| 
      
 12475 
     | 
    
         
            +
            						</xsl:when>
         
     | 
| 
      
 12476 
     | 
    
         
            +
            						<xsl:otherwise>
         
     | 
| 
      
 12477 
     | 
    
         
            +
            							<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
         
     | 
| 
      
 12478 
     | 
    
         
            +
            							<xsl:value-of select="$url"/>
         
     | 
| 
      
 12479 
     | 
    
         
            +
            						</xsl:otherwise>
         
     | 
| 
      
 12480 
     | 
    
         
            +
            					</xsl:choose>
         
     | 
| 
      
 12481 
     | 
    
         
            +
            				</xsl:attribute>
         
     | 
| 
      
 12482 
     | 
    
         
            +
            				<xsl:if test="$description != ''">
         
     | 
| 
      
 12483 
     | 
    
         
            +
            					<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
         
     | 
| 
      
 12484 
     | 
    
         
            +
            				</xsl:if>
         
     | 
| 
      
 12485 
     | 
    
         
            +
            			</pdf:embedded-file>
         
     | 
| 
       12425 
12486 
     | 
    
         
             
            		</xsl:for-each>
         
     | 
| 
       12426 
12487 
     | 
    
         
             
            		<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
         
     | 
| 
       12427 
12488 
     | 
    
         
             
            		<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
         
     | 
| 
       12428 
12489 
     | 
    
         
             
            			<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
         
     | 
| 
       12429 
12490 
     | 
    
         
             
            				<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
         
     | 
| 
       12430 
     | 
    
         
            -
            				<xsl:variable name="url" select="concat('url(file:///',$ 
     | 
| 
       12431 
     | 
    
         
            -
            				<xsl:variable name=" 
     | 
| 
       12432 
     | 
    
         
            -
            				<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$ 
     | 
| 
      
 12491 
     | 
    
         
            +
            				<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
         
     | 
| 
      
 12492 
     | 
    
         
            +
            				<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
         
     | 
| 
      
 12493 
     | 
    
         
            +
            				<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
         
     | 
| 
      
 12494 
     | 
    
         
            +
            					<xsl:if test="$description != ''">
         
     | 
| 
      
 12495 
     | 
    
         
            +
            						<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
         
     | 
| 
      
 12496 
     | 
    
         
            +
            					</xsl:if>
         
     | 
| 
      
 12497 
     | 
    
         
            +
            				</pdf:embedded-file>
         
     | 
| 
       12433 
12498 
     | 
    
         
             
            			</xsl:for-each>
         
     | 
| 
       12434 
12499 
     | 
    
         
             
            		</xsl:if>
         
     | 
| 
       12435 
12500 
     | 
    
         
             
            	</xsl:template> <!-- addPDFUAmeta -->
         
     | 
| 
         @@ -12807,7 +12872,14 @@ 
     | 
|
| 
       12807 
12872 
     | 
    
         
             
            				<xsl:value-of select="$src"/>
         
     | 
| 
       12808 
12873 
     | 
    
         
             
            			</xsl:when>
         
     | 
| 
       12809 
12874 
     | 
    
         
             
            			<xsl:otherwise>
         
     | 
| 
       12810 
     | 
    
         
            -
            				<xsl: 
     | 
| 
      
 12875 
     | 
    
         
            +
            				<xsl:choose>
         
     | 
| 
      
 12876 
     | 
    
         
            +
            					<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         
     | 
| 
      
 12877 
     | 
    
         
            +
            						<xsl:value-of select="concat('url(file:///', @src, ')')"/>
         
     | 
| 
      
 12878 
     | 
    
         
            +
            					</xsl:when>
         
     | 
| 
      
 12879 
     | 
    
         
            +
            					<xsl:otherwise>
         
     | 
| 
      
 12880 
     | 
    
         
            +
            						<xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
         
     | 
| 
      
 12881 
     | 
    
         
            +
            					</xsl:otherwise>
         
     | 
| 
      
 12882 
     | 
    
         
            +
            				</xsl:choose>
         
     | 
| 
       12811 
12883 
     | 
    
         
             
            			</xsl:otherwise>
         
     | 
| 
       12812 
12884 
     | 
    
         
             
            		</xsl:choose>
         
     | 
| 
       12813 
12885 
     | 
    
         
             
            	</xsl:template>
         
     | 
| 
         @@ -2823,13 +2823,35 @@ 
     | 
|
| 
       2823 
2823 
     | 
    
         
             
            			</xsl:for-each>
         
     | 
| 
       2824 
2824 
     | 
    
         
             
            		</xsl:element>
         
     | 
| 
       2825 
2825 
     | 
    
         | 
| 
       2826 
     | 
    
         
            -
            		<xsl:call-template name=" 
     | 
| 
      
 2826 
     | 
    
         
            +
            		<xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
         
     | 
| 
       2827 
2827 
     | 
    
         | 
| 
       2828 
     | 
    
         
            -
            		<xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
         
     | 
| 
      
 2828 
     | 
    
         
            +
            		<!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
         
     | 
| 
       2829 
2829 
     | 
    
         | 
| 
       2830 
2830 
     | 
    
         
             
            		<!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
         
     | 
| 
       2831 
2831 
     | 
    
         
             
            	</xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
         
     | 
| 
       2832 
2832 
     | 
    
         | 
| 
      
 2833 
     | 
    
         
            +
            	<xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
         
     | 
| 
      
 2834 
     | 
    
         
            +
            		<xsl:for-each select="/*/*[local-name()='annex'] |           /*/*[local-name()='bibliography']/*[not(@normative='true')] |           /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]] |          /*/*[local-name()='indexsect']">
         
     | 
| 
      
 2835 
     | 
    
         
            +
            			<xsl:sort select="@displayorder" data-type="number"/>
         
     | 
| 
      
 2836 
     | 
    
         
            +
            			<xsl:choose>
         
     | 
| 
      
 2837 
     | 
    
         
            +
            				<xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
         
     | 
| 
      
 2838 
     | 
    
         
            +
            					<xsl:element name="page_sequence" namespace="{$namespace_full}">
         
     | 
| 
      
 2839 
     | 
    
         
            +
            						<xsl:attribute name="main_page_sequence"/>
         
     | 
| 
      
 2840 
     | 
    
         
            +
            						<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
         
     | 
| 
      
 2841 
     | 
    
         
            +
            					</xsl:element>
         
     | 
| 
      
 2842 
     | 
    
         
            +
            				</xsl:when>
         
     | 
| 
      
 2843 
     | 
    
         
            +
            				<xsl:otherwise> <!-- bibliography -->
         
     | 
| 
      
 2844 
     | 
    
         
            +
            					<xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
         
     | 
| 
      
 2845 
     | 
    
         
            +
            						<xsl:element name="page_sequence" namespace="{$namespace_full}">
         
     | 
| 
      
 2846 
     | 
    
         
            +
            							<xsl:attribute name="main_page_sequence"/>
         
     | 
| 
      
 2847 
     | 
    
         
            +
            							<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
         
     | 
| 
      
 2848 
     | 
    
         
            +
            						</xsl:element>
         
     | 
| 
      
 2849 
     | 
    
         
            +
            					</xsl:element>
         
     | 
| 
      
 2850 
     | 
    
         
            +
            				</xsl:otherwise>
         
     | 
| 
      
 2851 
     | 
    
         
            +
            			</xsl:choose>
         
     | 
| 
      
 2852 
     | 
    
         
            +
            		</xsl:for-each>
         
     | 
| 
      
 2853 
     | 
    
         
            +
            	</xsl:template>
         
     | 
| 
      
 2854 
     | 
    
         
            +
             
     | 
| 
       2833 
2855 
     | 
    
         
             
            	<xsl:template name="insertAnnexInSeparatePageSequences">
         
     | 
| 
       2834 
2856 
     | 
    
         
             
            		<xsl:for-each select="/*/*[local-name()='annex']">
         
     | 
| 
       2835 
2857 
     | 
    
         
             
            			<xsl:sort select="@displayorder" data-type="number"/>
         
     | 
| 
         @@ -7016,6 +7038,12 @@ 
     | 
|
| 
       7016 
7038 
     | 
    
         
             
            		<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
         
     | 
| 
       7017 
7039 
     | 
    
         
             
            			<attachment filename="{@name}"/>
         
     | 
| 
       7018 
7040 
     | 
    
         
             
            		</xsl:for-each>
         
     | 
| 
      
 7041 
     | 
    
         
            +
            		<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
         
     | 
| 
      
 7042 
     | 
    
         
            +
            			<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
         
     | 
| 
      
 7043 
     | 
    
         
            +
            				<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
         
     | 
| 
      
 7044 
     | 
    
         
            +
            				<attachment filename="{$attachment_path}"/>
         
     | 
| 
      
 7045 
     | 
    
         
            +
            			</xsl:for-each>
         
     | 
| 
      
 7046 
     | 
    
         
            +
            		</xsl:if>
         
     | 
| 
       7019 
7047 
     | 
    
         
             
            	</xsl:variable>
         
     | 
| 
       7020 
7048 
     | 
    
         
             
            	<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
         
     | 
| 
       7021 
7049 
     | 
    
         | 
| 
         @@ -7028,7 +7056,7 @@ 
     | 
|
| 
       7028 
7056 
     | 
    
         
             
            					<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
         
     | 
| 
       7029 
7057 
     | 
    
         
             
            				</xsl:when>
         
     | 
| 
       7030 
7058 
     | 
    
         
             
            				<!-- link to the PDF attachment -->
         
     | 
| 
       7031 
     | 
    
         
            -
            				<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
         
     | 
| 
      
 7059 
     | 
    
         
            +
            				<xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
         
     | 
| 
       7032 
7060 
     | 
    
         
             
            					<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
         
     | 
| 
       7033 
7061 
     | 
    
         
             
            				</xsl:when>
         
     | 
| 
       7034 
7062 
     | 
    
         
             
            				<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
         
     | 
| 
         @@ -7688,7 +7716,16 @@ 
     | 
|
| 
       7688 
7716 
     | 
    
         
             
            		</xsl:variable>
         
     | 
| 
       7689 
7717 
     | 
    
         
             
            		<xsl:variable name="img_src">
         
     | 
| 
       7690 
7718 
     | 
    
         
             
            			<xsl:choose>
         
     | 
| 
       7691 
     | 
    
         
            -
            				<xsl:when test="not(starts-with(@src, 'data:'))" 
     | 
| 
      
 7719 
     | 
    
         
            +
            				<xsl:when test="not(starts-with(@src, 'data:'))">
         
     | 
| 
      
 7720 
     | 
    
         
            +
            					<xsl:choose>
         
     | 
| 
      
 7721 
     | 
    
         
            +
            						<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         
     | 
| 
      
 7722 
     | 
    
         
            +
            							<xsl:value-of select="@src"/>
         
     | 
| 
      
 7723 
     | 
    
         
            +
            						</xsl:when>
         
     | 
| 
      
 7724 
     | 
    
         
            +
            						<xsl:otherwise>
         
     | 
| 
      
 7725 
     | 
    
         
            +
            							<xsl:value-of select="concat($basepath, @src)"/>
         
     | 
| 
      
 7726 
     | 
    
         
            +
            						</xsl:otherwise>
         
     | 
| 
      
 7727 
     | 
    
         
            +
            					</xsl:choose>
         
     | 
| 
      
 7728 
     | 
    
         
            +
            				</xsl:when>
         
     | 
| 
       7692 
7729 
     | 
    
         
             
            				<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
         
     | 
| 
       7693 
7730 
     | 
    
         
             
            			</xsl:choose>
         
     | 
| 
       7694 
7731 
     | 
    
         
             
            		</xsl:variable>
         
     | 
| 
         @@ -7701,7 +7738,7 @@ 
     | 
|
| 
       7701 
7738 
     | 
    
         
             
            		<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
         
     | 
| 
       7702 
7739 
     | 
    
         
             
            		<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
         
     | 
| 
       7703 
7740 
     | 
    
         
             
            		<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
         
     | 
| 
       7704 
     | 
    
         
            -
            		<xsl:variable name="scale" select="java:org.metanorma.fop. 
     | 
| 
      
 7741 
     | 
    
         
            +
            		<xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
         
     | 
| 
       7705 
7742 
     | 
    
         
             
            		<xsl:value-of select="$scale"/>
         
     | 
| 
       7706 
7743 
     | 
    
         
             
            	</xsl:template>
         
     | 
| 
       7707 
7744 
     | 
    
         | 
| 
         @@ -7720,7 +7757,14 @@ 
     | 
|
| 
       7720 
7757 
     | 
    
         
             
            				<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
         
     | 
| 
       7721 
7758 
     | 
    
         
             
            			</xsl:when>
         
     | 
| 
       7722 
7759 
     | 
    
         
             
            			<xsl:when test="not(starts-with(@src, 'data:'))">
         
     | 
| 
       7723 
     | 
    
         
            -
            				<xsl: 
     | 
| 
      
 7760 
     | 
    
         
            +
            				<xsl:choose>
         
     | 
| 
      
 7761 
     | 
    
         
            +
            					<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         
     | 
| 
      
 7762 
     | 
    
         
            +
            						<xsl:value-of select="concat('url(file:///', @src, ')')"/>
         
     | 
| 
      
 7763 
     | 
    
         
            +
            					</xsl:when>
         
     | 
| 
      
 7764 
     | 
    
         
            +
            					<xsl:otherwise>
         
     | 
| 
      
 7765 
     | 
    
         
            +
            						<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
         
     | 
| 
      
 7766 
     | 
    
         
            +
            					</xsl:otherwise>
         
     | 
| 
      
 7767 
     | 
    
         
            +
            				</xsl:choose>
         
     | 
| 
       7724 
7768 
     | 
    
         
             
            			</xsl:when>
         
     | 
| 
       7725 
7769 
     | 
    
         
             
            			<xsl:otherwise>
         
     | 
| 
       7726 
7770 
     | 
    
         
             
            				<xsl:value-of select="@src"/>
         
     | 
| 
         @@ -7742,7 +7786,14 @@ 
     | 
|
| 
       7742 
7786 
     | 
    
         
             
            			</xsl:when>
         
     | 
| 
       7743 
7787 
     | 
    
         
             
            			<xsl:when test="not(starts-with(@src, 'data:'))">
         
     | 
| 
       7744 
7788 
     | 
    
         
             
            				<xsl:variable name="src">
         
     | 
| 
       7745 
     | 
    
         
            -
            					<xsl: 
     | 
| 
      
 7789 
     | 
    
         
            +
            					<xsl:choose>
         
     | 
| 
      
 7790 
     | 
    
         
            +
            						<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         
     | 
| 
      
 7791 
     | 
    
         
            +
            							<xsl:value-of select="concat('url(file:///', @src, ')')"/>
         
     | 
| 
      
 7792 
     | 
    
         
            +
            						</xsl:when>
         
     | 
| 
      
 7793 
     | 
    
         
            +
            						<xsl:otherwise>
         
     | 
| 
      
 7794 
     | 
    
         
            +
            							<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
         
     | 
| 
      
 7795 
     | 
    
         
            +
            						</xsl:otherwise>
         
     | 
| 
      
 7796 
     | 
    
         
            +
            					</xsl:choose>
         
     | 
| 
       7746 
7797 
     | 
    
         
             
            				</xsl:variable>
         
     | 
| 
       7747 
7798 
     | 
    
         
             
            				<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
         
     | 
| 
       7748 
7799 
     | 
    
         
             
            				<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
         
     | 
| 
         @@ -11635,10 +11686,12 @@ 
     | 
|
| 
       11635 
11686 
     | 
    
         
             
            	<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
         
     | 
| 
       11636 
11687 
     | 
    
         
             
            		<xsl:copy>
         
     | 
| 
       11637 
11688 
     | 
    
         
             
            			<xsl:copy-of select="@*"/>
         
     | 
| 
       11638 
     | 
    
         
            -
            			<xsl: 
     | 
| 
       11639 
     | 
    
         
            -
             
     | 
| 
       11640 
     | 
    
         
            -
             
     | 
| 
       11641 
     | 
    
         
            -
            				<xsl: 
     | 
| 
      
 11689 
     | 
    
         
            +
            			<xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
         
     | 
| 
      
 11690 
     | 
    
         
            +
            				<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
         
     | 
| 
      
 11691 
     | 
    
         
            +
            				<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
         
     | 
| 
      
 11692 
     | 
    
         
            +
            				<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
         
     | 
| 
      
 11693 
     | 
    
         
            +
            					<xsl:value-of select="normalize-space(.)"/>
         
     | 
| 
      
 11694 
     | 
    
         
            +
            				</xsl:if>
         
     | 
| 
       11642 
11695 
     | 
    
         
             
            			</xsl:if>
         
     | 
| 
       11643 
11696 
     | 
    
         
             
            		</xsl:copy>
         
     | 
| 
       11644 
11697 
     | 
    
         
             
            	</xsl:template>
         
     | 
| 
         @@ -12511,25 +12564,37 @@ 
     | 
|
| 
       12511 
12564 
     | 
    
         
             
            		</x:xmpmeta>
         
     | 
| 
       12512 
12565 
     | 
    
         
             
            		<!-- add attachments -->
         
     | 
| 
       12513 
12566 
     | 
    
         
             
            		<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
         
     | 
| 
       12514 
     | 
    
         
            -
            			<xsl: 
     | 
| 
       12515 
     | 
    
         
            -
             
     | 
| 
       12516 
     | 
    
         
            -
             
     | 
| 
       12517 
     | 
    
         
            -
            				 
     | 
| 
       12518 
     | 
    
         
            -
             
     | 
| 
       12519 
     | 
    
         
            -
             
     | 
| 
       12520 
     | 
    
         
            -
             
     | 
| 
       12521 
     | 
    
         
            -
             
     | 
| 
       12522 
     | 
    
         
            -
             
     | 
| 
       12523 
     | 
    
         
            -
             
     | 
| 
       12524 
     | 
    
         
            -
             
     | 
| 
      
 12567 
     | 
    
         
            +
            			<xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
         
     | 
| 
      
 12568 
     | 
    
         
            +
             
     | 
| 
      
 12569 
     | 
    
         
            +
            			<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
         
     | 
| 
      
 12570 
     | 
    
         
            +
            				<xsl:attribute name="src">
         
     | 
| 
      
 12571 
     | 
    
         
            +
            					<xsl:choose>
         
     | 
| 
      
 12572 
     | 
    
         
            +
            						<xsl:when test="normalize-space() != ''">
         
     | 
| 
      
 12573 
     | 
    
         
            +
            							<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(
|
|
)', '')"/> <!-- remove line breaks -->
         
     | 
| 
      
 12574 
     | 
    
         
            +
            							<xsl:value-of select="$src_attachment"/>
         
     | 
| 
      
 12575 
     | 
    
         
            +
            						</xsl:when>
         
     | 
| 
      
 12576 
     | 
    
         
            +
            						<xsl:otherwise>
         
     | 
| 
      
 12577 
     | 
    
         
            +
            							<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
         
     | 
| 
      
 12578 
     | 
    
         
            +
            							<xsl:value-of select="$url"/>
         
     | 
| 
      
 12579 
     | 
    
         
            +
            						</xsl:otherwise>
         
     | 
| 
      
 12580 
     | 
    
         
            +
            					</xsl:choose>
         
     | 
| 
      
 12581 
     | 
    
         
            +
            				</xsl:attribute>
         
     | 
| 
      
 12582 
     | 
    
         
            +
            				<xsl:if test="$description != ''">
         
     | 
| 
      
 12583 
     | 
    
         
            +
            					<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
         
     | 
| 
      
 12584 
     | 
    
         
            +
            				</xsl:if>
         
     | 
| 
      
 12585 
     | 
    
         
            +
            			</pdf:embedded-file>
         
     | 
| 
       12525 
12586 
     | 
    
         
             
            		</xsl:for-each>
         
     | 
| 
       12526 
12587 
     | 
    
         
             
            		<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
         
     | 
| 
       12527 
12588 
     | 
    
         
             
            		<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
         
     | 
| 
       12528 
12589 
     | 
    
         
             
            			<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
         
     | 
| 
       12529 
12590 
     | 
    
         
             
            				<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
         
     | 
| 
       12530 
     | 
    
         
            -
            				<xsl:variable name="url" select="concat('url(file:///',$ 
     | 
| 
       12531 
     | 
    
         
            -
            				<xsl:variable name=" 
     | 
| 
       12532 
     | 
    
         
            -
            				<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$ 
     | 
| 
      
 12591 
     | 
    
         
            +
            				<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
         
     | 
| 
      
 12592 
     | 
    
         
            +
            				<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
         
     | 
| 
      
 12593 
     | 
    
         
            +
            				<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
         
     | 
| 
      
 12594 
     | 
    
         
            +
            					<xsl:if test="$description != ''">
         
     | 
| 
      
 12595 
     | 
    
         
            +
            						<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
         
     | 
| 
      
 12596 
     | 
    
         
            +
            					</xsl:if>
         
     | 
| 
      
 12597 
     | 
    
         
            +
            				</pdf:embedded-file>
         
     | 
| 
       12533 
12598 
     | 
    
         
             
            			</xsl:for-each>
         
     | 
| 
       12534 
12599 
     | 
    
         
             
            		</xsl:if>
         
     | 
| 
       12535 
12600 
     | 
    
         
             
            	</xsl:template> <!-- addPDFUAmeta -->
         
     | 
| 
         @@ -12907,7 +12972,14 @@ 
     | 
|
| 
       12907 
12972 
     | 
    
         
             
            				<xsl:value-of select="$src"/>
         
     | 
| 
       12908 
12973 
     | 
    
         
             
            			</xsl:when>
         
     | 
| 
       12909 
12974 
     | 
    
         
             
            			<xsl:otherwise>
         
     | 
| 
       12910 
     | 
    
         
            -
            				<xsl: 
     | 
| 
      
 12975 
     | 
    
         
            +
            				<xsl:choose>
         
     | 
| 
      
 12976 
     | 
    
         
            +
            					<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         
     | 
| 
      
 12977 
     | 
    
         
            +
            						<xsl:value-of select="concat('url(file:///', @src, ')')"/>
         
     | 
| 
      
 12978 
     | 
    
         
            +
            					</xsl:when>
         
     | 
| 
      
 12979 
     | 
    
         
            +
            					<xsl:otherwise>
         
     | 
| 
      
 12980 
     | 
    
         
            +
            						<xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
         
     | 
| 
      
 12981 
     | 
    
         
            +
            					</xsl:otherwise>
         
     | 
| 
      
 12982 
     | 
    
         
            +
            				</xsl:choose>
         
     | 
| 
       12911 
12983 
     | 
    
         
             
            			</xsl:otherwise>
         
     | 
| 
       12912 
12984 
     | 
    
         
             
            		</xsl:choose>
         
     | 
| 
       12913 
12985 
     | 
    
         
             
            	</xsl:template>
         
     | 
| 
         @@ -1000,14 +1000,14 @@ 
     | 
|
| 
       1000 
1000 
     | 
    
         
             
              <define name="PureTextElement">
         
     | 
| 
       1001 
1001 
     | 
    
         
             
                <choice>
         
     | 
| 
       1002 
1002 
     | 
    
         
             
                  <text/>
         
     | 
| 
       1003 
     | 
    
         
            -
                  <ref name=" 
     | 
| 
       1004 
     | 
    
         
            -
                  <ref name=" 
     | 
| 
      
 1003 
     | 
    
         
            +
                  <ref name="pure_em"/>
         
     | 
| 
      
 1004 
     | 
    
         
            +
                  <ref name="pure_strong"/>
         
     | 
| 
       1005 
1005 
     | 
    
         
             
                  <ref name="sub"/>
         
     | 
| 
       1006 
1006 
     | 
    
         
             
                  <ref name="sup"/>
         
     | 
| 
       1007 
     | 
    
         
            -
                  <ref name=" 
     | 
| 
       1008 
     | 
    
         
            -
                  <ref name=" 
     | 
| 
       1009 
     | 
    
         
            -
                  <ref name=" 
     | 
| 
       1010 
     | 
    
         
            -
                  <ref name=" 
     | 
| 
      
 1007 
     | 
    
         
            +
                  <ref name="pure_tt"/>
         
     | 
| 
      
 1008 
     | 
    
         
            +
                  <ref name="pure_underline"/>
         
     | 
| 
      
 1009 
     | 
    
         
            +
                  <ref name="pure_strike"/>
         
     | 
| 
      
 1010 
     | 
    
         
            +
                  <ref name="pure_smallcap"/>
         
     | 
| 
       1011 
1011 
     | 
    
         
             
                  <ref name="br"/>
         
     | 
| 
       1012 
1012 
     | 
    
         
             
                </choice>
         
     | 
| 
       1013 
1013 
     | 
    
         
             
              </define>
         
     | 
| 
         @@ -1031,6 +1031,13 @@ 
     | 
|
| 
       1031 
1031 
     | 
    
         
             
                  </zeroOrMore>
         
     | 
| 
       1032 
1032 
     | 
    
         
             
                </element>
         
     | 
| 
       1033 
1033 
     | 
    
         
             
              </define>
         
     | 
| 
      
 1034 
     | 
    
         
            +
              <define name="pure_em">
         
     | 
| 
      
 1035 
     | 
    
         
            +
                <element name="em">
         
     | 
| 
      
 1036 
     | 
    
         
            +
                  <zeroOrMore>
         
     | 
| 
      
 1037 
     | 
    
         
            +
                    <ref name="PureTextElement"/>
         
     | 
| 
      
 1038 
     | 
    
         
            +
                  </zeroOrMore>
         
     | 
| 
      
 1039 
     | 
    
         
            +
                </element>
         
     | 
| 
      
 1040 
     | 
    
         
            +
              </define>
         
     | 
| 
       1034 
1041 
     | 
    
         
             
              <define name="strong">
         
     | 
| 
       1035 
1042 
     | 
    
         
             
                <element name="strong">
         
     | 
| 
       1036 
1043 
     | 
    
         
             
                  <zeroOrMore>
         
     | 
| 
         @@ -1046,6 +1053,13 @@ 
     | 
|
| 
       1046 
1053 
     | 
    
         
             
                  </zeroOrMore>
         
     | 
| 
       1047 
1054 
     | 
    
         
             
                </element>
         
     | 
| 
       1048 
1055 
     | 
    
         
             
              </define>
         
     | 
| 
      
 1056 
     | 
    
         
            +
              <define name="pure_strong">
         
     | 
| 
      
 1057 
     | 
    
         
            +
                <element name="strong">
         
     | 
| 
      
 1058 
     | 
    
         
            +
                  <zeroOrMore>
         
     | 
| 
      
 1059 
     | 
    
         
            +
                    <ref name="PureTextElement"/>
         
     | 
| 
      
 1060 
     | 
    
         
            +
                  </zeroOrMore>
         
     | 
| 
      
 1061 
     | 
    
         
            +
                </element>
         
     | 
| 
      
 1062 
     | 
    
         
            +
              </define>
         
     | 
| 
       1049 
1063 
     | 
    
         
             
              <define name="tt">
         
     | 
| 
       1050 
1064 
     | 
    
         
             
                <element name="tt">
         
     | 
| 
       1051 
1065 
     | 
    
         
             
                  <zeroOrMore>
         
     | 
| 
         @@ -1060,6 +1074,13 @@ 
     | 
|
| 
       1060 
1074 
     | 
    
         
             
                  </zeroOrMore>
         
     | 
| 
       1061 
1075 
     | 
    
         
             
                </element>
         
     | 
| 
       1062 
1076 
     | 
    
         
             
              </define>
         
     | 
| 
      
 1077 
     | 
    
         
            +
              <define name="pure_tt">
         
     | 
| 
      
 1078 
     | 
    
         
            +
                <element name="tt">
         
     | 
| 
      
 1079 
     | 
    
         
            +
                  <zeroOrMore>
         
     | 
| 
      
 1080 
     | 
    
         
            +
                    <ref name="PureTextElement"/>
         
     | 
| 
      
 1081 
     | 
    
         
            +
                  </zeroOrMore>
         
     | 
| 
      
 1082 
     | 
    
         
            +
                </element>
         
     | 
| 
      
 1083 
     | 
    
         
            +
              </define>
         
     | 
| 
       1063 
1084 
     | 
    
         
             
              <define name="keyword">
         
     | 
| 
       1064 
1085 
     | 
    
         
             
                <element name="keyword">
         
     | 
| 
       1065 
1086 
     | 
    
         
             
                  <zeroOrMore>
         
     | 
| 
         @@ -1090,13 +1111,42 @@ 
     | 
|
| 
       1090 
1111 
     | 
    
         
             
                  <zeroOrMore>
         
     | 
| 
       1091 
1112 
     | 
    
         
             
                    <choice>
         
     | 
| 
       1092 
1113 
     | 
    
         
             
                      <ref name="PureTextElement"/>
         
     | 
| 
      
 1114 
     | 
    
         
            +
                      <ref name="stem"/>
         
     | 
| 
      
 1115 
     | 
    
         
            +
                      <ref name="eref"/>
         
     | 
| 
      
 1116 
     | 
    
         
            +
                      <ref name="xref"/>
         
     | 
| 
      
 1117 
     | 
    
         
            +
                      <ref name="hyperlink"/>
         
     | 
| 
       1093 
1118 
     | 
    
         
             
                      <ref name="index"/>
         
     | 
| 
       1094 
1119 
     | 
    
         
             
                      <ref name="index-xref"/>
         
     | 
| 
       1095 
1120 
     | 
    
         
             
                    </choice>
         
     | 
| 
       1096 
1121 
     | 
    
         
             
                  </zeroOrMore>
         
     | 
| 
       1097 
1122 
     | 
    
         
             
                </element>
         
     | 
| 
       1098 
1123 
     | 
    
         
             
              </define>
         
     | 
| 
      
 1124 
     | 
    
         
            +
              <define name="pure_strike">
         
     | 
| 
      
 1125 
     | 
    
         
            +
                <element name="strike">
         
     | 
| 
      
 1126 
     | 
    
         
            +
                  <zeroOrMore>
         
     | 
| 
      
 1127 
     | 
    
         
            +
                    <ref name="PureTextElement"/>
         
     | 
| 
      
 1128 
     | 
    
         
            +
                  </zeroOrMore>
         
     | 
| 
      
 1129 
     | 
    
         
            +
                </element>
         
     | 
| 
      
 1130 
     | 
    
         
            +
              </define>
         
     | 
| 
       1099 
1131 
     | 
    
         
             
              <define name="underline">
         
     | 
| 
      
 1132 
     | 
    
         
            +
                <element name="underline">
         
     | 
| 
      
 1133 
     | 
    
         
            +
                  <optional>
         
     | 
| 
      
 1134 
     | 
    
         
            +
                    <attribute name="style"/>
         
     | 
| 
      
 1135 
     | 
    
         
            +
                  </optional>
         
     | 
| 
      
 1136 
     | 
    
         
            +
                  <zeroOrMore>
         
     | 
| 
      
 1137 
     | 
    
         
            +
                    <choice>
         
     | 
| 
      
 1138 
     | 
    
         
            +
                      <ref name="PureTextElement"/>
         
     | 
| 
      
 1139 
     | 
    
         
            +
                      <ref name="stem"/>
         
     | 
| 
      
 1140 
     | 
    
         
            +
                      <ref name="eref"/>
         
     | 
| 
      
 1141 
     | 
    
         
            +
                      <ref name="xref"/>
         
     | 
| 
      
 1142 
     | 
    
         
            +
                      <ref name="hyperlink"/>
         
     | 
| 
      
 1143 
     | 
    
         
            +
                      <ref name="index"/>
         
     | 
| 
      
 1144 
     | 
    
         
            +
                      <ref name="index-xref"/>
         
     | 
| 
      
 1145 
     | 
    
         
            +
                    </choice>
         
     | 
| 
      
 1146 
     | 
    
         
            +
                  </zeroOrMore>
         
     | 
| 
      
 1147 
     | 
    
         
            +
                </element>
         
     | 
| 
      
 1148 
     | 
    
         
            +
              </define>
         
     | 
| 
      
 1149 
     | 
    
         
            +
              <define name="pure_underline">
         
     | 
| 
       1100 
1150 
     | 
    
         
             
                <element name="underline">
         
     | 
| 
       1101 
1151 
     | 
    
         
             
                  <optional>
         
     | 
| 
       1102 
1152 
     | 
    
         
             
                    <attribute name="style"/>
         
     | 
| 
         @@ -1107,6 +1157,21 @@ 
     | 
|
| 
       1107 
1157 
     | 
    
         
             
                </element>
         
     | 
| 
       1108 
1158 
     | 
    
         
             
              </define>
         
     | 
| 
       1109 
1159 
     | 
    
         
             
              <define name="smallcap">
         
     | 
| 
      
 1160 
     | 
    
         
            +
                <element name="smallcap">
         
     | 
| 
      
 1161 
     | 
    
         
            +
                  <zeroOrMore>
         
     | 
| 
      
 1162 
     | 
    
         
            +
                    <choice>
         
     | 
| 
      
 1163 
     | 
    
         
            +
                      <ref name="PureTextElement"/>
         
     | 
| 
      
 1164 
     | 
    
         
            +
                      <ref name="stem"/>
         
     | 
| 
      
 1165 
     | 
    
         
            +
                      <ref name="eref"/>
         
     | 
| 
      
 1166 
     | 
    
         
            +
                      <ref name="xref"/>
         
     | 
| 
      
 1167 
     | 
    
         
            +
                      <ref name="hyperlink"/>
         
     | 
| 
      
 1168 
     | 
    
         
            +
                      <ref name="index"/>
         
     | 
| 
      
 1169 
     | 
    
         
            +
                      <ref name="index-xref"/>
         
     | 
| 
      
 1170 
     | 
    
         
            +
                    </choice>
         
     | 
| 
      
 1171 
     | 
    
         
            +
                  </zeroOrMore>
         
     | 
| 
      
 1172 
     | 
    
         
            +
                </element>
         
     | 
| 
      
 1173 
     | 
    
         
            +
              </define>
         
     | 
| 
      
 1174 
     | 
    
         
            +
              <define name="pure_smallcap">
         
     | 
| 
       1110 
1175 
     | 
    
         
             
                <element name="smallcap">
         
     | 
| 
       1111 
1176 
     | 
    
         
             
                  <zeroOrMore>
         
     | 
| 
       1112 
1177 
     | 
    
         
             
                    <ref name="PureTextElement"/>
         
     | 
    
        data/lib/metanorma/un/biblio.rng
    CHANGED
    
    
    
        data/lib/metanorma/un/isodoc.rng
    CHANGED
    
    
    
        data/lib/metanorma/un/reqt.rng
    CHANGED
    
    
    
        data/lib/metanorma/un/version.rb
    CHANGED
    
    
    
        data/metanorma-un.gemspec
    CHANGED
    
    | 
         @@ -31,7 +31,7 @@ Gem::Specification.new do |spec| 
     | 
|
| 
       31 
31 
     | 
    
         
             
              spec.add_dependency "roman-numerals"
         
     | 
| 
       32 
32 
     | 
    
         
             
              spec.add_dependency "twitter_cldr"
         
     | 
| 
       33 
33 
     | 
    
         | 
| 
       34 
     | 
    
         
            -
              spec.add_dependency "metanorma-standoc", "~> 2.9. 
     | 
| 
      
 34 
     | 
    
         
            +
              spec.add_dependency "metanorma-standoc", "~> 2.9.3"
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
              spec.add_development_dependency "debug"
         
     | 
| 
       37 
37 
     | 
    
         
             
              spec.add_development_dependency "equivalent-xml", "~> 0.6"
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: metanorma-un
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.12. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.12.17
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ribose Inc.
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2024- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2024-09-02 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: iso-639
         
     | 
| 
         @@ -58,14 +58,14 @@ dependencies: 
     | 
|
| 
       58 
58 
     | 
    
         
             
                requirements:
         
     | 
| 
       59 
59 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       60 
60 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       61 
     | 
    
         
            -
                    version: 2.9. 
     | 
| 
      
 61 
     | 
    
         
            +
                    version: 2.9.3
         
     | 
| 
       62 
62 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       63 
63 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       64 
64 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       65 
65 
     | 
    
         
             
                requirements:
         
     | 
| 
       66 
66 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       67 
67 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       68 
     | 
    
         
            -
                    version: 2.9. 
     | 
| 
      
 68 
     | 
    
         
            +
                    version: 2.9.3
         
     | 
| 
       69 
69 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       70 
70 
     | 
    
         
             
              name: debug
         
     | 
| 
       71 
71 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     |