metanorma-un 0.12.17 → 0.12.19
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 +4 -1
- data/lib/isodoc/un/un.plenary-attachment.xsl +176 -24
- data/lib/isodoc/un/un.plenary.xsl +176 -24
- data/lib/isodoc/un/un.recommendation.xsl +176 -24
- data/lib/metanorma/un/basicdoc.rng +861 -481
- data/lib/metanorma/un/biblio-standoc.rng +87 -20
- data/lib/metanorma/un/biblio.rng +882 -325
- data/lib/metanorma/un/isodoc.rng +1031 -915
- data/lib/metanorma/un/reqt.rng +94 -75
- data/lib/metanorma/un/version.rb +1 -1
- metadata +2 -2
@@ -4204,6 +4204,7 @@
|
|
4204
4204
|
|
4205
4205
|
<fo:block role="SKIP">
|
4206
4206
|
<xsl:apply-templates/>
|
4207
|
+
<xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
|
4207
4208
|
</fo:block>
|
4208
4209
|
</fo:table-cell>
|
4209
4210
|
</xsl:template> <!-- cell in table header row - 'th' -->
|
@@ -4267,6 +4268,8 @@
|
|
4267
4268
|
|
4268
4269
|
<xsl:if test="$isGenerateTableIF = 'true'"> <fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
|
4269
4270
|
|
4271
|
+
<xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
|
4272
|
+
|
4270
4273
|
</fo:block>
|
4271
4274
|
</fo:table-cell>
|
4272
4275
|
</xsl:template> <!-- td -->
|
@@ -7050,14 +7053,16 @@
|
|
7050
7053
|
<xsl:template match="*[local-name()='link']" name="link">
|
7051
7054
|
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
7052
7055
|
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
7056
|
+
<xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
|
7053
7057
|
<xsl:variable name="target">
|
7054
7058
|
<xsl:choose>
|
7055
7059
|
<xsl:when test="@updatetype = 'true'">
|
7056
7060
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
7057
7061
|
</xsl:when>
|
7058
7062
|
<!-- link to the PDF attachment -->
|
7059
|
-
<xsl:when test="
|
7060
|
-
<xsl:
|
7063
|
+
<xsl:when test="$isLinkToEmbeddedFile = 'true'">
|
7064
|
+
<xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
|
7065
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
|
7061
7066
|
</xsl:when>
|
7062
7067
|
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
7063
7068
|
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
@@ -7088,6 +7093,11 @@
|
|
7088
7093
|
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
7089
7094
|
</xsl:if>
|
7090
7095
|
|
7096
|
+
<xsl:if test="$isLinkToEmbeddedFile = 'true'">
|
7097
|
+
<xsl:attribute name="color">inherit</xsl:attribute>
|
7098
|
+
<xsl:attribute name="text-decoration">none</xsl:attribute>
|
7099
|
+
</xsl:if>
|
7100
|
+
|
7091
7101
|
<xsl:call-template name="refine_link-style"/>
|
7092
7102
|
|
7093
7103
|
<xsl:choose>
|
@@ -7098,6 +7108,9 @@
|
|
7098
7108
|
<xsl:call-template name="insert_basic_link">
|
7099
7109
|
<xsl:with-param name="element">
|
7100
7110
|
<fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
|
7111
|
+
<xsl:if test="$isLinkToEmbeddedFile = 'true'">
|
7112
|
+
<xsl:attribute name="role">Annot</xsl:attribute>
|
7113
|
+
</xsl:if>
|
7101
7114
|
<xsl:choose>
|
7102
7115
|
<xsl:when test="normalize-space(.) = ''">
|
7103
7116
|
<xsl:call-template name="add-zero-spaces-link-java">
|
@@ -7110,6 +7123,10 @@
|
|
7110
7123
|
</xsl:otherwise>
|
7111
7124
|
</xsl:choose>
|
7112
7125
|
</fo:basic-link>
|
7126
|
+
<xsl:if test="$isLinkToEmbeddedFile = 'true'">
|
7127
|
+
<!-- reserve space at right for PaperClip icon -->
|
7128
|
+
<fo:inline keep-with-previous.within-line="always"> </fo:inline>
|
7129
|
+
</xsl:if>
|
7113
7130
|
</xsl:with-param>
|
7114
7131
|
</xsl:call-template>
|
7115
7132
|
</xsl:otherwise>
|
@@ -12513,6 +12530,39 @@
|
|
12513
12530
|
</pdf:catalog>
|
12514
12531
|
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
12515
12532
|
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
12533
|
+
<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="">
|
12534
|
+
<pdfaExtension:schemas>
|
12535
|
+
<rdf:Bag>
|
12536
|
+
<rdf:li rdf:parseType="Resource">
|
12537
|
+
<pdfaSchema:namespaceURI>http://www.aiim.org/pdfua/ns/id/</pdfaSchema:namespaceURI>
|
12538
|
+
<pdfaSchema:prefix>pdfuaid</pdfaSchema:prefix>
|
12539
|
+
<pdfaSchema:schema>PDF/UA identification schema</pdfaSchema:schema>
|
12540
|
+
<pdfaSchema:property>
|
12541
|
+
<rdf:Seq>
|
12542
|
+
<rdf:li rdf:parseType="Resource">
|
12543
|
+
<pdfaProperty:category>internal</pdfaProperty:category>
|
12544
|
+
<pdfaProperty:description>PDF/UA version identifier</pdfaProperty:description>
|
12545
|
+
<pdfaProperty:name>part</pdfaProperty:name>
|
12546
|
+
<pdfaProperty:valueType>Integer</pdfaProperty:valueType>
|
12547
|
+
</rdf:li>
|
12548
|
+
<rdf:li rdf:parseType="Resource">
|
12549
|
+
<pdfaProperty:category>internal</pdfaProperty:category>
|
12550
|
+
<pdfaProperty:description>PDF/UA amendment identifier</pdfaProperty:description>
|
12551
|
+
<pdfaProperty:name>amd</pdfaProperty:name>
|
12552
|
+
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
|
12553
|
+
</rdf:li>
|
12554
|
+
<rdf:li rdf:parseType="Resource">
|
12555
|
+
<pdfaProperty:category>internal</pdfaProperty:category>
|
12556
|
+
<pdfaProperty:description>PDF/UA corrigenda identifier</pdfaProperty:description>
|
12557
|
+
<pdfaProperty:name>corr</pdfaProperty:name>
|
12558
|
+
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
|
12559
|
+
</rdf:li>
|
12560
|
+
</rdf:Seq>
|
12561
|
+
</pdfaSchema:property>
|
12562
|
+
</rdf:li>
|
12563
|
+
</rdf:Bag>
|
12564
|
+
</pdfaExtension:schemas>
|
12565
|
+
</rdf:Description>
|
12516
12566
|
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
12517
12567
|
<!-- Dublin Core properties go here -->
|
12518
12568
|
<dc:title>
|
@@ -12523,33 +12573,57 @@
|
|
12523
12573
|
|
12524
12574
|
</xsl:for-each>
|
12525
12575
|
</xsl:variable>
|
12526
|
-
<
|
12527
|
-
<
|
12528
|
-
<xsl:
|
12529
|
-
|
12530
|
-
|
12531
|
-
|
12532
|
-
|
12533
|
-
|
12576
|
+
<rdf:Alt>
|
12577
|
+
<rdf:li xml:lang="x-default">
|
12578
|
+
<xsl:choose>
|
12579
|
+
<xsl:when test="normalize-space($title) != ''">
|
12580
|
+
<xsl:value-of select="$title"/>
|
12581
|
+
</xsl:when>
|
12582
|
+
<xsl:otherwise>
|
12583
|
+
<xsl:text> </xsl:text>
|
12584
|
+
</xsl:otherwise>
|
12585
|
+
</xsl:choose>
|
12586
|
+
</rdf:li>
|
12587
|
+
</rdf:Alt>
|
12534
12588
|
</dc:title>
|
12535
|
-
<
|
12589
|
+
<xsl:variable name="dc_creator">
|
12536
12590
|
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
12537
12591
|
|
12538
|
-
<
|
12539
|
-
<xsl:
|
12540
|
-
|
12541
|
-
|
12592
|
+
<rdf:Seq>
|
12593
|
+
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
12594
|
+
<rdf:li>
|
12595
|
+
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
12596
|
+
</rdf:li>
|
12597
|
+
<!-- <xsl:if test="position() != last()">; </xsl:if> -->
|
12598
|
+
</xsl:for-each>
|
12599
|
+
</rdf:Seq>
|
12542
12600
|
|
12543
12601
|
</xsl:for-each>
|
12544
|
-
</
|
12545
|
-
<
|
12602
|
+
</xsl:variable>
|
12603
|
+
<xsl:if test="normalize-space($dc_creator) != ''">
|
12604
|
+
<dc:creator>
|
12605
|
+
<xsl:copy-of select="$dc_creator"/>
|
12606
|
+
</dc:creator>
|
12607
|
+
</xsl:if>
|
12608
|
+
|
12609
|
+
<xsl:variable name="dc_description">
|
12546
12610
|
<xsl:variable name="abstract">
|
12547
12611
|
|
12548
12612
|
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
|
12549
12613
|
|
12550
12614
|
</xsl:variable>
|
12551
|
-
<
|
12552
|
-
|
12615
|
+
<rdf:Alt>
|
12616
|
+
<rdf:li xml:lang="x-default">
|
12617
|
+
<xsl:value-of select="normalize-space($abstract)"/>
|
12618
|
+
</rdf:li>
|
12619
|
+
</rdf:Alt>
|
12620
|
+
</xsl:variable>
|
12621
|
+
<xsl:if test="normalize-space($dc_description)">
|
12622
|
+
<dc:description>
|
12623
|
+
<xsl:copy-of select="$dc_description"/>
|
12624
|
+
</dc:description>
|
12625
|
+
</xsl:if>
|
12626
|
+
|
12553
12627
|
<pdf:Keywords>
|
12554
12628
|
<xsl:call-template name="insertKeywords">
|
12555
12629
|
<xsl:with-param name="meta">true</xsl:with-param>
|
@@ -12564,9 +12638,14 @@
|
|
12564
12638
|
</x:xmpmeta>
|
12565
12639
|
<!-- add attachments -->
|
12566
12640
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
12567
|
-
<xsl:variable name="
|
12568
|
-
|
12569
|
-
<
|
12641
|
+
<xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
|
12642
|
+
<xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
|
12643
|
+
<xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
|
12644
|
+
<xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
|
12645
|
+
<!-- Todo: need update -->
|
12646
|
+
<xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
|
12647
|
+
|
12648
|
+
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
|
12570
12649
|
<xsl:attribute name="src">
|
12571
12650
|
<xsl:choose>
|
12572
12651
|
<xsl:when test="normalize-space() != ''">
|
@@ -12582,18 +12661,27 @@
|
|
12582
12661
|
<xsl:if test="$description != ''">
|
12583
12662
|
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
|
12584
12663
|
</xsl:if>
|
12664
|
+
<xsl:if test="$afrelationship != ''">
|
12665
|
+
<xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
|
12666
|
+
</xsl:if>
|
12585
12667
|
</pdf:embedded-file>
|
12586
12668
|
</xsl:for-each>
|
12587
12669
|
<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
|
12588
12670
|
<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
12589
12671
|
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
12590
12672
|
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
12673
|
+
<xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
|
12591
12674
|
<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
|
12592
12675
|
<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
|
12593
|
-
|
12676
|
+
<!-- Todo: need update -->
|
12677
|
+
<xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
|
12678
|
+
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
|
12594
12679
|
<xsl:if test="$description != ''">
|
12595
12680
|
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
|
12596
12681
|
</xsl:if>
|
12682
|
+
<xsl:if test="$afrelationship != ''">
|
12683
|
+
<xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
|
12684
|
+
</xsl:if>
|
12597
12685
|
</pdf:embedded-file>
|
12598
12686
|
</xsl:for-each>
|
12599
12687
|
</xsl:if>
|
@@ -12613,6 +12701,12 @@
|
|
12613
12701
|
<!-- Get or calculate depth of the element -->
|
12614
12702
|
<xsl:template name="getLevel">
|
12615
12703
|
<xsl:param name="depth"/>
|
12704
|
+
<!-- <xsl:message>
|
12705
|
+
<xsl:choose>
|
12706
|
+
<xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
|
12707
|
+
<xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
|
12708
|
+
</xsl:choose>
|
12709
|
+
</xsl:message> -->
|
12616
12710
|
<xsl:choose>
|
12617
12711
|
<xsl:when test="normalize-space(@depth) != ''">
|
12618
12712
|
<xsl:value-of select="@depth"/>
|
@@ -12633,8 +12727,27 @@
|
|
12633
12727
|
<xsl:when test="ancestor::*[local-name() = 'preface']">
|
12634
12728
|
<xsl:value-of select="$level_total - 2"/>
|
12635
12729
|
</xsl:when>
|
12730
|
+
<xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
|
12731
|
+
<xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
|
12732
|
+
<xsl:choose>
|
12733
|
+
<xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
|
12734
|
+
<xsl:value-of select="number($upper_clause_depth + 1)"/>
|
12735
|
+
</xsl:when>
|
12736
|
+
<xsl:otherwise>
|
12737
|
+
<xsl:value-of select="$level_total - 2"/>
|
12738
|
+
</xsl:otherwise>
|
12739
|
+
</xsl:choose>
|
12740
|
+
</xsl:when>
|
12636
12741
|
<xsl:when test="ancestor::*[local-name() = 'sections']">
|
12637
|
-
<xsl:
|
12742
|
+
<xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
|
12743
|
+
<xsl:choose>
|
12744
|
+
<xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
|
12745
|
+
<xsl:value-of select="number($upper_clause_depth + 1)"/>
|
12746
|
+
</xsl:when>
|
12747
|
+
<xsl:otherwise>
|
12748
|
+
<xsl:value-of select="$level_total - 1"/>
|
12749
|
+
</xsl:otherwise>
|
12750
|
+
</xsl:choose>
|
12638
12751
|
</xsl:when>
|
12639
12752
|
<xsl:when test="ancestor::*[local-name() = 'bibliography']">
|
12640
12753
|
<xsl:value-of select="$level_total - 1"/>
|
@@ -12642,6 +12755,17 @@
|
|
12642
12755
|
<xsl:when test="parent::*[local-name() = 'annex']">
|
12643
12756
|
<xsl:value-of select="$level_total - 1"/>
|
12644
12757
|
</xsl:when>
|
12758
|
+
<xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
|
12759
|
+
<xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
|
12760
|
+
<xsl:choose>
|
12761
|
+
<xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
|
12762
|
+
<xsl:value-of select="number($upper_clause_depth + 1)"/>
|
12763
|
+
</xsl:when>
|
12764
|
+
<xsl:otherwise>
|
12765
|
+
<xsl:value-of select="$level_total - 1"/>
|
12766
|
+
</xsl:otherwise>
|
12767
|
+
</xsl:choose>
|
12768
|
+
</xsl:when>
|
12645
12769
|
<xsl:when test="ancestor::*[local-name() = 'annex']">
|
12646
12770
|
<xsl:value-of select="$level_total"/>
|
12647
12771
|
</xsl:when>
|
@@ -13000,6 +13124,20 @@
|
|
13000
13124
|
|
13001
13125
|
<!-- END: insert cover page image -->
|
13002
13126
|
|
13127
|
+
<xsl:template name="insertVerticalChar">
|
13128
|
+
<xsl:param name="str"/>
|
13129
|
+
<xsl:if test="string-length($str) > 0">
|
13130
|
+
<fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
|
13131
|
+
<fo:block-container width="1em">
|
13132
|
+
<fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
|
13133
|
+
</fo:block-container>
|
13134
|
+
</fo:inline-container>
|
13135
|
+
<xsl:call-template name="insertVerticalChar">
|
13136
|
+
<xsl:with-param name="str" select="substring($str, 2)"/>
|
13137
|
+
</xsl:call-template>
|
13138
|
+
</xsl:if>
|
13139
|
+
</xsl:template>
|
13140
|
+
|
13003
13141
|
<xsl:template name="number-to-words">
|
13004
13142
|
<xsl:param name="number"/>
|
13005
13143
|
<xsl:param name="first"/>
|
@@ -13287,4 +13425,18 @@
|
|
13287
13425
|
</xsl:if>
|
13288
13426
|
</xsl:template>
|
13289
13427
|
|
13428
|
+
<xsl:template match="@*|node()" mode="set_table_role_skip">
|
13429
|
+
<xsl:copy>
|
13430
|
+
<xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
|
13431
|
+
</xsl:copy>
|
13432
|
+
</xsl:template>
|
13433
|
+
|
13434
|
+
<xsl:template match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
|
13435
|
+
<xsl:copy>
|
13436
|
+
<xsl:apply-templates select="@*" mode="set_table_role_skip"/>
|
13437
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
13438
|
+
<xsl:apply-templates select="node()" mode="set_table_role_skip"/>
|
13439
|
+
</xsl:copy>
|
13440
|
+
</xsl:template>
|
13441
|
+
|
13290
13442
|
</xsl:stylesheet>
|