metanorma-ieee 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html2doc/ieee/lists.rb +1 -1
  3. data/lib/html2doc/ieee/notes.rb +1 -1
  4. data/lib/html2doc/ieee.rb +1 -1
  5. data/lib/html2doc/ieee_wp/lists.rb +1 -1
  6. data/lib/html2doc/ieee_wp.rb +1 -1
  7. data/lib/isodoc/ieee/base_convert.rb +1 -1
  8. data/lib/isodoc/ieee/html/htmlstyle.css +4 -1
  9. data/lib/isodoc/ieee/html_convert.rb +1 -1
  10. data/lib/isodoc/ieee/i18n.rb +1 -1
  11. data/lib/isodoc/ieee/ieee.amendment.xsl +250 -35
  12. data/lib/isodoc/ieee/ieee.rb +1 -1
  13. data/lib/isodoc/ieee/ieee.standard.xsl +250 -35
  14. data/lib/isodoc/ieee/ieee_xml_convert.rb +2 -2
  15. data/lib/isodoc/ieee/init.rb +2 -2
  16. data/lib/isodoc/ieee/metadata.rb +1 -1
  17. data/lib/isodoc/ieee/pdf_convert.rb +1 -1
  18. data/lib/isodoc/ieee/presentation_bibdata.rb +1 -1
  19. data/lib/isodoc/ieee/presentation_ref.rb +7 -8
  20. data/lib/isodoc/ieee/presentation_terms.rb +1 -1
  21. data/lib/isodoc/ieee/presentation_xml_convert.rb +1 -1
  22. data/lib/isodoc/ieee/word_authority.rb +1 -1
  23. data/lib/isodoc/ieee/word_cleanup.rb +2 -2
  24. data/lib/isodoc/ieee/word_cleanup_blocks.rb +1 -1
  25. data/lib/isodoc/ieee/word_convert.rb +2 -2
  26. data/lib/isodoc/ieee/word_wp_cleanup.rb +2 -2
  27. data/lib/isodoc/ieee/word_wp_convert.rb +1 -1
  28. data/lib/isodoc/ieee/xref.rb +1 -1
  29. data/lib/isodoc/ieee.rb +1 -1
  30. data/lib/metanorma/ieee/basicdoc.rng +861 -481
  31. data/lib/metanorma/ieee/biblio-standoc.rng +100 -20
  32. data/lib/metanorma/ieee/biblio.rng +897 -333
  33. data/lib/metanorma/ieee/cleanup.rb +2 -2
  34. data/lib/metanorma/ieee/cleanup_ref.rb +2 -2
  35. data/lib/metanorma/ieee/converter.rb +7 -7
  36. data/lib/metanorma/ieee/front.rb +1 -1
  37. data/lib/metanorma/ieee/isodoc.rng +1031 -915
  38. data/lib/metanorma/ieee/processor.rb +7 -7
  39. data/lib/metanorma/ieee/relaton-ieee.rng +1 -0
  40. data/lib/metanorma/ieee/reqt.rng +94 -75
  41. data/lib/metanorma/ieee/term_lookup_cleanup.rb +1 -1
  42. data/lib/metanorma/ieee/validate.rb +4 -4
  43. data/lib/metanorma/ieee/validate_section.rb +1 -1
  44. data/lib/metanorma/ieee/validate_style.rb +1 -1
  45. data/lib/metanorma/ieee/version.rb +2 -2
  46. data/lib/metanorma/ieee.rb +1 -1
  47. data/lib/metanorma-ieee.rb +1 -1
  48. data/lib/relaton/render/general.rb +2 -2
  49. data/lib/relaton/render/parse.rb +1 -1
  50. data/metanorma-ieee.gemspec +1 -1
  51. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c6adb65ed8dea242f73b743cae78c43301ea9f41ede9edcc1a898c1bf1a1dba
4
- data.tar.gz: 460603f84d06832a18d7585ba16c2d1c2b641aec0b0349411c5328a1cdfeaf84
3
+ metadata.gz: f5d00bba7b688dd38ac44ed5a74c0d6af83224657024a81246f9039e8097403f
4
+ data.tar.gz: 1c05945009cf1c549c95d300e0699cb88f344dfab9b6c50ebe3cec1a0f6524dc
5
5
  SHA512:
