metanorma-un 0.12.16 → 0.12.18
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 +1 -1
- data/lib/isodoc/un/un.plenary-attachment.xsl +142 -38
- data/lib/isodoc/un/un.plenary.xsl +142 -38
- data/lib/isodoc/un/un.recommendation.xsl +142 -38
- data/lib/metanorma/un/basicdoc.rng +909 -464
- data/lib/metanorma/un/biblio-standoc.rng +87 -20
- data/lib/metanorma/un/biblio.rng +884 -325
- data/lib/metanorma/un/isodoc.rng +1031 -912
- data/lib/metanorma/un/reqt.rng +94 -72
- data/lib/metanorma/un/version.rb +1 -1
- metadata +2 -2
| @@ -7038,6 +7038,12 @@ | |
| 7038 7038 | 
             
            		<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
         | 
| 7039 7039 | 
             
            			<attachment filename="{@name}"/>
         | 
| 7040 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>
         | 
| 7041 7047 | 
             
            	</xsl:variable>
         | 
| 7042 7048 | 
             
            	<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
         | 
| 7043 7049 |  | 
| @@ -7050,7 +7056,7 @@ | |
| 7050 7056 | 
             
            					<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
         | 
| 7051 7057 | 
             
            				</xsl:when>
         | 
| 7052 7058 | 
             
            				<!-- link to the PDF attachment -->
         | 
| 7053 | 
            -
            				<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
         | 
| 7059 | 
            +
            				<xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
         | 
| 7054 7060 | 
             
            					<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
         | 
| 7055 7061 | 
             
            				</xsl:when>
         | 
| 7056 7062 | 
             
            				<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
         | 
| @@ -7710,7 +7716,16 @@ | |
| 7710 7716 | 
             
            		</xsl:variable>
         | 
| 7711 7717 | 
             
            		<xsl:variable name="img_src">
         | 
| 7712 7718 | 
             
            			<xsl:choose>
         | 
| 7713 | 
            -
            				<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>
         | 
| 7714 7729 | 
             
            				<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
         | 
| 7715 7730 | 
             
            			</xsl:choose>
         | 
| 7716 7731 | 
             
            		</xsl:variable>
         | 
| @@ -7723,7 +7738,7 @@ | |
| 7723 7738 | 
             
            		<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
         | 
| 7724 7739 | 
             
            		<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
         | 
| 7725 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> -->
         | 
| 7726 | 
            -
            		<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)"/>
         | 
| 7727 7742 | 
             
            		<xsl:value-of select="$scale"/>
         | 
| 7728 7743 | 
             
            	</xsl:template>
         | 
| 7729 7744 |  | 
| @@ -7742,7 +7757,14 @@ | |
| 7742 7757 | 
             
            				<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
         | 
| 7743 7758 | 
             
            			</xsl:when>
         | 
| 7744 7759 | 
             
            			<xsl:when test="not(starts-with(@src, 'data:'))">
         | 
| 7745 | 
            -
            				<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>
         | 
| 7746 7768 | 
             
            			</xsl:when>
         | 
| 7747 7769 | 
             
            			<xsl:otherwise>
         | 
| 7748 7770 | 
             
            				<xsl:value-of select="@src"/>
         | 
| @@ -7764,7 +7786,14 @@ | |
| 7764 7786 | 
             
            			</xsl:when>
         | 
| 7765 7787 | 
             
            			<xsl:when test="not(starts-with(@src, 'data:'))">
         | 
| 7766 7788 | 
             
            				<xsl:variable name="src">
         | 
| 7767 | 
            -
            					<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>
         | 
| 7768 7797 | 
             
            				</xsl:variable>
         | 
| 7769 7798 | 
             
            				<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
         | 
| 7770 7799 | 
             
            				<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
         | 
| @@ -12484,6 +12513,39 @@ | |
| 12484 12513 | 
             
            		</pdf:catalog>
         | 
| 12485 12514 | 
             
            		<x:xmpmeta xmlns:x="adobe:ns:meta/">
         | 
| 12486 12515 | 
             
            			<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
         | 
| 12516 | 
            +
            				<rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" rdf:about="">
         | 
