metanorma-ieee 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -7077,6 +7077,7 @@
7077
7077
 
7078
7078
  <fo:block role="SKIP">
7079
7079
  <xsl:apply-templates/>
7080
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
7080
7081
  </fo:block>
7081
7082
  </fo:table-cell>
7082
7083
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -7140,6 +7141,8 @@
7140
7141
 
7141
7142
  <xsl:if test="$isGenerateTableIF = 'true'"> <fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
7142
7143
 
7144
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
7145
+
7143
7146
  </fo:block>
7144
7147
  </fo:table-cell>
7145
7148
  </xsl:template> <!-- td -->
@@ -9925,14 +9928,16 @@
9925
9928
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='link']" name="link">
9926
9929
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
9927
9930
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
9931
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
9928
9932
  <xsl:variable name="target">
9929
9933
  <xsl:choose>
9930
9934
  <xsl:when test="@updatetype = 'true'">
9931
9935
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
9932
9936
  </xsl:when>
9933
9937
  <!-- link to the PDF attachment -->
9934
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
9935
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
9938
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
9939
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
9940
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
9936
9941
  </xsl:when>
9937
9942
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
9938
9943
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -9963,6 +9968,11 @@
9963
9968
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
9964
9969
  </xsl:if>
9965
9970
 
9971
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
9972
+ <xsl:attribute name="color">inherit</xsl:attribute>
9973
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
9974
+ </xsl:if>
9975
+
9966
9976
  <xsl:call-template name="refine_link-style"/>
9967
9977
 
9968
9978
  <xsl:choose>
@@ -9973,6 +9983,9 @@
9973
9983
  <xsl:call-template name="insert_basic_link">
9974
9984
  <xsl:with-param name="element">
9975
9985
  <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
9986
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
9987
+ <xsl:attribute name="role">Annot</xsl:attribute>
9988
+ </xsl:if>
9976
9989
  <xsl:choose>
9977
9990
  <xsl:when test="normalize-space(.) = ''">
9978
9991
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -9985,6 +9998,10 @@
9985
9998
  </xsl:otherwise>
9986
9999
  </xsl:choose>
9987
10000
  </fo:basic-link>
10001
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10002
+ <!-- reserve space at right for PaperClip icon -->
10003
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
10004
+ </xsl:if>
9988
10005
  </xsl:with-param>
9989
10006
  </xsl:call-template>
9990
10007
  </xsl:otherwise>
@@ -15544,6 +15561,39 @@
15544
15561
  </pdf:catalog>
15545
15562
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
15546
15563
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
15564
+ <rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" rdf:about="">
15565
+ <pdfaExtension:schemas>
15566
+ <rdf:Bag>
15567
+ <rdf:li rdf:parseType="Resource">
15568
+ <pdfaSchema:namespaceURI>http://www.aiim.org/pdfua/ns/id/</pdfaSchema:namespaceURI>
15569
+ <pdfaSchema:prefix>pdfuaid</pdfaSchema:prefix>
15570
+ <pdfaSchema:schema>PDF/UA identification schema</pdfaSchema:schema>
15571
+ <pdfaSchema:property>
15572
+ <rdf:Seq>
15573
+ <rdf:li rdf:parseType="Resource">
15574
+ <pdfaProperty:category>internal</pdfaProperty:category>
15575
+ <pdfaProperty:description>PDF/UA version identifier</pdfaProperty:description>
15576
+ <pdfaProperty:name>part</pdfaProperty:name>
15577
+ <pdfaProperty:valueType>Integer</pdfaProperty:valueType>
15578
+ </rdf:li>
15579
+ <rdf:li rdf:parseType="Resource">
15580
+ <pdfaProperty:category>internal</pdfaProperty:category>
15581
+ <pdfaProperty:description>PDF/UA amendment identifier</pdfaProperty:description>
15582
+ <pdfaProperty:name>amd</pdfaProperty:name>
15583
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
15584
+ </rdf:li>
15585
+ <rdf:li rdf:parseType="Resource">
15586
+ <pdfaProperty:category>internal</pdfaProperty:category>
15587
+ <pdfaProperty:description>PDF/UA corrigenda identifier</pdfaProperty:description>
15588
+ <pdfaProperty:name>corr</pdfaProperty:name>
15589
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
15590
+ </rdf:li>
15591
+ </rdf:Seq>
15592
+ </pdfaSchema:property>
15593
+ </rdf:li>
15594
+ </rdf:Bag>
15595
+ </pdfaExtension:schemas>
15596
+ </rdf:Description>
15547
15597
  <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