6
- metadata.gz: 320ae7c8543ae7e604b98bd5ef01e0ca8b960994c1bf34976d33ee276cfc69c90a440fe2c0f997c86d705d87d879968d7293a3cdd4cce6e0fbdc941fcf79db0b
7
- data.tar.gz: 91b7d28f569d0e456f281e6ac01f1b91384c46019325c0776648364002a1c9b26510e69115e0b9a8181ff709d911762260d38fd0d1ebeee423813105bee45609
6
+ metadata.gz: 7d9b2f5e89208ab1dda473cacafda7598f4607be2b634a226a511db6346b69bf258fee280de0c861be07529b16c2a6ef27718f6a947abdc3c63d09cecb34881d
7
+ data.tar.gz: e3df0c93fbe8c325281b29dc378d0b396a7681f789de91315fec689794e40981ee6d1c1e9a21c4b30c545f6f3e0debcea695168dc83230725fbb8b187e41f7a2
@@ -1,5 +1,5 @@
1
1
  class Html2Doc
2
- class IEEE < ::Html2Doc
2
+ class Ieee < ::Html2Doc
3
3
  def style_list(elem, level, liststyle, listnumber)
4
4
  return unless liststyle
5
5
 
@@ -1,5 +1,5 @@
1
1
  class Html2Doc
2
- class IEEE < ::Html2Doc
2
+ class Ieee < ::Html2Doc
3
3
  def process_footnote_texts(docxml, footnotes)
4
4
  body = docxml.at("//body")
5
5
  list = body.add_child("<div style='mso-element:footnote-list'/>")
data/lib/html2doc/ieee.rb CHANGED
@@ -2,6 +2,6 @@ require "html2doc/ieee/notes"
2
2
  require "html2doc/ieee/lists"
3
3
 
4
4
  class Html2Doc
5
- class IEEE
5
+ class Ieee
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  class Html2Doc
2
- class IEEE_WP < ::Html2Doc
2
+ class Ieee_Wp < ::Html2Doc
3
3
  def list2para(list)
4
4
  list.name == "ol" and return super
5
5
  return if list.xpath("./li").empty?
@@ -1,6 +1,6 @@
1
1
  require "html2doc/ieee_wp/lists"
2
2
 
3
3
  class Html2Doc
4
- class IEEE_WP
4
+ class Ieee_Wp
5
5
  end
6
6
  end
@@ -2,7 +2,7 @@ require "isodoc"
2
2
  require "fileutils"
3
3
 
4
4
  module IsoDoc
5
- module IEEE
5
+ module Ieee
6
6
  module BaseConvert
7
7
  def clause_attrs(node)
8
8
  { id: node["id"], type: node["type"] }
@@ -82,6 +82,9 @@ p kbd, dt kbd, li kbd, label kbd, legend kbd, caption kbd, th kbd, td kbd,
82
82
  p samp, dt samp, li samp, label samp, legend samp, caption samp, th samp, td samp {
83
83
  font-size: {{monospacefontsize}}; }
84
84
 
85
+ sub, sup {
86
+ font-size: 0.75em; }
87
+
85
88
  article, aside, details, figcaption, figure,
86
89
  footer, header, hgroup, menu, nav, section {
87
90
  display: block; }
@@ -239,7 +242,7 @@ h6:hover > a.anchor,
239
242
  background-color: #777;
240
243
  color: white;
241
244
  cursor: pointer;
242
- padding: 12px 0;
245
+ padding: 3px 0;
243
246
  margin: 0;
244
247
  width: 100%;
245
248
  border: none;
@@ -2,7 +2,7 @@ require "isodoc"
2
2
  require_relative "init"
3
3
 
4
4
  module IsoDoc
5
- module IEEE
5
+ module Ieee
6
6
  class HtmlConvert < IsoDoc::HtmlConvert
7
7
  def initialize(options)
8
8
  @libdir = File.dirname(__FILE__)
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module IEEE
2
+ module Ieee
3
3
  class I18n < IsoDoc::I18n
4
4
  def load_file(fname)
5
5
  f = File.join(File.dirname(__FILE__), fname)
@@ -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 -->
@@ -7211,7 +7214,8 @@
7211
7214
  </xsl:choose>
7212
7215
  </xsl:variable>
7213
7216
  <xsl:variable name="current_fn_number_text">
7214
- <xsl:value-of select="$current_fn_number"/>
7217
+
7218
+ <xsl:value-of select="$current_fn_number"/>
7215
7219
 
7216
7220
  </xsl:variable>
7217
7221
 
@@ -7247,8 +7251,10 @@
7247
7251
 
7248
7252
  <xsl:call-template name="insert_basic_link">