| 12517 | 
            +
            					<pdfaExtension:schemas>
         | 
| 12518 | 
            +
            						<rdf:Bag>
         | 
| 12519 | 
            +
            							<rdf:li rdf:parseType="Resource">
         | 
| 12520 | 
            +
            								<pdfaSchema:namespaceURI>http://www.aiim.org/pdfua/ns/id/</pdfaSchema:namespaceURI>
         | 
| 12521 | 
            +
            								<pdfaSchema:prefix>pdfuaid</pdfaSchema:prefix>
         | 
| 12522 | 
            +
            								<pdfaSchema:schema>PDF/UA identification schema</pdfaSchema:schema>
         | 
| 12523 | 
            +
            								<pdfaSchema:property>
         | 
| 12524 | 
            +
            									<rdf:Seq>
         | 
| 12525 | 
            +
            										<rdf:li rdf:parseType="Resource">
         | 
| 12526 | 
            +
            											<pdfaProperty:category>internal</pdfaProperty:category>
         | 
| 12527 | 
            +
            											<pdfaProperty:description>PDF/UA version identifier</pdfaProperty:description>
         | 
| 12528 | 
            +
            											<pdfaProperty:name>part</pdfaProperty:name>
         | 
| 12529 | 
            +
            											<pdfaProperty:valueType>Integer</pdfaProperty:valueType>
         | 
| 12530 | 
            +
            										</rdf:li>
         | 
| 12531 | 
            +
            										<rdf:li rdf:parseType="Resource">
         | 
| 12532 | 
            +
            											<pdfaProperty:category>internal</pdfaProperty:category>
         | 
| 12533 | 
            +
            											<pdfaProperty:description>PDF/UA amendment identifier</pdfaProperty:description>
         | 
| 12534 | 
            +
            											<pdfaProperty:name>amd</pdfaProperty:name>
         | 
| 12535 | 
            +
            											<pdfaProperty:valueType>Text</pdfaProperty:valueType>
         | 
| 12536 | 
            +
            										</rdf:li>
         | 
| 12537 | 
            +
            										<rdf:li rdf:parseType="Resource">
         | 
| 12538 | 
            +
            											<pdfaProperty:category>internal</pdfaProperty:category>
         | 
| 12539 | 
            +
            											<pdfaProperty:description>PDF/UA corrigenda identifier</pdfaProperty:description>
         | 
| 12540 | 
            +
            											<pdfaProperty:name>corr</pdfaProperty:name>
         | 
| 12541 | 
            +
            											<pdfaProperty:valueType>Text</pdfaProperty:valueType>
         | 
| 12542 | 
            +
            										</rdf:li>
         | 
| 12543 | 
            +
            									</rdf:Seq>
         | 
| 12544 | 
            +
            								</pdfaSchema:property>
         | 
| 12545 | 
            +
            							</rdf:li>
         | 
| 12546 | 
            +
            						</rdf:Bag>
         | 
| 12547 | 
            +
            					</pdfaExtension:schemas>
         | 
| 12548 | 
            +
            				</rdf:Description>
         | 
| 12487 12549 | 
             
            				<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
         | 
| 12488 12550 | 
             
            				<!-- Dublin Core properties go here -->
         | 
| 12489 12551 | 
             
            					<dc:title>
         | 
| @@ -12494,33 +12556,57 @@ | |
| 12494 12556 |  | 
| 12495 12557 | 
             
            							</xsl:for-each>
         | 
| 12496 12558 | 
             
            						</xsl:variable>
         | 
| 12497 | 
            -
            						< | 
| 12498 | 
            -
            							< | 
| 12499 | 
            -
            								<xsl: | 
| 12500 | 
            -
             | 
| 12501 | 
            -
             | 
| 12502 | 
            -
             | 
| 12503 | 
            -
             | 
| 12504 | 
            -
             | 
| 12559 | 
            +
            						<rdf:Alt>
         | 
| 12560 | 
            +
            							<rdf:li xml:lang="x-default">
         | 
| 12561 | 
            +
            								<xsl:choose>
         | 