15548
15598
  <!-- Dublin Core properties go here -->
15549
15599
  <dc:title>
@@ -15555,30 +15605,54 @@
15555
15605
 
15556
15606
  </xsl:for-each>
15557
15607
  </xsl:variable>
15558
- <xsl:choose>
15559
- <xsl:when test="normalize-space($title) != ''">
15560
- <xsl:value-of select="$title"/>
15561
- </xsl:when>
15562
- <xsl:otherwise>
15563
- <xsl:text> </xsl:text>
15564
- </xsl:otherwise>
15565
- </xsl:choose>
15608
+ <rdf:Alt>
15609
+ <rdf:li xml:lang="x-default">
15610
+ <xsl:choose>
15611
+ <xsl:when test="normalize-space($title) != ''">
15612
+ <xsl:value-of select="$title"/>
15613
+ </xsl:when>
15614
+ <xsl:otherwise>
15615
+ <xsl:text> </xsl:text>
15616
+ </xsl:otherwise>
15617
+ </xsl:choose>
15618
+ </rdf:li>
15619
+ </rdf:Alt>
15566
15620
  </dc:title>
15567
- <dc:creator>
15621
+ <xsl:variable name="dc_creator">
15568
15622
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
15569
15623
 
15570
- <xsl:value-of select="ieee:ext/ieee:editorialgroup/ieee:committee"/>
15624
+ <rdf:Seq>
15625
+ <rdf:li>
15626
+ <xsl:value-of select="ieee:ext/ieee:editorialgroup/ieee:committee"/>
15627
+ </rdf:li>
15628
+ </rdf:Seq>
15571
15629
 
15572
15630
  </xsl:for-each>
15573
- </dc:creator>
15574
- <dc:description>
15631
+ </xsl:variable>
15632
+ <xsl:if test="normalize-space($dc_creator) != ''">
15633
+ <dc:creator>
15634
+ <xsl:copy-of select="$dc_creator"/>
15635
+ </dc:creator>
15636
+ </xsl:if>
15637
+
15638
+ <xsl:variable name="dc_description">
15575
15639
  <xsl:variable name="abstract">
15576
15640
 
15577
15641
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
15578
15642
 
15579
15643
  </xsl:variable>
15580
- <xsl:value-of select="normalize-space($abstract)"/>
15581
- </dc:description>
15644
+ <rdf:Alt>
15645
+ <rdf:li xml:lang="x-default">
15646
+ <xsl:value-of select="normalize-space($abstract)"/>
15647
+ </rdf:li>
15648
+ </rdf:Alt>
15649
+ </xsl:variable>
15650
+ <xsl:if test="normalize-space($dc_description)">
15651
+ <dc:description>
15652
+ <xsl:copy-of select="$dc_description"/>
15653
+ </dc:description>
15654
+ </xsl:if>
15655
+
15582
15656
  <pdf:Keywords>
15583
15657
  <xsl:call-template name="insertKeywords">
15584
15658
  <xsl:with-param name="meta">true</xsl:with-param>
@@ -15593,9 +15667,14 @@
15593
15667
  </x:xmpmeta>
15594
15668
  <!-- add attachments -->
15595
15669
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
15596
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
15597
-
15598
- <pdf:embedded-file filename="{@name}">
15670
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
15671
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
15672
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
15673
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
15674
+ <!-- Todo: need update -->
15675
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
15676
+
15677
+ <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
15599
15678
  <xsl:attribute name="src">
15600
15679
  <xsl:choose>
15601
15680
  <xsl:when test="normalize-space() != ''">
@@ -15611,18 +15690,27 @@
15611
15690
  <xsl:if test="$description != ''">
15612
15691
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15613
15692
  </xsl:if>
15693
+ <xsl:if test="$afrelationship != ''">
15694
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15695
+ </xsl:if>
15614
15696
  </pdf:embedded-file>
15615
15697
  </xsl:for-each>