7249
7253
  <xsl:with-param name="element">
7250
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
7251
- <xsl:copy-of select="$current_fn_number_text"/>
7254
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
7255
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
7256
+ <xsl:copy-of select="$current_fn_number_text"/>
7257
+ </fo:inline>
7252
7258
  </fo:basic-link>
7253
7259
  </xsl:with-param>
7254
7260
  </xsl:call-template>
@@ -7529,7 +7535,7 @@
7529
7535
 
7530
7536
  <xsl:call-template name="refine_fn-reference-style"/>
7531
7537
 
7532
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
7538
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
7533
7539
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
7534
7540
  <xsl:attribute name="internal-destination">
7535
7541
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -8527,9 +8533,19 @@
8527
8533
  </fo:inline>
8528
8534
  </xsl:template>
8529
8535
 
8530
- <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="text()[ancestor::*[local-name()='smallcap']]">
8536
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
8537
+ <xsl:param name="txt"/>
8531
8538
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
8532
- <xsl:variable name="text" select="."/>
8539
+ <xsl:variable name="text">
8540
+ <xsl:choose>
8541
+ <xsl:when test="$txt != ''">
8542
+ <xsl:value-of select="$txt"/>
8543
+ </xsl:when>
8544
+ <xsl:otherwise>
8545
+ <xsl:value-of select="."/>
8546
+ </xsl:otherwise>
8547
+ </xsl:choose>
8548
+ </xsl:variable>
8533
8549
  <xsl:variable name="ratio_">
8534
8550
  0.75
8535
8551
  </xsl:variable>
@@ -9925,14 +9941,16 @@
9925
9941
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='link']" name="link">
9926
9942
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
9927
9943
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
9944
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
9928
9945
  <xsl:variable name="target">
9929
9946
  <xsl:choose>
9930
9947
  <xsl:when test="@updatetype = 'true'">
9931
9948
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
9932
9949
  </xsl:when>
9933
9950
  <!-- 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, ')')"/>
9951
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
9952
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
9953
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
9936
9954
  </xsl:when>
9937
9955
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
9938
9956
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -9963,6 +9981,11 @@
9963
9981
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
9964
9982
  </xsl:if>
9965
9983
 
9984
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
9985
+ <xsl:attribute name="color">inherit</xsl:attribute>
9986
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
9987
+ </xsl:if>
9988
+
9966
9989
  <xsl:call-template name="refine_link-style"/>
9967
9990
 
9968
9991
  <xsl:choose>
@@ -9970,9 +9993,15 @@
9970
9993
  <xsl:apply-templates/>
9971
9994
  </xsl:when>
9972
9995
  <xsl:otherwise>
9996
+ <xsl:variable name="alt_text">
9997
+ <xsl:call-template name="getAltText"/>
9998
+ </xsl:variable>
9973
9999
  <xsl:call-template name="insert_basic_link">
9974
10000
  <xsl:with-param name="element">
9975
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
10001
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
10002
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10003
+ <xsl:attribute name="role">Annot</xsl:attribute>
10004
+ </xsl:if>
9976
10005
  <xsl:choose>
9977
10006
  <xsl:when test="normalize-space(.) = ''">
9978
10007
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -9985,6 +10014,10 @@
9985
10014
  </xsl:otherwise>
9986
10015
  </xsl:choose>
9987
10016
  </fo:basic-link>
10017
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10018
+ <!-- reserve space at right for PaperClip icon -->
10019
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
10020
+ </xsl:if>
9988
10021
  </xsl:with-param>
9989
10022
  </xsl:call-template>
9990
10023
  </xsl:otherwise>
@@ -9992,6 +10025,14 @@
9992
10025
  </fo:inline>
9993
10026
  </xsl:template> <!-- link -->
9994
10027
 
10028
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="getAltText">
10029
+ <xsl:choose>
10030
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
10031
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
10032
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
10033
+ </xsl:choose>
10034
+ </xsl:template>
10035
+
9995
10036
  <!-- ======================== -->
9996
10037
  <!-- Appendix processing -->
9997
10038
  <!-- ======================== -->
@@ -10022,7 +10063,7 @@
10022
10063
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'callout']">
10023
10064
  <xsl:choose>
10024
10065
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
10025
- <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
10066
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
10026
10067
  </xsl:choose>
10027
10068
  </xsl:template>
10028
10069
 
@@ -10051,7 +10092,10 @@
10051
10092
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'xref']">
10052
10093
  <xsl:call-template name="insert_basic_link">