| 12562 | 
            +
            									<xsl:when test="normalize-space($title) != ''">
         | 
| 12563 | 
            +
            										<xsl:value-of select="$title"/>
         | 
| 12564 | 
            +
            									</xsl:when>
         | 
| 12565 | 
            +
            									<xsl:otherwise>
         | 
| 12566 | 
            +
            										<xsl:text> </xsl:text>
         | 
| 12567 | 
            +
            									</xsl:otherwise>
         | 
| 12568 | 
            +
            								</xsl:choose>
         | 
| 12569 | 
            +
            							</rdf:li>
         | 
| 12570 | 
            +
            						</rdf:Alt>
         | 
| 12505 12571 | 
             
            					</dc:title>
         | 
| 12506 | 
            -
            					< | 
| 12572 | 
            +
            					<xsl:variable name="dc_creator">
         | 
| 12507 12573 | 
             
            						<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
         | 
| 12508 12574 |  | 
| 12509 | 
            -
            									< | 
| 12510 | 
            -
            										<xsl: | 
| 12511 | 
            -
             | 
| 12512 | 
            -
             | 
| 12575 | 
            +
            									<rdf:Seq>
         | 
| 12576 | 
            +
            										<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
         | 
| 12577 | 
            +
            											<rdf:li>
         | 
| 12578 | 
            +
            												<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
         | 
| 12579 | 
            +
            											</rdf:li>
         | 
| 12580 | 
            +
            											<!-- <xsl:if test="position() != last()">; </xsl:if> -->
         | 
| 12581 | 
            +
            										</xsl:for-each>
         | 
| 12582 | 
            +
            									</rdf:Seq>
         | 
| 12513 12583 |  | 
| 12514 12584 | 
             
            						</xsl:for-each>
         | 
| 12515 | 
            -
            					</ | 
| 12516 | 
            -
            					< | 
| 12585 | 
            +
            					</xsl:variable>
         | 
| 12586 | 
            +
            					<xsl:if test="normalize-space($dc_creator) != ''">
         | 
| 12587 | 
            +
            						<dc:creator>
         | 
| 12588 | 
            +
            							<xsl:copy-of select="$dc_creator"/>
         | 
| 12589 | 
            +
            						</dc:creator>
         | 
| 12590 | 
            +
            					</xsl:if>
         | 
| 12591 | 
            +
             | 
| 12592 | 
            +
            					<xsl:variable name="dc_description">
         | 
| 12517 12593 | 
             
            						<xsl:variable name="abstract">
         | 
| 12518 12594 |  | 
| 12519 12595 | 
             
            									<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
         | 
| 12520 12596 |  | 
| 12521 12597 | 
             
            						</xsl:variable>
         | 
| 12522 | 
            -
            						< | 
| 12523 | 
            -
             | 
| 12598 | 
            +
            						<rdf:Alt>
         | 
| 12599 | 
            +
            							<rdf:li xml:lang="x-default">
         | 
| 12600 | 
            +
            								<xsl:value-of select="normalize-space($abstract)"/>
         | 
| 12601 | 
            +
            							</rdf:li>
         | 
| 12602 | 
            +
            						</rdf:Alt>
         | 
| 12603 | 
            +
            					</xsl:variable>
         | 
| 12604 | 
            +
            					<xsl:if test="normalize-space($dc_description)">
         | 
| 12605 | 
            +
            						<dc:description>
         | 
| 12606 | 
            +
            							<xsl:copy-of select="$dc_description"/>
         | 
| 12607 | 
            +
            						</dc:description>
         | 
| 12608 | 
            +
            					</xsl:if>
         | 
| 12609 | 
            +
             | 
| 12524 12610 | 
             
            					<pdf:Keywords>
         | 
| 12525 12611 | 
             
            						<xsl:call-template name="insertKeywords">
         | 
| 12526 12612 | 
             
            							<xsl:with-param name="meta">true</xsl:with-param>
         | 
| @@ -12535,26 +12621,37 @@ | |
| 12535 12621 | 
             
            		</x:xmpmeta>
         | 
| 12536 12622 | 
             
            		<!-- add attachments -->
         | 