15616
15698
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
15617
15699
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
15618
15700
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
15619
15701
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
15702
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
15620
15703
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
15621
15704
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
15622
- <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
15705
+ <!-- Todo: need update -->
15706
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
15707
+ <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
15623
15708
  <xsl:if test="$description != ''">
15624
15709
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15625
15710
  </xsl:if>
15711
+ <xsl:if test="$afrelationship != ''">
15712
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15713
+ </xsl:if>
15626
15714
  </pdf:embedded-file>
15627
15715
  </xsl:for-each>
15628
15716
  </xsl:if>
@@ -15642,6 +15730,12 @@
15642
15730
  <!-- Get or calculate depth of the element -->
15643
15731
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="getLevel">
15644
15732
  <xsl:param name="depth"/>
15733
+ <!-- <xsl:message>
15734
+ <xsl:choose>
15735
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
15736
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
15737
+ </xsl:choose>
15738
+ </xsl:message> -->
15645
15739
  <xsl:choose>
15646
15740
  <xsl:when test="normalize-space(@depth) != ''">
15647
15741
  <xsl:value-of select="@depth"/>
@@ -15662,8 +15756,27 @@
15662
15756
  <xsl:when test="ancestor::*[local-name() = 'preface']">
15663
15757
  <xsl:value-of select="$level_total - 2"/>
15664
15758
  </xsl:when>
15759
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
15760
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
15761
+ <xsl:choose>
15762
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15763
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15764
+ </xsl:when>
15765
+ <xsl:otherwise>
15766
+ <xsl:value-of select="$level_total - 2"/>
15767
+ </xsl:otherwise>
15768
+ </xsl:choose>
15769
+ </xsl:when>
15665
15770
  <xsl:when test="ancestor::*[local-name() = 'sections']">
15666
- <xsl:value-of select="$level_total - 1"/>
15771
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
15772
+ <xsl:choose>
15773
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15774
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15775
+ </xsl:when>
15776
+ <xsl:otherwise>
15777
+ <xsl:value-of select="$level_total - 1"/>
15778
+ </xsl:otherwise>
15779
+ </xsl:choose>
15667
15780
  </xsl:when>
15668
15781
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
15669
15782
  <xsl:value-of select="$level_total - 1"/>
@@ -15671,6 +15784,17 @@
15671
15784
  <xsl:when test="parent::*[local-name() = 'annex']">
15672
15785
  <xsl:value-of select="$level_total - 1"/>
15673
15786
  </xsl:when>
15787
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
15788
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
15789
+ <xsl:choose>
15790
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15791
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15792
+ </xsl:when>
15793
+ <xsl:otherwise>
15794
+ <xsl:value-of select="$level_total - 1"/>
15795
+ </xsl:otherwise>
15796
+ </xsl:choose>
15797
+ </xsl:when>
15674
15798
  <xsl:when test="ancestor::*[local-name() = 'annex']">
15675
15799
  <xsl:value-of select="$level_total"/>
15676
15800
  </xsl:when>
@@ -16029,6 +16153,20 @@
16029
16153
 
16030
16154
  <!-- END: insert cover page image -->
16031
16155
 
16156
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertVerticalChar">
16157
+ <xsl:param name="str"/>
16158
+ <xsl:if test="string-length($str) &gt; 0">
16159
+ <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
16160
+ <fo:block-container width="1em">
16161
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
16162
+ </fo:block-container>
16163
+ </fo:inline-container>
16164
+ <xsl:call-template name="insertVerticalChar">
16165
+ <xsl:with-param name="str" select="substring($str, 2)"/>
16166
+ </xsl:call-template>
16167
+ </xsl:if>
16168
+ </xsl:template>
16169
+
16032
16170
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="number-to-words">
16033
16171
  <xsl:param name="number"/>
16034
16172
  <xsl:param name="first"/>
@@ -16316,4 +16454,18 @@
16316
16454
  </xsl:if>
16317
16455
  </xsl:template>
16318
16456
 
16457
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="@*|node()" mode="set_table_role_skip">
16458
+ <xsl:copy>
16459
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
16460
+ </xsl:copy>
16461
+ </xsl:template>
16462
+
16463
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
16464
+ <xsl:copy>
16465
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
16466
+ <xsl:attribute name="role">SKIP</xsl:attribute>
16467
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
16468
+ </xsl:copy>
16469
+ </xsl:template>
16470
+
16319
16471
  </xsl:stylesheet>