10053
10094
  <xsl:with-param name="element">
10054
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
10095
+ <xsl:variable name="alt_text">
10096
+ <xsl:call-template name="getAltText"/>
10097
+ </xsl:variable>
10098
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
10055
10099
  <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
10056
10100
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
10057
10101
  </xsl:if>
@@ -12537,12 +12581,14 @@
12537
12581
 
12538
12582
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
12539
12583
 
12540
- <xsl:variable name="provisional_distance_between_starts">
12584
+ <xsl:variable name="provisional_distance_between_starts_">
12541
12585
  7
12542
12586
  </xsl:variable>
12543
- <xsl:variable name="indent">
12587
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
12588
+ <xsl:variable name="indent_">
12544
12589
  0
12545
12590
  </xsl:variable>
12591
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
12546
12592
 
12547
12593
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
12548
12594
  <fo:list-item>
@@ -13267,14 +13313,17 @@
13267
13313
  </xsl:when>
13268
13314
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
13269
13315
 
13270
- <xsl:variable name="label">
13316
+ <xsl:variable name="type" select="../@type"/>
13271
13317
 
13272
- <xsl:variable name="type" select="../@type"/>
13318
+ <xsl:variable name="label">
13273
13319
 
13274
13320
  <xsl:variable name="style_prefix_">
13275
13321
  <xsl:if test="$type = 'roman'">
13276
13322
  <!-- Example: (i) -->
13277
13323
  </xsl:if>
13324
+ <xsl:if test="$type = 'alphabet'">
13325
+
13326
+ </xsl:if>
13278
13327
  </xsl:variable>
13279
13328
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
13280
13329
 
@@ -13300,13 +13349,15 @@
13300
13349
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
13301
13350
  <xsl:value-of select="$style_prefix"/>
13302
13351
  </xsl:if>
13352
+
13303
13353
  <xsl:value-of select="@label"/>
13354
+
13304
13355
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
13305
13356
  <xsl:value-of select="$style_suffix"/>
13306
13357
  </xsl:if>
13307
13358
  </xsl:variable>
13308
13359
 
13309
- <xsl:value-of select="normalize-space($label)"/>
13360
+ <xsl:value-of select="normalize-space($label)"/>
13310
13361
 
13311
13362
  </xsl:when>
13312
13363
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -15544,6 +15595,39 @@
15544
15595
  </pdf:catalog>
15545
15596
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
15546
15597
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
15598
+ <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="">
15599
+ <pdfaExtension:schemas>
15600
+ <rdf:Bag>
15601
+ <rdf:li rdf:parseType="Resource">
15602
+ <pdfaSchema:namespaceURI>http://www.aiim.org/pdfua/ns/id/</pdfaSchema:namespaceURI>
15603
+ <pdfaSchema:prefix>pdfuaid</pdfaSchema:prefix>
15604
+ <pdfaSchema:schema>PDF/UA identification schema</pdfaSchema:schema>
15605
+ <pdfaSchema:property>
15606
+ <rdf:Seq>
15607
+ <rdf:li rdf:parseType="Resource">
15608
+ <pdfaProperty:category>internal</pdfaProperty:category>
15609
+ <pdfaProperty:description>PDF/UA version identifier</pdfaProperty:description>
15610
+ <pdfaProperty:name>part</pdfaProperty:name>
15611
+ <pdfaProperty:valueType>Integer</pdfaProperty:valueType>
15612
+ </rdf:li>
15613
+ <rdf:li rdf:parseType="Resource">
15614
+ <pdfaProperty:category>internal</pdfaProperty:category>
15615
+ <pdfaProperty:description>PDF/UA amendment identifier</pdfaProperty:description>
15616
+ <pdfaProperty:name>amd</pdfaProperty:name>
15617
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
15618
+ </rdf:li>
15619
+ <rdf:li rdf:parseType="Resource">
15620
+ <pdfaProperty:category>internal</pdfaProperty:category>
15621
+ <pdfaProperty:description>PDF/UA corrigenda identifier</pdfaProperty:description>
15622
+ <pdfaProperty:name>corr</pdfaProperty:name>
15623
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
15624
+ </rdf:li>
15625
+ </rdf:Seq>
15626
+ </pdfaSchema:property>
15627
+ </rdf:li>
15628
+ </rdf:Bag>
15629
+ </pdfaExtension:schemas>
15630
+ </rdf:Description>
15547
15631
  <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
