metanorma-itu 2.4.11 → 2.4.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/itu/itu.implementers-guide.xsl +38 -5
- data/lib/isodoc/itu/itu.in-force.xsl +38 -5
- data/lib/isodoc/itu/itu.recommendation-annex.xsl +38 -5
- data/lib/isodoc/itu/itu.recommendation-supplement.xsl +38 -5
- data/lib/isodoc/itu/itu.recommendation.xsl +38 -5
- data/lib/isodoc/itu/itu.resolution.xsl +38 -5
- data/lib/isodoc/itu/itu.service-publication.xsl +38 -5
- data/lib/isodoc/itu/itu.technical-paper.xsl +38 -5
- data/lib/isodoc/itu/itu.technical-report.xsl +38 -5
- data/lib/metanorma/itu/converter.rb +1 -1
- data/lib/metanorma/itu/isodoc.rng +5 -5
- data/lib/metanorma/itu/version.rb +1 -1
- data/metanorma-itu.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b12cbd30d0aa887cb91afaa25444e3889980724d0aec818eb10f8983d4da401f
|
4
|
+
data.tar.gz: f8c8e8416f104d47dc6d05a4b687bd1da9c88c52bc353d4af2099ed920abe7c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78ab925ed8e8e1ebd204724261895b8cd65b778ff46e48ed09a334966f8df160c03e0e7031006fee1a5f8a09be1aac31d2d9dcab0fa8c9ca408eb855d9e4e909
|
7
|
+
data.tar.gz: 549695931d13618909a40d38befc396cd5bfecdcb33ab2c96e090731d4e7987e22a20305e66fe12a28c431d77482cf32514c8907d6af1f00834ff45db7be363d
|
@@ -8854,18 +8854,33 @@
|
|
8854
8854
|
|
8855
8855
|
<xsl:template match="*[local-name()='localityStack']"/>
|
8856
8856
|
|
8857
|
+
<xsl:variable name="pdfAttachmentsList_">
|
8858
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8859
|
+
<attachment filename="{@name}"/>
|
8860
|
+
</xsl:for-each>
|
8861
|
+
</xsl:variable>
|
8862
|
+
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8863
|
+
|
8857
8864
|
<xsl:template match="*[local-name()='link']" name="link">
|
8865
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
8866
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
8858
8867
|
<xsl:variable name="target">
|
8859
8868
|
<xsl:choose>
|
8860
8869
|
<xsl:when test="@updatetype = 'true'">
|
8861
8870
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8862
8871
|
</xsl:when>
|
8872
|
+
<!-- link to the PDF attachment -->
|
8873
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8874
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8875
|
+
</xsl:when>
|
8876
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
8877
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
8878
|
+
</xsl:when>
|
8863
8879
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
8864
|
-
<!-- link to the PDF attachment -->
|
8865
8880
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
8866
8881
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
8867
8882
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
8868
|
-
</xsl:when>
|
8883
|
+
</xsl:when> -->
|
8869
8884
|
<xsl:otherwise>
|
8870
8885
|
<xsl:value-of select="normalize-space(@target)"/>
|
8871
8886
|
</xsl:otherwise>
|
@@ -10524,8 +10539,11 @@
|
|
10524
10539
|
</xsl:template>
|
10525
10540
|
|
10526
10541
|
<xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
10542
|
+
<xsl:param name="element"/>
|
10527
10543
|
<xsl:copy>
|
10528
|
-
<xsl:apply-templates mode="contents_item"
|
10544
|
+
<xsl:apply-templates mode="contents_item">
|
10545
|
+
<xsl:with-param name="element" select="$element"/>
|
10546
|
+
</xsl:apply-templates>
|
10529
10547
|
</xsl:copy>
|
10530
10548
|
</xsl:template>
|
10531
10549
|
|
@@ -10592,7 +10610,10 @@
|
|
10592
10610
|
|
10593
10611
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
10594
10612
|
<xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
10595
|
-
<xsl:
|
10613
|
+
<xsl:param name="element"/>
|
10614
|
+
<xsl:apply-templates mode="contents_item">
|
10615
|
+
<xsl:with-param name="element" select="$element"/>
|
10616
|
+
</xsl:apply-templates>
|
10596
10617
|
</xsl:template>
|
10597
10618
|
|
10598
10619
|
<!-- =============== -->
|
@@ -13493,6 +13514,17 @@
|
|
13493
13514
|
<xsl:copy-of select="."/>
|
13494
13515
|
</xsl:template>
|
13495
13516
|
|
13517
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
13518
|
+
<xsl:copy>
|
13519
|
+
<xsl:copy-of select="@*"/>
|
13520
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
13521
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
13522
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
13523
|
+
<xsl:value-of select="."/>
|
13524
|
+
</xsl:if>
|
13525
|
+
</xsl:copy>
|
13526
|
+
</xsl:template>
|
13527
|
+
|
13496
13528
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
13497
13529
|
<xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
13498
13530
|
<xsl:copy>
|
@@ -14367,7 +14399,8 @@
|
|
14367
14399
|
</xsl:when>
|
14368
14400
|
<xsl:otherwise>
|
14369
14401
|
<!-- _{filename}_attachments -->
|
14370
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
14402
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
14403
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
14371
14404
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
|
14372
14405
|
</xsl:otherwise>
|
14373
14406
|
</xsl:choose>
|
@@ -8854,18 +8854,33 @@
|
|
8854
8854
|
|
8855
8855
|
<xsl:template match="*[local-name()='localityStack']"/>
|
8856
8856
|
|
8857
|
+
<xsl:variable name="pdfAttachmentsList_">
|
8858
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8859
|
+
<attachment filename="{@name}"/>
|
8860
|
+
</xsl:for-each>
|
8861
|
+
</xsl:variable>
|
8862
|
+
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8863
|
+
|
8857
8864
|
<xsl:template match="*[local-name()='link']" name="link">
|
8865
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
8866
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
8858
8867
|
<xsl:variable name="target">
|
8859
8868
|
<xsl:choose>
|
8860
8869
|
<xsl:when test="@updatetype = 'true'">
|
8861
8870
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8862
8871
|
</xsl:when>
|
8872
|
+
<!-- link to the PDF attachment -->
|
8873
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8874
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8875
|
+
</xsl:when>
|
8876
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
8877
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
8878
|
+
</xsl:when>
|
8863
8879
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
8864
|
-
<!-- link to the PDF attachment -->
|
8865
8880
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
8866
8881
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
8867
8882
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
8868
|
-
</xsl:when>
|
8883
|
+
</xsl:when> -->
|
8869
8884
|
<xsl:otherwise>
|
8870
8885
|
<xsl:value-of select="normalize-space(@target)"/>
|
8871
8886
|
</xsl:otherwise>
|
@@ -10524,8 +10539,11 @@
|
|
10524
10539
|
</xsl:template>
|
10525
10540
|
|
10526
10541
|
<xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
10542
|
+
<xsl:param name="element"/>
|
10527
10543
|
<xsl:copy>
|
10528
|
-
<xsl:apply-templates mode="contents_item"
|
10544
|
+
<xsl:apply-templates mode="contents_item">
|
10545
|
+
<xsl:with-param name="element" select="$element"/>
|
10546
|
+
</xsl:apply-templates>
|
10529
10547
|
</xsl:copy>
|
10530
10548
|
</xsl:template>
|
10531
10549
|
|
@@ -10592,7 +10610,10 @@
|
|
10592
10610
|
|
10593
10611
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
10594
10612
|
<xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
10595
|
-
<xsl:
|
10613
|
+
<xsl:param name="element"/>
|
10614
|
+
<xsl:apply-templates mode="contents_item">
|
10615
|
+
<xsl:with-param name="element" select="$element"/>
|
10616
|
+
</xsl:apply-templates>
|
10596
10617
|
</xsl:template>
|
10597
10618
|
|
10598
10619
|
<!-- =============== -->
|
@@ -13493,6 +13514,17 @@
|
|
13493
13514
|
<xsl:copy-of select="."/>
|
13494
13515
|
</xsl:template>
|
13495
13516
|
|
13517
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
13518
|
+
<xsl:copy>
|
13519
|
+
<xsl:copy-of select="@*"/>
|
13520
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
13521
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
13522
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
13523
|
+
<xsl:value-of select="."/>
|
13524
|
+
</xsl:if>
|
13525
|
+
</xsl:copy>
|
13526
|
+
</xsl:template>
|
13527
|
+
|
13496
13528
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
13497
13529
|
<xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
13498
13530
|
<xsl:copy>
|
@@ -14367,7 +14399,8 @@
|
|
14367
14399
|
</xsl:when>
|
14368
14400
|
<xsl:otherwise>
|
14369
14401
|
<!-- _{filename}_attachments -->
|
14370
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
14402
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
14403
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
14371
14404
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
|
14372
14405
|
</xsl:otherwise>
|
14373
14406
|
</xsl:choose>
|
@@ -8854,18 +8854,33 @@
|
|
8854
8854
|
|
8855
8855
|
<xsl:template match="*[local-name()='localityStack']"/>
|
8856
8856
|
|
8857
|
+
<xsl:variable name="pdfAttachmentsList_">
|
8858
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8859
|
+
<attachment filename="{@name}"/>
|
8860
|
+
</xsl:for-each>
|
8861
|
+
</xsl:variable>
|
8862
|
+
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8863
|
+
|
8857
8864
|
<xsl:template match="*[local-name()='link']" name="link">
|
8865
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
8866
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
8858
8867
|
<xsl:variable name="target">
|
8859
8868
|
<xsl:choose>
|
8860
8869
|
<xsl:when test="@updatetype = 'true'">
|
8861
8870
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8862
8871
|
</xsl:when>
|
8872
|
+
<!-- link to the PDF attachment -->
|
8873
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8874
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8875
|
+
</xsl:when>
|
8876
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
8877
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
8878
|
+
</xsl:when>
|
8863
8879
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
8864
|
-
<!-- link to the PDF attachment -->
|
8865
8880
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
8866
8881
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
8867
8882
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
8868
|
-
</xsl:when>
|
8883
|
+
</xsl:when> -->
|
8869
8884
|
<xsl:otherwise>
|
8870
8885
|
<xsl:value-of select="normalize-space(@target)"/>
|
8871
8886
|
</xsl:otherwise>
|
@@ -10524,8 +10539,11 @@
|
|
10524
10539
|
</xsl:template>
|
10525
10540
|
|
10526
10541
|
<xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
10542
|
+
<xsl:param name="element"/>
|
10527
10543
|
<xsl:copy>
|
10528
|
-
<xsl:apply-templates mode="contents_item"
|
10544
|
+
<xsl:apply-templates mode="contents_item">
|
10545
|
+
<xsl:with-param name="element" select="$element"/>
|
10546
|
+
</xsl:apply-templates>
|
10529
10547
|
</xsl:copy>
|
10530
10548
|
</xsl:template>
|
10531
10549
|
|
@@ -10592,7 +10610,10 @@
|
|
10592
10610
|
|
10593
10611
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
10594
10612
|
<xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
10595
|
-
<xsl:
|
10613
|
+
<xsl:param name="element"/>
|
10614
|
+
<xsl:apply-templates mode="contents_item">
|
10615
|
+
<xsl:with-param name="element" select="$element"/>
|
10616
|
+
</xsl:apply-templates>
|
10596
10617
|
</xsl:template>
|
10597
10618
|
|
10598
10619
|
<!-- =============== -->
|
@@ -13493,6 +13514,17 @@
|
|
13493
13514
|
<xsl:copy-of select="."/>
|
13494
13515
|
</xsl:template>
|
13495
13516
|
|
13517
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
13518
|
+
<xsl:copy>
|
13519
|
+
<xsl:copy-of select="@*"/>
|
13520
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
13521
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
13522
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
13523
|
+
<xsl:value-of select="."/>
|
13524
|
+
</xsl:if>
|
13525
|
+
</xsl:copy>
|
13526
|
+
</xsl:template>
|
13527
|
+
|
13496
13528
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
13497
13529
|
<xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
13498
13530
|
<xsl:copy>
|
@@ -14367,7 +14399,8 @@
|
|
14367
14399
|
</xsl:when>
|
14368
14400
|
<xsl:otherwise>
|
14369
14401
|
<!-- _{filename}_attachments -->
|
14370
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
14402
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
14403
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
14371
14404
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
|
14372
14405
|
</xsl:otherwise>
|
14373
14406
|
</xsl:choose>
|
@@ -8854,18 +8854,33 @@
|
|
8854
8854
|
|
8855
8855
|
<xsl:template match="*[local-name()='localityStack']"/>
|
8856
8856
|
|
8857
|
+
<xsl:variable name="pdfAttachmentsList_">
|
8858
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8859
|
+
<attachment filename="{@name}"/>
|
8860
|
+
</xsl:for-each>
|
8861
|
+
</xsl:variable>
|
8862
|
+
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8863
|
+
|
8857
8864
|
<xsl:template match="*[local-name()='link']" name="link">
|
8865
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
8866
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
8858
8867
|
<xsl:variable name="target">
|
8859
8868
|
<xsl:choose>
|
8860
8869
|
<xsl:when test="@updatetype = 'true'">
|
8861
8870
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8862
8871
|
</xsl:when>
|
8872
|
+
<!-- link to the PDF attachment -->
|
8873
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8874
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8875
|
+
</xsl:when>
|
8876
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
8877
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
8878
|
+
</xsl:when>
|
8863
8879
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
8864
|
-
<!-- link to the PDF attachment -->
|
8865
8880
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
8866
8881
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
8867
8882
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
8868
|
-
</xsl:when>
|
8883
|
+
</xsl:when> -->
|
8869
8884
|
<xsl:otherwise>
|
8870
8885
|
<xsl:value-of select="normalize-space(@target)"/>
|
8871
8886
|
</xsl:otherwise>
|
@@ -10524,8 +10539,11 @@
|
|
10524
10539
|
</xsl:template>
|
10525
10540
|
|
10526
10541
|
<xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
10542
|
+
<xsl:param name="element"/>
|
10527
10543
|
<xsl:copy>
|
10528
|
-
<xsl:apply-templates mode="contents_item"
|
10544
|
+
<xsl:apply-templates mode="contents_item">
|
10545
|
+
<xsl:with-param name="element" select="$element"/>
|
10546
|
+
</xsl:apply-templates>
|
10529
10547
|
</xsl:copy>
|
10530
10548
|
</xsl:template>
|
10531
10549
|
|
@@ -10592,7 +10610,10 @@
|
|
10592
10610
|
|
10593
10611
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
10594
10612
|
<xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
10595
|
-
<xsl:
|
10613
|
+
<xsl:param name="element"/>
|
10614
|
+
<xsl:apply-templates mode="contents_item">
|
10615
|
+
<xsl:with-param name="element" select="$element"/>
|
10616
|
+
</xsl:apply-templates>
|
10596
10617
|
</xsl:template>
|
10597
10618
|
|
10598
10619
|
<!-- =============== -->
|
@@ -13493,6 +13514,17 @@
|
|
13493
13514
|
<xsl:copy-of select="."/>
|
13494
13515
|
</xsl:template>
|
13495
13516
|
|
13517
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
13518
|
+
<xsl:copy>
|
13519
|
+
<xsl:copy-of select="@*"/>
|
13520
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
13521
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
13522
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
13523
|
+
<xsl:value-of select="."/>
|
13524
|
+
</xsl:if>
|
13525
|
+
</xsl:copy>
|
13526
|
+
</xsl:template>
|
13527
|
+
|
13496
13528
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
13497
13529
|
<xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
13498
13530
|
<xsl:copy>
|
@@ -14367,7 +14399,8 @@
|
|
14367
14399
|
</xsl:when>
|
14368
14400
|
<xsl:otherwise>
|
14369
14401
|
<!-- _{filename}_attachments -->
|
14370
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
14402
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
14403
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
14371
14404
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
|
14372
14405
|
</xsl:otherwise>
|
14373
14406
|
</xsl:choose>
|
@@ -8854,18 +8854,33 @@
|
|
8854
8854
|
|
8855
8855
|
<xsl:template match="*[local-name()='localityStack']"/>
|
8856
8856
|
|
8857
|
+
<xsl:variable name="pdfAttachmentsList_">
|
8858
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8859
|
+
<attachment filename="{@name}"/>
|
8860
|
+
</xsl:for-each>
|
8861
|
+
</xsl:variable>
|
8862
|
+
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8863
|
+
|
8857
8864
|
<xsl:template match="*[local-name()='link']" name="link">
|
8865
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
8866
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
8858
8867
|
<xsl:variable name="target">
|
8859
8868
|
<xsl:choose>
|
8860
8869
|
<xsl:when test="@updatetype = 'true'">
|
8861
8870
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8862
8871
|
</xsl:when>
|
8872
|
+
<!-- link to the PDF attachment -->
|
8873
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8874
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8875
|
+
</xsl:when>
|
8876
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
8877
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
8878
|
+
</xsl:when>
|
8863
8879
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
8864
|
-
<!-- link to the PDF attachment -->
|
8865
8880
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
8866
8881
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
8867
8882
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
8868
|
-
</xsl:when>
|
8883
|
+
</xsl:when> -->
|
8869
8884
|
<xsl:otherwise>
|
8870
8885
|
<xsl:value-of select="normalize-space(@target)"/>
|
8871
8886
|
</xsl:otherwise>
|
@@ -10524,8 +10539,11 @@
|
|
10524
10539
|
</xsl:template>
|
10525
10540
|
|
10526
10541
|
<xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
10542
|
+
<xsl:param name="element"/>
|
10527
10543
|
<xsl:copy>
|
10528
|
-
<xsl:apply-templates mode="contents_item"
|
10544
|
+
<xsl:apply-templates mode="contents_item">
|
10545
|
+
<xsl:with-param name="element" select="$element"/>
|
10546
|
+
</xsl:apply-templates>
|
10529
10547
|
</xsl:copy>
|
10530
10548
|
</xsl:template>
|
10531
10549
|
|
@@ -10592,7 +10610,10 @@
|
|
10592
10610
|
|
10593
10611
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
10594
10612
|
<xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
10595
|
-
<xsl:
|
10613
|
+
<xsl:param name="element"/>
|
10614
|
+
<xsl:apply-templates mode="contents_item">
|
10615
|
+
<xsl:with-param name="element" select="$element"/>
|
10616
|
+
</xsl:apply-templates>
|
10596
10617
|
</xsl:template>
|
10597
10618
|
|
10598
10619
|
<!-- =============== -->
|
@@ -13493,6 +13514,17 @@
|
|
13493
13514
|
<xsl:copy-of select="."/>
|
13494
13515
|
</xsl:template>
|
13495
13516
|
|
13517
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
13518
|
+
<xsl:copy>
|
13519
|
+
<xsl:copy-of select="@*"/>
|
13520
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
13521
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
13522
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
13523
|
+
<xsl:value-of select="."/>
|
13524
|
+
</xsl:if>
|
13525
|
+
</xsl:copy>
|
13526
|
+
</xsl:template>
|
13527
|
+
|
13496
13528
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
13497
13529
|
<xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
13498
13530
|
<xsl:copy>
|
@@ -14367,7 +14399,8 @@
|
|
14367
14399
|
</xsl:when>
|
14368
14400
|
<xsl:otherwise>
|
14369
14401
|
<!-- _{filename}_attachments -->
|
14370
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
14402
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
14403
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
14371
14404
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
|
14372
14405
|
</xsl:otherwise>
|
14373
14406
|
</xsl:choose>
|
@@ -8854,18 +8854,33 @@
|
|
8854
8854
|
|
8855
8855
|
<xsl:template match="*[local-name()='localityStack']"/>
|
8856
8856
|
|
8857
|
+
<xsl:variable name="pdfAttachmentsList_">
|
8858
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8859
|
+
<attachment filename="{@name}"/>
|
8860
|
+
</xsl:for-each>
|
8861
|
+
</xsl:variable>
|
8862
|
+
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8863
|
+
|
8857
8864
|
<xsl:template match="*[local-name()='link']" name="link">
|
8865
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
8866
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
8858
8867
|
<xsl:variable name="target">
|
8859
8868
|
<xsl:choose>
|
8860
8869
|
<xsl:when test="@updatetype = 'true'">
|
8861
8870
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8862
8871
|
</xsl:when>
|
8872
|
+
<!-- link to the PDF attachment -->
|
8873
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8874
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8875
|
+
</xsl:when>
|
8876
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
8877
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
8878
|
+
</xsl:when>
|
8863
8879
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
8864
|
-
<!-- link to the PDF attachment -->
|
8865
8880
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
8866
8881
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
8867
8882
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
8868
|
-
</xsl:when>
|
8883
|
+
</xsl:when> -->
|
8869
8884
|
<xsl:otherwise>
|
8870
8885
|
<xsl:value-of select="normalize-space(@target)"/>
|
8871
8886
|
</xsl:otherwise>
|
@@ -10524,8 +10539,11 @@
|
|
10524
10539
|
</xsl:template>
|
10525
10540
|
|
10526
10541
|
<xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
10542
|
+
<xsl:param name="element"/>
|
10527
10543
|
<xsl:copy>
|
10528
|
-
<xsl:apply-templates mode="contents_item"
|
10544
|
+
<xsl:apply-templates mode="contents_item">
|
10545
|
+
<xsl:with-param name="element" select="$element"/>
|
10546
|
+
</xsl:apply-templates>
|
10529
10547
|
</xsl:copy>
|
10530
10548
|
</xsl:template>
|
10531
10549
|
|
@@ -10592,7 +10610,10 @@
|
|
10592
10610
|
|
10593
10611
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
10594
10612
|
<xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
10595
|
-
<xsl:
|
10613
|
+
<xsl:param name="element"/>
|
10614
|
+
<xsl:apply-templates mode="contents_item">
|
10615
|
+
<xsl:with-param name="element" select="$element"/>
|
10616
|
+
</xsl:apply-templates>
|
10596
10617
|
</xsl:template>
|
10597
10618
|
|
10598
10619
|
<!-- =============== -->
|
@@ -13493,6 +13514,17 @@
|
|
13493
13514
|
<xsl:copy-of select="."/>
|
13494
13515
|
</xsl:template>
|
13495
13516
|
|
13517
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
13518
|
+
<xsl:copy>
|
13519
|
+
<xsl:copy-of select="@*"/>
|
13520
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
13521
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
13522
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
13523
|
+
<xsl:value-of select="."/>
|
13524
|
+
</xsl:if>
|
13525
|
+
</xsl:copy>
|
13526
|
+
</xsl:template>
|
13527
|
+
|
13496
13528
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
13497
13529
|
<xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
13498
13530
|
<xsl:copy>
|
@@ -14367,7 +14399,8 @@
|
|
14367
14399
|
</xsl:when>
|
14368
14400
|
<xsl:otherwise>
|
14369
14401
|
<!-- _{filename}_attachments -->
|
14370
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
14402
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
14403
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
14371
14404
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
|
14372
14405
|
</xsl:otherwise>
|
14373
14406
|
</xsl:choose>
|
@@ -8854,18 +8854,33 @@
|
|
8854
8854
|
|
8855
8855
|
<xsl:template match="*[local-name()='localityStack']"/>
|
8856
8856
|
|
8857
|
+
<xsl:variable name="pdfAttachmentsList_">
|
8858
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8859
|
+
<attachment filename="{@name}"/>
|
8860
|
+
</xsl:for-each>
|
8861
|
+
</xsl:variable>
|
8862
|
+
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8863
|
+
|
8857
8864
|
<xsl:template match="*[local-name()='link']" name="link">
|
8865
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
8866
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
8858
8867
|
<xsl:variable name="target">
|
8859
8868
|
<xsl:choose>
|
8860
8869
|
<xsl:when test="@updatetype = 'true'">
|
8861
8870
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8862
8871
|
</xsl:when>
|
8872
|
+
<!-- link to the PDF attachment -->
|
8873
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8874
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8875
|
+
</xsl:when>
|
8876
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
8877
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
8878
|
+
</xsl:when>
|
8863
8879
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
8864
|
-
<!-- link to the PDF attachment -->
|
8865
8880
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
8866
8881
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
8867
8882
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
8868
|
-
</xsl:when>
|
8883
|
+
</xsl:when> -->
|
8869
8884
|
<xsl:otherwise>
|
8870
8885
|
<xsl:value-of select="normalize-space(@target)"/>
|
8871
8886
|
</xsl:otherwise>
|
@@ -10524,8 +10539,11 @@
|
|
10524
10539
|
</xsl:template>
|
10525
10540
|
|
10526
10541
|
<xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
10542
|
+
<xsl:param name="element"/>
|
10527
10543
|
<xsl:copy>
|
10528
|
-
<xsl:apply-templates mode="contents_item"
|
10544
|
+
<xsl:apply-templates mode="contents_item">
|
10545
|
+
<xsl:with-param name="element" select="$element"/>
|
10546
|
+
</xsl:apply-templates>
|
10529
10547
|
</xsl:copy>
|
10530
10548
|
</xsl:template>
|
10531
10549
|
|
@@ -10592,7 +10610,10 @@
|
|
10592
10610
|
|
10593
10611
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
10594
10612
|
<xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
10595
|
-
<xsl:
|
10613
|
+
<xsl:param name="element"/>
|
10614
|
+
<xsl:apply-templates mode="contents_item">
|
10615
|
+
<xsl:with-param name="element" select="$element"/>
|
10616
|
+
</xsl:apply-templates>
|
10596
10617
|
</xsl:template>
|
10597
10618
|
|
10598
10619
|
<!-- =============== -->
|
@@ -13493,6 +13514,17 @@
|
|
13493
13514
|
<xsl:copy-of select="."/>
|
13494
13515
|
</xsl:template>
|
13495
13516
|
|
13517
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
13518
|
+
<xsl:copy>
|
13519
|
+
<xsl:copy-of select="@*"/>
|
13520
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
13521
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
13522
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
13523
|
+
<xsl:value-of select="."/>
|
13524
|
+
</xsl:if>
|
13525
|
+
</xsl:copy>
|
13526
|
+
</xsl:template>
|
13527
|
+
|
13496
13528
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
13497
13529
|
<xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
13498
13530
|
<xsl:copy>
|
@@ -14367,7 +14399,8 @@
|
|
14367
14399
|
</xsl:when>
|
14368
14400
|
<xsl:otherwise>
|
14369
14401
|
<!-- _{filename}_attachments -->
|
14370
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
14402
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
14403
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
14371
14404
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
|
14372
14405
|
</xsl:otherwise>
|
14373
14406
|
</xsl:choose>
|
@@ -8854,18 +8854,33 @@
|
|
8854
8854
|
|
8855
8855
|
<xsl:template match="*[local-name()='localityStack']"/>
|
8856
8856
|
|
8857
|
+
<xsl:variable name="pdfAttachmentsList_">
|
8858
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8859
|
+
<attachment filename="{@name}"/>
|
8860
|
+
</xsl:for-each>
|
8861
|
+
</xsl:variable>
|
8862
|
+
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8863
|
+
|
8857
8864
|
<xsl:template match="*[local-name()='link']" name="link">
|
8865
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
8866
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
8858
8867
|
<xsl:variable name="target">
|
8859
8868
|
<xsl:choose>
|
8860
8869
|
<xsl:when test="@updatetype = 'true'">
|
8861
8870
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8862
8871
|
</xsl:when>
|
8872
|
+
<!-- link to the PDF attachment -->
|
8873
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8874
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8875
|
+
</xsl:when>
|
8876
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
8877
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
8878
|
+
</xsl:when>
|
8863
8879
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
8864
|
-
<!-- link to the PDF attachment -->
|
8865
8880
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
8866
8881
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
8867
8882
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
8868
|
-
</xsl:when>
|
8883
|
+
</xsl:when> -->
|
8869
8884
|
<xsl:otherwise>
|
8870
8885
|
<xsl:value-of select="normalize-space(@target)"/>
|
8871
8886
|
</xsl:otherwise>
|
@@ -10524,8 +10539,11 @@
|
|
10524
10539
|
</xsl:template>
|
10525
10540
|
|
10526
10541
|
<xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
10542
|
+
<xsl:param name="element"/>
|
10527
10543
|
<xsl:copy>
|
10528
|
-
<xsl:apply-templates mode="contents_item"
|
10544
|
+
<xsl:apply-templates mode="contents_item">
|
10545
|
+
<xsl:with-param name="element" select="$element"/>
|
10546
|
+
</xsl:apply-templates>
|
10529
10547
|
</xsl:copy>
|
10530
10548
|
</xsl:template>
|
10531
10549
|
|
@@ -10592,7 +10610,10 @@
|
|
10592
10610
|
|
10593
10611
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
10594
10612
|
<xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
10595
|
-
<xsl:
|
10613
|
+
<xsl:param name="element"/>
|
10614
|
+
<xsl:apply-templates mode="contents_item">
|
10615
|
+
<xsl:with-param name="element" select="$element"/>
|
10616
|
+
</xsl:apply-templates>
|
10596
10617
|
</xsl:template>
|
10597
10618
|
|
10598
10619
|
<!-- =============== -->
|
@@ -13493,6 +13514,17 @@
|
|
13493
13514
|
<xsl:copy-of select="."/>
|
13494
13515
|
</xsl:template>
|
13495
13516
|
|
13517
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
13518
|
+
<xsl:copy>
|
13519
|
+
<xsl:copy-of select="@*"/>
|
13520
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
13521
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
13522
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
13523
|
+
<xsl:value-of select="."/>
|
13524
|
+
</xsl:if>
|
13525
|
+
</xsl:copy>
|
13526
|
+
</xsl:template>
|
13527
|
+
|
13496
13528
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
13497
13529
|
<xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
13498
13530
|
<xsl:copy>
|
@@ -14367,7 +14399,8 @@
|
|
14367
14399
|
</xsl:when>
|
14368
14400
|
<xsl:otherwise>
|
14369
14401
|
<!-- _{filename}_attachments -->
|
14370
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
14402
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
14403
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
14371
14404
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
|
14372
14405
|
</xsl:otherwise>
|
14373
14406
|
</xsl:choose>
|
@@ -8854,18 +8854,33 @@
|
|
8854
8854
|
|
8855
8855
|
<xsl:template match="*[local-name()='localityStack']"/>
|
8856
8856
|
|
8857
|
+
<xsl:variable name="pdfAttachmentsList_">
|
8858
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8859
|
+
<attachment filename="{@name}"/>
|
8860
|
+
</xsl:for-each>
|
8861
|
+
</xsl:variable>
|
8862
|
+
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8863
|
+
|
8857
8864
|
<xsl:template match="*[local-name()='link']" name="link">
|
8865
|
+
<xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
|
8866
|
+
<xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
|
8858
8867
|
<xsl:variable name="target">
|
8859
8868
|
<xsl:choose>
|
8860
8869
|
<xsl:when test="@updatetype = 'true'">
|
8861
8870
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8862
8871
|
</xsl:when>
|
8872
|
+
<!-- link to the PDF attachment -->
|
8873
|
+
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8874
|
+
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8875
|
+
</xsl:when>
|
8876
|
+
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
8877
|
+
<xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
|
8878
|
+
</xsl:when>
|
8863
8879
|
<xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
|
8864
|
-
<!-- link to the PDF attachment -->
|
8865
8880
|
<xsl:variable name="target_" select="translate(@target, '\', '/')"/>
|
8866
8881
|
<xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
|
8867
8882
|
<xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
|
8868
|
-
</xsl:when>
|
8883
|
+
</xsl:when> -->
|
8869
8884
|
<xsl:otherwise>
|
8870
8885
|
<xsl:value-of select="normalize-space(@target)"/>
|
8871
8886
|
</xsl:otherwise>
|
@@ -10524,8 +10539,11 @@
|
|
10524
10539
|
</xsl:template>
|
10525
10540
|
|
10526
10541
|
<xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
10542
|
+
<xsl:param name="element"/>
|
10527
10543
|
<xsl:copy>
|
10528
|
-
<xsl:apply-templates mode="contents_item"
|
10544
|
+
<xsl:apply-templates mode="contents_item">
|
10545
|
+
<xsl:with-param name="element" select="$element"/>
|
10546
|
+
</xsl:apply-templates>
|
10529
10547
|
</xsl:copy>
|
10530
10548
|
</xsl:template>
|
10531
10549
|
|
@@ -10592,7 +10610,10 @@
|
|
10592
10610
|
|
10593
10611
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
10594
10612
|
<xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
10595
|
-
<xsl:
|
10613
|
+
<xsl:param name="element"/>
|
10614
|
+
<xsl:apply-templates mode="contents_item">
|
10615
|
+
<xsl:with-param name="element" select="$element"/>
|
10616
|
+
</xsl:apply-templates>
|
10596
10617
|
</xsl:template>
|
10597
10618
|
|
10598
10619
|
<!-- =============== -->
|
@@ -13493,6 +13514,17 @@
|
|
13493
13514
|
<xsl:copy-of select="."/>
|
13494
13515
|
</xsl:template>
|
13495
13516
|
|
13517
|
+
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
13518
|
+
<xsl:copy>
|
13519
|
+
<xsl:copy-of select="@*"/>
|
13520
|
+
<xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
|
13521
|
+
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
|
13522
|
+
<xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
|
13523
|
+
<xsl:value-of select="."/>
|
13524
|
+
</xsl:if>
|
13525
|
+
</xsl:copy>
|
13526
|
+
</xsl:template>
|
13527
|
+
|
13496
13528
|
<!-- add @id, mandatory for table auto-layout algorithm -->
|
13497
13529
|
<xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
|
13498
13530
|
<xsl:copy>
|
@@ -14367,7 +14399,8 @@
|
|
14367
14399
|
</xsl:when>
|
14368
14400
|
<xsl:otherwise>
|
14369
14401
|
<!-- _{filename}_attachments -->
|
14370
|
-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
|
14402
|
+
<!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
|
14403
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
14371
14404
|
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
|
14372
14405
|
</xsl:otherwise>
|
14373
14406
|
</xsl:choose>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
-
<!-- VERSION v1.3.
|
20
|
+
<!-- VERSION v1.3.3 -->
|
21
21
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
22
22
|
<include href="reqt.rng"/>
|
23
23
|
<include href="basicdoc.rng">
|
@@ -331,9 +331,9 @@
|
|
331
331
|
<zeroOrMore>
|
332
332
|
<ref name="table-note"/>
|
333
333
|
</zeroOrMore>
|
334
|
-
<
|
334
|
+
<zeroOrMore>
|
335
335
|
<ref name="source"/>
|
336
|
-
</
|
336
|
+
</zeroOrMore>
|
337
337
|
</define>
|
338
338
|
<define name="FigureAttr">
|
339
339
|
<optional>
|
@@ -380,9 +380,9 @@
|
|
380
380
|
<zeroOrMore>
|
381
381
|
<ref name="note"/>
|
382
382
|
</zeroOrMore>
|
383
|
-
<
|
383
|
+
<zeroOrMore>
|
384
384
|
<ref name="source"/>
|
385
|
-
</
|
385
|
+
</zeroOrMore>
|
386
386
|
</define>
|
387
387
|
<define name="source">
|
388
388
|
<element name="source">
|
data/metanorma-itu.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-itu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.13
|
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-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-standoc
|
@@ -234,6 +234,20 @@ dependencies:
|
|
234
234
|
- - ">="
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: xml-c14n
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
237
251
|
description: 'Metanorma for the ITU.
|
238
252
|
|
239
253
|
'
|