| 12537 12623 | 
             
            		<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
         | 
| 12538 | 
            -
            			<xsl: | 
| 12539 | 
            -
             | 
| 12540 | 
            -
             | 
| 12541 | 
            -
             | 
| 12542 | 
            -
             | 
| 12543 | 
            -
             | 
| 12544 | 
            -
             | 
| 12545 | 
            -
             | 
| 12546 | 
            -
             | 
| 12547 | 
            -
             | 
| 12548 | 
            -
             | 
| 12549 | 
            -
             | 
| 12624 | 
            +
            			<xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
         | 
| 12625 | 
            +
             | 
| 12626 | 
            +
            			<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
         | 
| 12627 | 
            +
            				<xsl:attribute name="src">
         | 
| 12628 | 
            +
            					<xsl:choose>
         | 
| 12629 | 
            +
            						<xsl:when test="normalize-space() != ''">
         | 
| 12630 | 
            +
            							<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(
|
|
)', '')"/> <!-- remove line breaks -->
         | 
| 12631 | 
            +
            							<xsl:value-of select="$src_attachment"/>
         | 
| 12632 | 
            +
            						</xsl:when>
         | 
| 12633 | 
            +
            						<xsl:otherwise>
         | 
| 12634 | 
            +
            							<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
         | 
| 12635 | 
            +
            							<xsl:value-of select="$url"/>
         | 
| 12636 | 
            +
            						</xsl:otherwise>
         | 
| 12637 | 
            +
            					</xsl:choose>
         | 
| 12638 | 
            +
            				</xsl:attribute>
         | 
| 12639 | 
            +
            				<xsl:if test="$description != ''">
         | 
| 12640 | 
            +
            					<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
         | 
| 12641 | 
            +
            				</xsl:if>
         | 
| 12642 | 
            +
            			</pdf:embedded-file>
         | 
| 12550 12643 | 
             
            		</xsl:for-each>
         | 
| 12551 12644 | 
             
            		<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
         | 
| 12552 12645 | 
             
            		<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
         | 
| 12553 12646 | 
             
            			<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
         | 
| 12554 12647 | 
             
            				<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
         | 
| 12555 | 
            -
            				<xsl:variable name="url" select="concat('url(file:///',$ | 
| 12556 | 
            -
            				<xsl:variable name=" | 
| 12557 | 
            -
            				<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$ | 
| 12648 | 
            +
            				<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
         | 
| 12649 | 
            +
            				<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
         | 
| 12650 | 
            +
            				<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
         | 
| 12651 | 
            +
            					<xsl:if test="$description != ''">
         | 
| 12652 | 
            +
            						<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
         | 
| 12653 | 
            +
            					</xsl:if>
         | 
| 12654 | 
            +
            				</pdf:embedded-file>
         | 
| 12558 12655 | 
             
            			</xsl:for-each>
         | 
| 12559 12656 | 
             
            		</xsl:if>
         | 
| 12560 12657 | 
             
            	</xsl:template> <!-- addPDFUAmeta -->
         | 
| @@ -12932,7 +13029,14 @@ | |
| 12932 13029 | 
             
            				<xsl:value-of select="$src"/>
         | 
| 12933 13030 | 
             
            			</xsl:when>
         | 
| 12934 13031 | 
             
            			<xsl:otherwise>
         | 
| 12935 | 
            -
            				<xsl: | 
| 13032 | 
            +
            				<xsl:choose>
         | 
| 13033 | 
            +
            					<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
         | 
| 13034 | 
            +
            						<xsl:value-of select="concat('url(file:///', @src, ')')"/>
         | 
| 13035 | 
            +
            					</xsl:when>
         | 
| 13036 | 
            +
            					<xsl:otherwise>
         | 
| 13037 | 
            +
            						<xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
         | 
| 13038 | 
            +
            					</xsl:otherwise>
         | 
| 13039 | 
            +
            				</xsl:choose>
         | 
| 12936 13040 | 
             
            			</xsl:otherwise>
         | 
| 12937 13041 | 
             
            		</xsl:choose>
         | 
| 12938 13042 | 
             
            	</xsl:template>
         |