15548
15632
  <!-- Dublin Core properties go here -->
15549
15633
  <dc:title>
@@ -15555,30 +15639,54 @@
15555
15639
 
15556
15640
  </xsl:for-each>
15557
15641
  </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>
15642
+ <rdf:Alt>
15643
+ <rdf:li xml:lang="x-default">
15644
+ <xsl:choose>
15645
+ <xsl:when test="normalize-space($title) != ''">
15646
+ <xsl:value-of select="$title"/>
15647
+ </xsl:when>
15648
+ <xsl:otherwise>
15649
+ <xsl:text> </xsl:text>
15650
+ </xsl:otherwise>
15651
+ </xsl:choose>
15652
+ </rdf:li>
15653
+ </rdf:Alt>
15566
15654
  </dc:title>
15567
- <dc:creator>
15655
+ <xsl:variable name="dc_creator">
15568
15656
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
15569
15657
 
15570
- <xsl:value-of select="ieee:ext/ieee:editorialgroup/ieee:committee"/>
15658
+ <rdf:Seq>
15659
+ <rdf:li>
15660
+ <xsl:value-of select="ieee:ext/ieee:editorialgroup/ieee:committee"/>
15661
+ </rdf:li>
15662
+ </rdf:Seq>
15571
15663
 
15572
15664
  </xsl:for-each>
15573
- </dc:creator>
15574
- <dc:description>
15665
+ </xsl:variable>
15666
+ <xsl:if test="normalize-space($dc_creator) != ''">
15667
+ <dc:creator>
15668
+ <xsl:copy-of select="$dc_creator"/>
15669
+ </dc:creator>
15670
+ </xsl:if>
15671
+
15672
+ <xsl:variable name="dc_description">
15575
15673
  <xsl:variable name="abstract">
15576
15674
 
15577
15675
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
15578
15676
 
15579
15677
  </xsl:variable>
15580
- <xsl:value-of select="normalize-space($abstract)"/>
15581
- </dc:description>
15678
+ <rdf:Alt>
15679
+ <rdf:li xml:lang="x-default">
15680
+ <xsl:value-of select="normalize-space($abstract)"/>
15681
+ </rdf:li>
15682
+ </rdf:Alt>
15683
+ </xsl:variable>
15684
+ <xsl:if test="normalize-space($dc_description)">
15685
+ <dc:description>
15686
+ <xsl:copy-of select="$dc_description"/>
15687
+ </dc:description>
15688
+ </xsl:if>
15689
+
15582
15690
  <pdf:Keywords>
15583
15691
  <xsl:call-template name="insertKeywords">
15584
15692
  <xsl:with-param name="meta">true</xsl:with-param>
@@ -15593,9 +15701,15 @@
15593
15701
  </x:xmpmeta>
15594
15702
  <!-- add attachments -->
15595
15703
  <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}">
15704
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
15705
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
15706
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
15707
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
15708
+ <!-- Todo: need update -->
15709
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
15710
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
15711
+
15712
+ <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
15599
15713
  <xsl:attribute name="src">
15600
15714
  <xsl:choose>
15601
15715
  <xsl:when test="normalize-space() != ''">
@@ -15611,18 +15725,34 @@
15611
15725
  <xsl:if test="$description != ''">
15612
15726
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15613
15727
  </xsl:if>
15728
+ <xsl:if test="$afrelationship != ''">
15729
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15730
+ </xsl:if>
15731
+ <xsl:if test="$volatile != ''">
15732
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
15733
+ </xsl:if>
15614
15734
  </pdf:embedded-file>
15615
15735
  </xsl:for-each>
15616
15736
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
15617
15737
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
15618
15738
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
15619
15739
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
15740
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
15620
15741
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
15621
15742
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
15622
- <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
15743
+ <!-- Todo: need update -->
15744
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
15745
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
15746
+ <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
15623
15747
  <xsl:if test="$description != ''">
15624
15748
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15625
15749
  </xsl:if>
15750
+ <xsl:if test="$afrelationship != ''">
15751
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15752
+ </xsl:if>
15753
+ <xsl:if test="$volatile != ''">
15754
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
15755
+ </xsl:if>
15626
15756
  </pdf:embedded-file>
15627
15757
  </xsl:for-each>
15628
15758
  </xsl:if>
@@ -15642,6 +15772,12 @@
15642
15772
  <!-- Get or calculate depth of the element -->
15643
15773
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="getLevel">
15644
15774
  <xsl:param name="depth"/>
