metanorma-bipm 2.4.11 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/bipm/bipm.brochure.xsl +58 -6
- data/lib/isodoc/bipm/bipm.guide.xsl +58 -6
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +58 -6
- data/lib/isodoc/bipm/bipm.rapport.xsl +58 -6
- data/lib/isodoc/bipm/html/htmlstyle.css +40 -0
- data/lib/isodoc/bipm/jcgm.standard.xsl +58 -6
- data/lib/isodoc/bipm/metadata.rb +3 -1
- data/lib/isodoc/bipm/pdf_convert.rb +8 -9
- data/lib/metanorma/bipm/converter.rb +1 -1
- data/lib/metanorma/bipm/front.rb +8 -12
- data/lib/metanorma/bipm/processor.rb +0 -19
- data/lib/metanorma/bipm/version.rb +1 -1
- data/metanorma-bipm.gemspec +2 -1
- data/metanorma.yml +15 -0
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e64338ce855335c62f1d91866164719bc27d51fba3da87c05a0a2742fd616f1
|
4
|
+
data.tar.gz: 2a0b624bf5af319f0b6d07a722c2cc8548ea94d08ae51afb1251de6219ad7bd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6f425f80f2b93e33ae13331e3fd808f7a25f81621d54c2af65377457173621c03598886c54f0982105e44f60f1506cb40b4c7bcce76226aacb5934569808236
|
7
|
+
data.tar.gz: 1bd5e4718c7e410f270c3f23d66204c0b174725b23eb467b55acc38b619066fff62e19ea28e382984558120bbaa9f0ff7349f47caf0c6d404d130ba0cfc59932
|
@@ -5725,13 +5725,35 @@
|
|
5725
5725
|
</xsl:for-each>
|
5726
5726
|
</xsl:element>
|
5727
5727
|
|
5728
|
-
<xsl:call-template name="
|
5728
|
+
<xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
|
5729
5729
|
|
5730
|
-
<xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
|
5730
|
+
<!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
|
5731
5731
|
|
5732
5732
|
<!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
|
5733
5733
|
</xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
|
5734
5734
|
|
5735
|
+
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertAnnexAndBibliographyInSeparatePageSequences">
|
5736
|
+
<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']">
|
5737
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
5738
|
+
<xsl:choose>
|
5739
|
+
<xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
|
5740
|
+
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
5741
|
+
<xsl:attribute name="main_page_sequence"/>
|
5742
|
+
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
5743
|
+
</xsl:element>
|
5744
|
+
</xsl:when>
|
5745
|
+
<xsl:otherwise> <!-- bibliography -->
|
5746
|
+
<xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
|
5747
|
+
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
5748
|
+
<xsl:attribute name="main_page_sequence"/>
|
5749
|
+
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
5750
|
+
</xsl:element>
|
5751
|
+
</xsl:element>
|
5752
|
+
</xsl:otherwise>
|
5753
|
+
</xsl:choose>
|
5754
|
+
</xsl:for-each>
|
5755
|
+
</xsl:template>
|
5756
|
+
|
5735
5757
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertAnnexInSeparatePageSequences">
|
5736
5758
|
<xsl:for-each select="/*/*[local-name()='annex']">
|
5737
5759
|
<xsl:sort select="@displayorder" data-type="number"/>
|
@@ -9999,18 +10021,33 @@
|
|
9999
10021
|
|
10000
10022
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='localityStack']"/>
|
10001
10023
|
|
10024
|
+
<xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="pdfAttachmentsList_">
|
10025
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
10026
|
+
<attachment filename="{@name}"/>
|
10027
|
+
</xsl:for-each>
|
10028
|
+
</xsl:variable>
|
10029
|
+
<xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
10030
|
+
|
10002
10031
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='link']" name="link">
|
10032
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
10033
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
10003
10034
|
<xsl:variable name="target">
|
10004
10035
|
<xsl:choose>
|
10005
10036
|
<xsl:when test="@updatetype = 'true'">
|
10006
10037
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
10007
10038
|
</xsl:when>
|
10039
|
+
<!-- link to the PDF attachment -->
|
10040
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
10041
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
10042
|
+
</xsl:when>
|
10043
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
10044
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
10045
|
+
</xsl:when>
|
10008
10046
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
10009
|
-
<!-- link to the PDF attachment -->
|
10010
10047
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
10011
10048
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
10012
10049
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
10013
|
-
</xsl:when>
|
10050
|
+
</xsl:when> -->
|
10014
10051
|
<xsl:otherwise>
|
10015
10052
|
<xsl:value-of select="normalize-space(@target)"/>
|
10016
10053
|
</xsl:otherwise>
|
@@ -14638,6 +14675,19 @@
|
|
14638
14675
|
<xsl:copy-of select="."/>
|
14639
14676
|
</xsl:template>
|
14640
14677
|
|
14678
|
+
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
14679
|
+
<xsl:copy>
|
14680
|
+
<xsl:copy-of select="@*"/>
|
14681
|
+
<xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
|
14682
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
14683
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
14684
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
14685
|
+
<xsl:value-of select="normalize-space(.)"/>
|
14686
|
+
</xsl:if>
|
14687
|
+
</xsl:if>
|
14688
|
+
</xsl:copy>
|
14689
|
+
</xsl:template>
|
14690
|
+
|
14641
14691
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
14642
14692
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
14643
14693
|
<xsl:copy>
|
@@ -15508,11 +15558,13 @@
|
|
15508
15558
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
15509
15559
|
<xsl:choose>
|
15510
15560
|
<xsl:when test="normalize-space() != ''">
|
15511
|
-
<
|
15561
|
+
<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'( | | )', '')"/> <!-- remove line breaks -->
|
15562
|
+
<pdf:embedded-file src="{$src_attachment}" filename="{@name}"/>
|
15512
15563
|
</xsl:when>
|
15513
15564
|
<xsl:otherwise>
|
15514
15565
|
<!-- _{filename}_attachments -->
|
15515
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
15566
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
15567
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
15516
15568
|
<pdf:embedded-file src="{$url}" filename="{@name}"/>
|
15517
15569
|
</xsl:otherwise>
|
15518
15570
|
</xsl:choose>
|
@@ -5725,13 +5725,35 @@
|
|
5725
5725
|
</xsl:for-each>
|
5726
5726
|
</xsl:element>
|
5727
5727
|
|
5728
|
-
<xsl:call-template name="
|
5728
|
+
<xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
|
5729
5729
|
|
5730
|
-
<xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
|
5730
|
+
<!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
|
5731
5731
|
|
5732
5732
|
<!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
|
5733
5733
|
</xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
|
5734
5734
|
|
5735
|
+
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertAnnexAndBibliographyInSeparatePageSequences">
|
5736
|
+
<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']">
|
5737
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
5738
|
+
<xsl:choose>
|
5739
|
+
<xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
|
5740
|
+
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
5741
|
+
<xsl:attribute name="main_page_sequence"/>
|
5742
|
+
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
5743
|
+
</xsl:element>
|
5744
|
+
</xsl:when>
|
5745
|
+
<xsl:otherwise> <!-- bibliography -->
|
5746
|
+
<xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
|
5747
|
+
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
5748
|
+
<xsl:attribute name="main_page_sequence"/>
|
5749
|
+
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
5750
|
+
</xsl:element>
|
5751
|
+
</xsl:element>
|
5752
|
+
</xsl:otherwise>
|
5753
|
+
</xsl:choose>
|
5754
|
+
</xsl:for-each>
|
5755
|
+
</xsl:template>
|
5756
|
+
|
5735
5757
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertAnnexInSeparatePageSequences">
|
5736
5758
|
<xsl:for-each select="/*/*[local-name()='annex']">
|
5737
5759
|
<xsl:sort select="@displayorder" data-type="number"/>
|
@@ -9999,18 +10021,33 @@
|
|
9999
10021
|
|
10000
10022
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='localityStack']"/>
|
10001
10023
|
|
10024
|
+
<xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="pdfAttachmentsList_">
|
10025
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
10026
|
+
<attachment filename="{@name}"/>
|
10027
|
+
</xsl:for-each>
|
10028
|
+
</xsl:variable>
|
10029
|
+
<xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
10030
|
+
|
10002
10031
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='link']" name="link">
|
10032
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
10033
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
10003
10034
|
<xsl:variable name="target">
|
10004
10035
|
<xsl:choose>
|
10005
10036
|
<xsl:when test="@updatetype = 'true'">
|
10006
10037
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
10007
10038
|
</xsl:when>
|
10039
|
+
<!-- link to the PDF attachment -->
|
10040
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
10041
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
10042
|
+
</xsl:when>
|
10043
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
10044
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
10045
|
+
</xsl:when>
|
10008
10046
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
10009
|
-
<!-- link to the PDF attachment -->
|
10010
10047
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
10011
10048
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
10012
10049
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
10013
|
-
</xsl:when>
|
10050
|
+
</xsl:when> -->
|
10014
10051
|
<xsl:otherwise>
|
10015
10052
|
<xsl:value-of select="normalize-space(@target)"/>
|
10016
10053
|
</xsl:otherwise>
|
@@ -14638,6 +14675,19 @@
|
|
14638
14675
|
<xsl:copy-of select="."/>
|
14639
14676
|
</xsl:template>
|
14640
14677
|
|
14678
|
+
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
14679
|
+
<xsl:copy>
|
14680
|
+
<xsl:copy-of select="@*"/>
|
14681
|
+
<xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
|
14682
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
14683
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
14684
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
14685
|
+
<xsl:value-of select="normalize-space(.)"/>
|
14686
|
+
</xsl:if>
|
14687
|
+
</xsl:if>
|
14688
|
+
</xsl:copy>
|
14689
|
+
</xsl:template>
|
14690
|
+
|
14641
14691
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
14642
14692
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
14643
14693
|
<xsl:copy>
|
@@ -15508,11 +15558,13 @@
|
|
15508
15558
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
15509
15559
|
<xsl:choose>
|
15510
15560
|
<xsl:when test="normalize-space() != ''">
|
15511
|
-
<
|
15561
|
+
<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'( | | )', '')"/> <!-- remove line breaks -->
|
15562
|
+
<pdf:embedded-file src="{$src_attachment}" filename="{@name}"/>
|
15512
15563
|
</xsl:when>
|
15513
15564
|
<xsl:otherwise>
|
15514
15565
|
<!-- _{filename}_attachments -->
|
15515
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
15566
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
15567
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
15516
15568
|
<pdf:embedded-file src="{$url}" filename="{@name}"/>
|
15517
15569
|
</xsl:otherwise>
|
15518
15570
|
</xsl:choose>
|
@@ -5725,13 +5725,35 @@
|
|
5725
5725
|
</xsl:for-each>
|
5726
5726
|
</xsl:element>
|
5727
5727
|
|
5728
|
-
<xsl:call-template name="
|
5728
|
+
<xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
|
5729
5729
|
|
5730
|
-
<xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
|
5730
|
+
<!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
|
5731
5731
|
|
5732
5732
|
<!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
|
5733
5733
|
</xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
|
5734
5734
|
|
5735
|
+
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertAnnexAndBibliographyInSeparatePageSequences">
|
5736
|
+
<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']">
|
5737
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
5738
|
+
<xsl:choose>
|
5739
|
+
<xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
|
5740
|
+
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
5741
|
+
<xsl:attribute name="main_page_sequence"/>
|
5742
|
+
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
5743
|
+
</xsl:element>
|
5744
|
+
</xsl:when>
|
5745
|
+
<xsl:otherwise> <!-- bibliography -->
|
5746
|
+
<xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
|
5747
|
+
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
5748
|
+
<xsl:attribute name="main_page_sequence"/>
|
5749
|
+
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
5750
|
+
</xsl:element>
|
5751
|
+
</xsl:element>
|
5752
|
+
</xsl:otherwise>
|
5753
|
+
</xsl:choose>
|
5754
|
+
</xsl:for-each>
|
5755
|
+
</xsl:template>
|
5756
|
+
|
5735
5757
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertAnnexInSeparatePageSequences">
|
5736
5758
|
<xsl:for-each select="/*/*[local-name()='annex']">
|
5737
5759
|
<xsl:sort select="@displayorder" data-type="number"/>
|
@@ -9999,18 +10021,33 @@
|
|
9999
10021
|
|
10000
10022
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='localityStack']"/>
|
10001
10023
|
|
10024
|
+
<xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="pdfAttachmentsList_">
|
10025
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
10026
|
+
<attachment filename="{@name}"/>
|
10027
|
+
</xsl:for-each>
|
10028
|
+
</xsl:variable>
|
10029
|
+
<xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
10030
|
+
|
10002
10031
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='link']" name="link">
|
10032
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
10033
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
10003
10034
|
<xsl:variable name="target">
|
10004
10035
|
<xsl:choose>
|
10005
10036
|
<xsl:when test="@updatetype = 'true'">
|
10006
10037
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
10007
10038
|
</xsl:when>
|
10039
|
+
<!-- link to the PDF attachment -->
|
10040
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
10041
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
10042
|
+
</xsl:when>
|
10043
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
10044
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
10045
|
+
</xsl:when>
|
10008
10046
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
10009
|
-
<!-- link to the PDF attachment -->
|
10010
10047
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
10011
10048
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
10012
10049
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
10013
|
-
</xsl:when>
|
10050
|
+
</xsl:when> -->
|
10014
10051
|
<xsl:otherwise>
|
10015
10052
|
<xsl:value-of select="normalize-space(@target)"/>
|
10016
10053
|
</xsl:otherwise>
|
@@ -14638,6 +14675,19 @@
|
|
14638
14675
|
<xsl:copy-of select="."/>
|
14639
14676
|
</xsl:template>
|
14640
14677
|
|
14678
|
+
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
14679
|
+
<xsl:copy>
|
14680
|
+
<xsl:copy-of select="@*"/>
|
14681
|
+
<xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
|
14682
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
14683
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
14684
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
14685
|
+
<xsl:value-of select="normalize-space(.)"/>
|
14686
|
+
</xsl:if>
|
14687
|
+
</xsl:if>
|
14688
|
+
</xsl:copy>
|
14689
|
+
</xsl:template>
|
14690
|
+
|
14641
14691
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
14642
14692
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
14643
14693
|
<xsl:copy>
|
@@ -15508,11 +15558,13 @@
|
|
15508
15558
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
15509
15559
|
<xsl:choose>
|
15510
15560
|
<xsl:when test="normalize-space() != ''">
|
15511
|
-
<
|
15561
|
+
<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'( | | )', '')"/> <!-- remove line breaks -->
|
15562
|
+
<pdf:embedded-file src="{$src_attachment}" filename="{@name}"/>
|
15512
15563
|
</xsl:when>
|
15513
15564
|
<xsl:otherwise>
|
15514
15565
|
<!-- _{filename}_attachments -->
|
15515
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
15566
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
15567
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
15516
15568
|
<pdf:embedded-file src="{$url}" filename="{@name}"/>
|
15517
15569
|
</xsl:otherwise>
|
15518
15570
|
</xsl:choose>
|
@@ -5725,13 +5725,35 @@
|
|
5725
5725
|
</xsl:for-each>
|
5726
5726
|
</xsl:element>
|
5727
5727
|
|
5728
|
-
<xsl:call-template name="
|
5728
|
+
<xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
|
5729
5729
|
|
5730
|
-
<xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
|
5730
|
+
<!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
|
5731
5731
|
|
5732
5732
|
<!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
|
5733
5733
|
</xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
|
5734
5734
|
|
5735
|
+
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertAnnexAndBibliographyInSeparatePageSequences">
|
5736
|
+
<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']">
|
5737
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
5738
|
+
<xsl:choose>
|
5739
|
+
<xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
|
5740
|
+
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
5741
|
+
<xsl:attribute name="main_page_sequence"/>
|
5742
|
+
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
5743
|
+
</xsl:element>
|
5744
|
+
</xsl:when>
|
5745
|
+
<xsl:otherwise> <!-- bibliography -->
|
5746
|
+
<xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
|
5747
|
+
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
5748
|
+
<xsl:attribute name="main_page_sequence"/>
|
5749
|
+
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
5750
|
+
</xsl:element>
|
5751
|
+
</xsl:element>
|
5752
|
+
</xsl:otherwise>
|
5753
|
+
</xsl:choose>
|
5754
|
+
</xsl:for-each>
|
5755
|
+
</xsl:template>
|
5756
|
+
|
5735
5757
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertAnnexInSeparatePageSequences">
|
5736
5758
|
<xsl:for-each select="/*/*[local-name()='annex']">
|
5737
5759
|
<xsl:sort select="@displayorder" data-type="number"/>
|
@@ -9999,18 +10021,33 @@
|
|
9999
10021
|
|
10000
10022
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='localityStack']"/>
|
10001
10023
|
|
10024
|
+
<xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="pdfAttachmentsList_">
|
10025
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
10026
|
+
<attachment filename="{@name}"/>
|
10027
|
+
</xsl:for-each>
|
10028
|
+
</xsl:variable>
|
10029
|
+
<xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
10030
|
+
|
10002
10031
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='link']" name="link">
|
10032
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
10033
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
10003
10034
|
<xsl:variable name="target">
|
10004
10035
|
<xsl:choose>
|
10005
10036
|
<xsl:when test="@updatetype = 'true'">
|
10006
10037
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
10007
10038
|
</xsl:when>
|
10039
|
+
<!-- link to the PDF attachment -->
|
10040
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
10041
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
10042
|
+
</xsl:when>
|
10043
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
10044
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
10045
|
+
</xsl:when>
|
10008
10046
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
10009
|
-
<!-- link to the PDF attachment -->
|
10010
10047
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
10011
10048
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
10012
10049
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
10013
|
-
</xsl:when>
|
10050
|
+
</xsl:when> -->
|
10014
10051
|
<xsl:otherwise>
|
10015
10052
|
<xsl:value-of select="normalize-space(@target)"/>
|
10016
10053
|
</xsl:otherwise>
|
@@ -14638,6 +14675,19 @@
|
|
14638
14675
|
<xsl:copy-of select="."/>
|
14639
14676
|
</xsl:template>
|
14640
14677
|
|
14678
|
+
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
14679
|
+
<xsl:copy>
|
14680
|
+
<xsl:copy-of select="@*"/>
|
14681
|
+
<xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
|
14682
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
14683
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
14684
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
14685
|
+
<xsl:value-of select="normalize-space(.)"/>
|
14686
|
+
</xsl:if>
|
14687
|
+
</xsl:if>
|
14688
|
+
</xsl:copy>
|
14689
|
+
</xsl:template>
|
14690
|
+
|
14641
14691
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
14642
14692
|
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
14643
14693
|
<xsl:copy>
|
@@ -15508,11 +15558,13 @@
|
|
15508
15558
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
15509
15559
|
<xsl:choose>
|
15510
15560
|
<xsl:when test="normalize-space() != ''">
|
15511
|
-
<
|
15561
|
+
<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'( | | )', '')"/> <!-- remove line breaks -->
|
15562
|
+
<pdf:embedded-file src="{$src_attachment}" filename="{@name}"/>
|
15512
15563
|
</xsl:when>
|
15513
15564
|
<xsl:otherwise>
|
15514
15565
|
<!-- _{filename}_attachments -->
|
15515
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
15566
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
15567
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
15516
15568
|
<pdf:embedded-file src="{$url}" filename="{@name}"/>
|
15517
15569
|
</xsl:otherwise>
|
15518
15570
|
</xsl:choose>
|
@@ -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
|
#brochure-band {
|
233
273
|
background-color: #0AC442; }
|
234
274
|
|
@@ -3645,13 +3645,35 @@
|
|
3645
3645
|
</xsl:for-each>
|
3646
3646
|
</xsl:element>
|
3647
3647
|
|
3648
|
-
<xsl:call-template name="
|
3648
|
+
<xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
|
3649
3649
|
|
3650
|
-
<xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
|
3650
|
+
<!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
|
3651
3651
|
|
3652
3652
|
<!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
|
3653
3653
|
</xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
|
3654
3654
|
|
3655
|
+
<xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
|
3656
|
+
<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']">
|
3657
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
3658
|
+
<xsl:choose>
|
3659
|
+
<xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
|
3660
|
+
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
3661
|
+
<xsl:attribute name="main_page_sequence"/>
|
3662
|
+
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
3663
|
+
</xsl:element>
|
3664
|
+
</xsl:when>
|
3665
|
+
<xsl:otherwise> <!-- bibliography -->
|
3666
|
+
<xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
|
3667
|
+
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
3668
|
+
<xsl:attribute name="main_page_sequence"/>
|
3669
|
+
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
3670
|
+
</xsl:element>
|
3671
|
+
</xsl:element>
|
3672
|
+
</xsl:otherwise>
|
3673
|
+
</xsl:choose>
|
3674
|
+
</xsl:for-each>
|
3675
|
+
</xsl:template>
|
3676
|
+
|
3655
3677
|
<xsl:template name="insertAnnexInSeparatePageSequences">
|
3656
3678
|
<xsl:for-each select="/*/*[local-name()='annex']">
|
3657
3679
|
<xsl:sort select="@displayorder" data-type="number"/>
|
@@ -7908,18 +7930,33 @@
|
|
7908
7930
|
|
7909
7931
|
<xsl:template match="*[local-name()='localityStack']"/>
|
7910
7932
|
|
7933
|
+
<xsl:variable name="pdfAttachmentsList_">
|
7934
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
7935
|
+
<attachment filename="{@name}"/>
|
7936
|
+
</xsl:for-each>
|
7937
|
+
</xsl:variable>
|
7938
|
+
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
7939
|
+
|
7911
7940
|
<xsl:template match="*[local-name()='link']" name="link">
|
7941
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
7942
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
7912
7943
|
<xsl:variable name="target">
|
7913
7944
|
<xsl:choose>
|
7914
7945
|
<xsl:when test="@updatetype = 'true'">
|
7915
7946
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
7916
7947
|
</xsl:when>
|
7948
|
+
<!-- link to the PDF attachment -->
|
7949
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
7950
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
7951
|
+
</xsl:when>
|
7952
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
7953
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
7954
|
+
</xsl:when>
|
7917
7955
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
7918
|
-
<!-- link to the PDF attachment -->
|
7919
7956
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
7920
7957
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
7921
7958
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
7922
|
-
</xsl:when>
|
7959
|
+
</xsl:when> -->
|
7923
7960
|
<xsl:otherwise>
|
7924
7961
|
<xsl:value-of select="normalize-space(@target)"/>
|
7925
7962
|
</xsl:otherwise>
|
@@ -12529,6 +12566,19 @@
|
|
12529
12566
|
<xsl:copy-of select="."/>
|
12530
12567
|
</xsl:template>
|
12531
12568
|
|
12569
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
12570
|
+
<xsl:copy>
|
12571
|
+
<xsl:copy-of select="@*"/>
|
12572
|
+
<xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
|
12573
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
12574
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
12575
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
12576
|
+
<xsl:value-of select="normalize-space(.)"/>
|
12577
|
+
</xsl:if>
|
12578
|
+
</xsl:if>
|
12579
|
+
</xsl:copy>
|
12580
|
+
</xsl:template>
|
12581
|
+
|
12532
12582
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
12533
12583
|
<xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
12534
12584
|
<xsl:copy>
|
@@ -13397,11 +13447,13 @@
|
|
13397
13447
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
13398
13448
|
<xsl:choose>
|
13399
13449
|
<xsl:when test="normalize-space() != ''">
|
13400
|
-
<
|
13450
|
+
<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'( | | )', '')"/> <!-- remove line breaks -->
|
13451
|
+
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
|
13401
13452
|
</xsl:when>
|
13402
13453
|
<xsl:otherwise>
|
13403
13454
|
<!-- _{filename}_attachments -->
|
13404
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
13455
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
13456
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
13405
13457
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
|
13406
13458
|
</xsl:otherwise>
|
13407
13459
|
</xsl:choose>
|
data/lib/isodoc/bipm/metadata.rb
CHANGED
@@ -83,7 +83,9 @@ module IsoDoc
|
|
83
83
|
ret = xml.xpath(ns("//bibdata/contributor[xmlns:role/@type = " \
|
84
84
|
"'authorizer']/organization"))
|
85
85
|
.each_with_object([]) do |org, m|
|
86
|
-
|
86
|
+
name = org.at(ns("./name[@language = '#{@lang}']")) ||
|
87
|
+
org.at(ns("./name"))
|
88
|
+
m << name.text
|
87
89
|
end
|
88
90
|
ret.empty? or set(:authorizer, ret)
|
89
91
|
end
|
@@ -1,22 +1,18 @@
|
|
1
1
|
require "isodoc"
|
2
|
+
require "metanorma-generic"
|
3
|
+
require_relative "base_convert"
|
2
4
|
|
3
5
|
module IsoDoc
|
4
6
|
module BIPM
|
5
|
-
|
6
|
-
# document schema encapsulation of the document for validation
|
7
|
-
class PdfConvert < IsoDoc::XslfoPdfConvert
|
7
|
+
class PdfConvert < IsoDoc::Generic::PdfConvert
|
8
8
|
def initialize(options)
|
9
|
-
@libdir = File.dirname(__FILE__)
|
10
9
|
super
|
11
|
-
|
12
|
-
|
13
|
-
def configuration
|
14
|
-
Metanorma::BIPM.configuration
|
10
|
+
@libdir = File.dirname(__FILE__)
|
15
11
|
end
|
16
12
|
|
17
13
|
def pdf_stylesheet(docxml)
|
18
14
|
docxml&.at(ns("//bibdata/ext/editorialgroup/committee/@acronym"))
|
19
|
-
|
15
|
+
&.value == "JCGM" and
|
20
16
|
return "jcgm.standard.xsl"
|
21
17
|
|
22
18
|
doctype = @doctype
|
@@ -37,6 +33,9 @@ module IsoDoc
|
|
37
33
|
end
|
38
34
|
super
|
39
35
|
end
|
36
|
+
|
37
|
+
include Init
|
38
|
+
include BaseConvert
|
40
39
|
end
|
41
40
|
end
|
42
41
|
end
|
@@ -85,7 +85,7 @@ module Metanorma
|
|
85
85
|
def committee_validate(xml)
|
86
86
|
committees = Array(configuration&.committees) || return
|
87
87
|
committees.empty? and return
|
88
|
-
xml.xpath("//bibdata/ext/editorialgroup/committee
|
88
|
+
xml.xpath("//bibdata/ext/editorialgroup/committee").each do |c|
|
89
89
|
committees.include? c.text or
|
90
90
|
@log.add("Document Attributes", nil,
|
91
91
|
"#{c.text} is not a recognised committee")
|
data/lib/metanorma/bipm/front.rb
CHANGED
@@ -16,22 +16,18 @@ module Metanorma
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def metadata_committee1(node, xml)
|
19
|
-
|
20
|
-
|
21
|
-
e
|
22
|
-
|
23
|
-
e = node.attr("committee-fr") and
|
24
|
-
c.variant e, language: "fr", script: "Latn"
|
19
|
+
%w(en fr).each do |lg|
|
20
|
+
e = node.attr("committee-#{lg}") or next
|
21
|
+
xml.committee e, **attr_code(acronym: node.attr("committee-acronym"),
|
22
|
+
language: lg, script: "Latn")
|
25
23
|
end
|
26
24
|
end
|
27
25
|
|
28
26
|
def metadata_committee2(node, xml, num)
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
c.variant e, language: lg, script: "Latn"
|
34
|
-
end
|
27
|
+
%w(en fr).each do |lg|
|
28
|
+
e = node.attr("committee-#{lg}_#{num}") or next
|
29
|
+
xml.committee e, **attr_code(acronym: node.attr("committee-acronym"),
|
30
|
+
language: lg, script: "Latn")
|
35
31
|
end
|
36
32
|
end
|
37
33
|
|
@@ -14,25 +14,6 @@ module Metanorma
|
|
14
14
|
).tap { |hs| hs.delete(:doc) }
|
15
15
|
end
|
16
16
|
|
17
|
-
def fonts_manifest
|
18
|
-
{
|
19
|
-
"Arial" => nil,
|
20
|
-
"Times New Roman" => nil,
|
21
|
-
"Work Sans" => nil,
|
22
|
-
"Work Sans Black" => nil,
|
23
|
-
"Work Sans ExtraBold" => nil,
|
24
|
-
"Work Sans ExtraLight" => nil,
|
25
|
-
"Work Sans Light" => nil,
|
26
|
-
"Work Sans Medium" => nil,
|
27
|
-
"Work Sans SemiBold" => nil,
|
28
|
-
"Work Sans Thin" => nil,
|
29
|
-
"STIX Two Math" => nil,
|
30
|
-
"Source Han Sans" => nil,
|
31
|
-
"Source Han Sans Normal" => nil,
|
32
|
-
"TeXGyreChorus" => nil,
|
33
|
-
}
|
34
|
-
end
|
35
|
-
|
36
17
|
def version
|
37
18
|
"Metanorma::BIPM #{Metanorma::BIPM::VERSION}"
|
38
19
|
end
|
data/metanorma-bipm.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
|
29
29
|
|
30
|
-
spec.add_dependency "metanorma-generic", "~> 2.
|
30
|
+
spec.add_dependency "metanorma-generic", "~> 2.7.0"
|
31
31
|
spec.add_dependency "metanorma-iso", "~> 2.8.0"
|
32
32
|
|
33
33
|
spec.add_development_dependency "debug"
|
@@ -42,4 +42,5 @@ Gem::Specification.new do |spec|
|
|
42
42
|
spec.add_development_dependency "timecop", "~> 0.9"
|
43
43
|
spec.add_development_dependency "vcr", "~> 6.1.0"
|
44
44
|
spec.add_development_dependency "webmock"
|
45
|
+
spec.add_development_dependency "xml-c14n"
|
45
46
|
end
|
data/metanorma.yml
CHANGED
@@ -116,3 +116,18 @@ metadata_extensions:
|
|
116
116
|
relations:
|
117
117
|
- supersedes
|
118
118
|
- superseded-by
|
119
|
+
fonts_manifest:
|
120
|
+
Arial:
|
121
|
+
Times New Roman:
|
122
|
+
Work Sans:
|
123
|
+
Work Sans Black:
|
124
|
+
Work Sans ExtraBold:
|
125
|
+
Work Sans ExtraLight:
|
126
|
+
Work Sans Light:
|
127
|
+
Work Sans Medium:
|
128
|
+
Work Sans SemiBold:
|
129
|
+
Work Sans Thin:
|
130
|
+
STIX Two Math:
|
131
|
+
Source Han Sans:
|
132
|
+
Source Han Sans Normal:
|
133
|
+
TeXGyreChorus:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-bipm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
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-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.7.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: metanorma-iso
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,6 +206,20 @@ dependencies:
|
|
206
206
|
- - ">="
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: xml-c14n
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
209
223
|
description: |
|
210
224
|
metanorma-vg lets you write Bureau International de Poids et Mesures (BIPM) standards in Metanorma syntax.
|
211
225
|
|