15775
+ <!-- <xsl:message>
15776
+ <xsl:choose>
15777
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
15778
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
15779
+ </xsl:choose>
15780
+ </xsl:message> -->
15645
15781
  <xsl:choose>
15646
15782
  <xsl:when test="normalize-space(@depth) != ''">
15647
15783
  <xsl:value-of select="@depth"/>
@@ -15662,8 +15798,48 @@
15662
15798
  <xsl:when test="ancestor::*[local-name() = 'preface']">
15663
15799
  <xsl:value-of select="$level_total - 2"/>
15664
15800
  </xsl:when>
15801
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
15802
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
15803
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
15804
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
15805
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
15806
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
15807
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
15808
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
15809
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
15810
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
15811
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
15812
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
15813
+ <xsl:choose>
15814
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
15815
+ <xsl:value-of select="number($curr_clause_depth)"/>
15816
+ </xsl:when>
15817
+ <xsl:otherwise>
15818
+ <xsl:value-of select="$level_total - 2"/>
15819
+ </xsl:otherwise>
15820
+ </xsl:choose>
15821
+ </xsl:when>
15822
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
15823
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
15824
+ <xsl:choose>
15825
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
15826
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
15827
+ </xsl:when>
15828
+ <xsl:otherwise>
15829
+ <xsl:value-of select="$level_total - 2"/>
15830
+ </xsl:otherwise>
15831
+ </xsl:choose>
15832
+ </xsl:when>
15665
15833
  <xsl:when test="ancestor::*[local-name() = 'sections']">
15666
- <xsl:value-of select="$level_total - 1"/>
15834
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
15835
+ <xsl:choose>
15836
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15837
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15838
+ </xsl:when>
15839
+ <xsl:otherwise>
15840
+ <xsl:value-of select="$level_total - 1"/>
15841
+ </xsl:otherwise>
15842
+ </xsl:choose>
15667
15843
  </xsl:when>
15668
15844
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
15669
15845
  <xsl:value-of select="$level_total - 1"/>
@@ -15671,6 +15847,17 @@
15671
15847
  <xsl:when test="parent::*[local-name() = 'annex']">
15672
15848
  <xsl:value-of select="$level_total - 1"/>
15673
15849
  </xsl:when>
15850
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
15851
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
15852
+ <xsl:choose>
15853
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15854
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15855
+ </xsl:when>
15856
+ <xsl:otherwise>
15857
+ <xsl:value-of select="$level_total - 1"/>
15858
+ </xsl:otherwise>
15859
+ </xsl:choose>
15860
+ </xsl:when>
15674
15861
  <xsl:when test="ancestor::*[local-name() = 'annex']">
15675
15862
  <xsl:value-of select="$level_total"/>
15676
15863
  </xsl:when>
@@ -16029,6 +16216,20 @@
16029
16216
 
16030
16217
  <!-- END: insert cover page image -->
16031
16218
 
16219
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertVerticalChar">
16220
+ <xsl:param name="str"/>
16221
+ <xsl:if test="string-length($str) &gt; 0">
16222
+ <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">
16223
+ <fo:block-container width="1em">
16224
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
16225
+ </fo:block-container>
16226
+ </fo:inline-container>
16227
+ <xsl:call-template name="insertVerticalChar">
16228
+ <xsl:with-param name="str" select="substring($str, 2)"/>
16229
+ </xsl:call-template>
16230
+ </xsl:if>
16231
+ </xsl:template>
16232
+
16032
16233
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="number-to-words">
16033
16234
  <xsl:param name="number"/>
16034
16235
  <xsl:param name="first"/>
@@ -16316,4 +16517,18 @@
16316
16517
  </xsl:if>
16317
16518
  </xsl:template>
16318
16519
 
16520
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="@*|node()" mode="set_table_role_skip">
16521
+ <xsl:copy>
16522
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
16523
+ </xsl:copy>
16524
+ </xsl:template>
16525
+
16526
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
16527
+ <xsl:copy>
16528
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
16529
+ <xsl:attribute name="role">SKIP</xsl:attribute>
16530
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
16531
+ </xsl:copy>
16532
+ </xsl:template>
16533
+
16319
16534
  </xsl:stylesheet>
@@ -6,6 +6,6 @@ require "isodoc/ieee/word_convert"
6
6
  require "isodoc/ieee/presentation_xml_convert"
7
7
 
8
8
  module IsoDoc
9
- module IEEE
9
+ module Ieee
10
10
  end
11
11
  end