metanorma-ogc 1.2.15 → 1.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 285b68cc10ee7e8a0dd8e0da053492cb8f44b0b95289bc448351cf9ae41a3689
4
- data.tar.gz: 2b1cc87f38fbd6f0a201fb138596f92b820a0843a7b597307dfca3349398ccf9
3
+ metadata.gz: 816ca1ce2154ba61cd550a0b550929268b5afffc1e0169bad4e068826213f1b2
4
+ data.tar.gz: 67d972963e5c5e9e5451ed5de9f16f5bc7ee25954c4db4e5c9773d090dad9b72
5
5
  SHA512:
6
- metadata.gz: f1f9ec31debf56377ab244cf66b7e429bdc1fa001a0806c9f1728e257f8d87fee82d09634f05d1901f753155f1e373afd08d2bf16a28232b5aa8eb8ae03760ba
7
- data.tar.gz: dd1ab33656829020e418e3e2c9d55418313499f53e33d6aed0c8b793bdf161e33e849329c010d2badf428266afa96cc18dddc66af206df929773c9b3f154a855
6
+ metadata.gz: 5e1cbd0845909917b8b160abba46bec7ea9b86bc1b32277df618a97034824fd59e4122e1e95734c8b416307ddc148e328897ba0ff803ed259fe0ac0930347f81
7
+ data.tar.gz: 867108d5fb51c724b538929614bcbce7ef9f10416a9c97a70273a995d6e046b8fd3f2f9dbeaecea273699bf402ac68ca0427ec07d4ee0993e96208551a50f9f6
@@ -4,7 +4,7 @@ name: rake
4
4
 
5
5
  on:
6
6
  push:
7
- branches: [ master, main ]
7
+ branches: [ master, main ]
8
8
  tags: [ v* ]
9
9
  pull_request:
10
10
 
@@ -16,50 +16,27 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.6', '2.5', '2.4' ]
19
+ ruby: [ '2.7', '2.6', '2.5', '2.4' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
22
  include:
23
- - ruby: '2.7'
23
+ - ruby: '3.0'
24
24
  os: 'ubuntu-latest'
25
25
  experimental: true
26
- - ruby: '2.7'
26
+ - ruby: '3.0'
27
27
  os: 'windows-latest'
28
28
  experimental: true
29
- - ruby: '2.7'
29
+ - ruby: '3.0'
30
30
  os: 'macos-latest'
31
31
  experimental: true
32
32
  steps:
33
- - uses: actions/checkout@master
33
+ - uses: actions/checkout@v2
34
+ with:
35
+ submodules: true
34
36
 
35
37
  - uses: ruby/setup-ruby@v1
36
38
  with:
37
39
  ruby-version: ${{ matrix.ruby }}
38
-
39
- - if: matrix.os == 'macos-latest'
40
- run: brew install autoconf automake libtool
41
-
42
- - uses: actions/cache@v2
43
- with:
44
- path: vendor/bundle
45
- key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
46
- restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
47
-
48
- - run: bundle config set path 'vendor/bundle'
49
-
50
- - run: bundle install --jobs 4 --retry 3
40
+ bundler-cache: true
51
41
 
52
42
  - run: bundle exec rake
53
-
54
- tests-passed:
55
- needs: rake
56
- runs-on: ubuntu-latest
57
- steps:
58
- - name: Trigger tests passed event
59
- uses: Sibz/github-status-action@v1
60
- with:
61
- authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
62
- context: 'tests-passed-successfully'
63
- description: 'Tests passed successfully'
64
- state: 'success'
65
- sha: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -55,18 +55,14 @@ module Asciidoctor
55
55
  def outputs(node, ret)
56
56
  File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
57
57
  presentation_xml_converter(node).convert(@filename + ".xml")
58
- html_converter(node).convert(@filename + ".presentation.xml",
59
- nil, false, "#{@filename}.html")
60
- doc_converter(node).convert(@filename + ".presentation.xml",
61
- nil, false, "#{@filename}.doc")
62
- pdf_converter(node)&.convert(@filename + ".presentation.xml",
63
- nil, false, "#{@filename}.pdf")
58
+ html_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.html")
59
+ doc_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.doc")
60
+ pdf_converter(node)&.convert(@filename + ".presentation.xml", nil, false, "#{@filename}.pdf")
64
61
  end
65
62
 
66
63
  def validate(doc)
67
64
  content_validate(doc)
68
- schema_validate(formattedstr_strip(doc.dup),
69
- File.join(File.dirname(__FILE__), "ogc.rng"))
65
+ schema_validate(formattedstr_strip(doc.dup), File.join(File.dirname(__FILE__), "ogc.rng"))
70
66
  end
71
67
 
72
68
  def sections_cleanup(x)
@@ -132,8 +128,11 @@ module Asciidoctor
132
128
  def bibdata_cleanup(xmldoc)
133
129
  super
134
130
  a = xmldoc.at("//bibdata/status/stage")
135
- a.text == "published" and
136
- a.children = "approved"
131
+ a.text == "published" and a.children = "approved"
132
+ end
133
+
134
+ def highlight_parse(text, xml)
135
+ xml.hi { |s| s << text }
137
136
  end
138
137
 
139
138
  def presentation_xml_converter(node)
@@ -102,7 +102,7 @@
102
102
  </attribute>
103
103
  </optional>
104
104
  <oneOrMore>
105
- <ref name="li"/>
105
+ <ref name="ul_li"/>
106
106
  </oneOrMore>
107
107
  <zeroOrMore>
108
108
  <ref name="note"/>
@@ -1716,4 +1716,26 @@
1716
1716
  </zeroOrMore>
1717
1717
  </element>
1718
1718
  </define>
1719
+ <define name="ul_li">
1720
+ <element name="li">
1721
+ <optional>
1722
+ <attribute name="id">
1723
+ <data type="ID"/>
1724
+ </attribute>
1725
+ </optional>
1726
+ <optional>
1727
+ <attribute name="uncheckedcheckbox">
1728
+ <data type="boolean"/>
1729
+ </attribute>
1730
+ </optional>
1731
+ <optional>
1732
+ <attribute name="checkedcheckbox">
1733
+ <data type="boolean"/>
1734
+ </attribute>
1735
+ </optional>
1736
+ <oneOrMore>
1737
+ <ref name="BasicBlock"/>
1738
+ </oneOrMore>
1739
+ </element>
1740
+ </define>
1719
1741
  </grammar>
@@ -63,6 +63,22 @@
63
63
  </element>
64
64
  </define>
65
65
  </include>
66
+ <define name="TextElement" combine="choice">
67
+ <ref name="hi"/>
68
+ </define>
69
+ <define name="PureTextElement" combine="choice">
70
+ <ref name="hi"/>
71
+ </define>
72
+ <define name="hi">
73
+ <element name="hi">
74
+ <zeroOrMore>
75
+ <choice>
76
+ <ref name="PureTextElement"/>
77
+ <ref name="stem"/>
78
+ </choice>
79
+ </zeroOrMore>
80
+ </element>
81
+ </define>
66
82
  <define name="docsubtype">
67
83
  <element name="docsubtype">
68
84
  <choice>
@@ -6,6 +6,20 @@ require "fileutils"
6
6
  module IsoDoc
7
7
  module Ogc
8
8
  module BaseConvert
9
+ def error_parse(node, out)
10
+ case node.name
11
+ when "hi" then hi_parse(node, out)
12
+ else
13
+ super
14
+ end
15
+ end
16
+
17
+ def hi_parse(node, out)
18
+ out.span **{class: "hi"} do |e|
19
+ node.children.each { |n| parse(n, e) }
20
+ end
21
+ end
22
+
9
23
  def cleanup(docxml)
10
24
  super
11
25
  term_cleanup(docxml)
@@ -37,7 +51,7 @@ module IsoDoc
37
51
 
38
52
  def middle_clause(_docxml)
39
53
  "//clause[parent::sections][not(@type = 'scope' or "\
40
- "@type = 'conformance')][not(descendant::terms)]"
54
+ "@type = 'conformance')][not(descendant::terms)]"
41
55
  end
42
56
 
43
57
  def is_clause?(name)
@@ -1092,3 +1092,6 @@ a.footnote-number {
1092
1092
 
1093
1093
  .footnote {
1094
1094
  font-size: {{footnotefontsize}}; }
1095
+
1096
+ span.hi {
1097
+ background-color: yellow; }
@@ -597,3 +597,7 @@ a.footnote-number {
597
597
  .footnote {
598
598
  font-size: $footnotefontsize;
599
599
  }
600
+
601
+ span.hi {
602
+ background-color: yellow;
603
+ }
@@ -848,3 +848,6 @@ div.warning p {
848
848
  mso-border-alt: solid windowtext .5pt;
849
849
  padding: 0cm;
850
850
  mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; }
851
+
852
+ span.hi {
853
+ background-color: yellow; }
@@ -806,3 +806,6 @@ div.warning p {
806
806
  margin-bottom:6.0pt;border:none;mso-border-alt:solid windowtext .5pt;
807
807
  padding:0cm;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt;
808
808
  }
809
+ span.hi {
810
+ background-color: yellow;
811
+ }
@@ -3,6 +3,7 @@
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
5
  <xsl:param name="svg_images"/>
6
+ <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
6
7
  <xsl:variable name="images" select="document($svg_images)"/>
7
8
 
8
9
  <xsl:variable name="pageWidth" select="'215.9mm'"/>
@@ -101,7 +102,9 @@
101
102
 
102
103
  </fo:layout-master-set>
103
104
 
104
- <xsl:call-template name="addPDFUAmeta"/>
105
+ <fo:declarations>
106
+ <xsl:call-template name="addPDFUAmeta"/>
107
+ </fo:declarations>
105
108
 
106
109
  <xsl:call-template name="addBookmarks">
107
110
  <xsl:with-param name="contents" select="$contents"/>
@@ -1760,6 +1763,7 @@
1760
1763
 
1761
1764
 
1762
1765
 
1766
+
1763
1767
 
1764
1768
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
1765
1769
 
@@ -2397,7 +2401,15 @@
2397
2401
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2398
2402
  <xsl:value-of select="@target"/>
2399
2403
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2400
- <xsl:variable name="math_text" select="normalize-space(.)"/>
2404
+ <xsl:variable name="mathml">
2405
+ <xsl:for-each select="*">
2406
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2407
+ <xsl:copy-of select="."/>
2408
+ </xsl:if>
2409
+ </xsl:for-each>
2410
+ </xsl:variable>
2411
+
2412
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2401
2413
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2402
2414
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2403
2415
  <xsl:param name="cols-count"/>
@@ -3382,6 +3394,10 @@
3382
3394
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3383
3395
  <xsl:apply-templates/>
3384
3396
  </fo:inline>
3397
+ </xsl:template><xsl:template match="*[local-name()='hi']">
3398
+ <fo:inline background-color="yellow">
3399
+ <xsl:apply-templates/>
3400
+ </fo:inline>
3385
3401
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
3386
3402
  <xsl:variable name="text" select="normalize-space(.)"/>
3387
3403
  <fo:inline font-size="75%">
@@ -3722,6 +3738,7 @@
3722
3738
  <xsl:apply-templates select="." mode="mathml"/>
3723
3739
  </xsl:variable>
3724
3740
  <fo:instream-foreign-object fox:alt-text="Math">
3741
+
3725
3742
  <!-- <xsl:copy-of select="."/> -->
3726
3743
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3727
3744
  </fo:instream-foreign-object>
@@ -3740,7 +3757,7 @@
3740
3757
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
3741
3758
  </xsl:copy>
3742
3759
  <mathml:mspace width="0.5ex"/>
3743
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3760
+ </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3744
3761
  <xsl:variable name="target">
3745
3762
  <xsl:choose>
3746
3763
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -3774,8 +3791,6 @@
3774
3791
  </xsl:otherwise>
3775
3792
  </xsl:choose>
3776
3793
  </fo:inline>
3777
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3778
- <fo:inline id="{@id}"/>
3779
3794
  </xsl:template><xsl:template match="*[local-name()='appendix']">
3780
3795
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3781
3796
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -3990,6 +4005,7 @@
3990
4005
  <fo:block id="{@id}">
3991
4006
  <xsl:apply-templates/>
3992
4007
  </fo:block>
4008
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3993
4009
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3994
4010
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3995
4011
  <xsl:apply-templates/>
@@ -4624,9 +4640,10 @@
4624
4640
  </xsl:choose>
4625
4641
 
4626
4642
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
4627
-
4643
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
4628
4644
  <xsl:variable name="element">
4629
4645
 
4646
+
4630
4647
  inline
4631
4648
  </xsl:variable>
4632
4649
  <xsl:choose>
@@ -4730,30 +4747,48 @@
4730
4747
  <xsl:text>— </xsl:text>
4731
4748
  <xsl:apply-templates/>
4732
4749
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
4733
- <fo:inline xsl:use-attribute-sets="eref-style">
4734
- <xsl:if test="@type = 'footnote'">
4735
-
4736
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4737
- <xsl:attribute name="font-size">80%</xsl:attribute>
4738
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4739
- <xsl:attribute name="vertical-align">super</xsl:attribute>
4740
-
4741
-
4742
- </xsl:if>
4743
-
4744
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4745
-
4746
- <xsl:if test="@type = 'inline'">
4747
-
4748
-
4749
-
4750
-
4751
- </xsl:if>
4752
-
4753
-
4754
- <xsl:apply-templates/>
4755
- </fo:basic-link>
4756
- </fo:inline>
4750
+
4751
+ <xsl:variable name="bibitemid">
4752
+ <xsl:choose>
4753
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
4754
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
4755
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
4756
+ </xsl:choose>
4757
+ </xsl:variable>
4758
+
4759
+ <xsl:choose>
4760
+ <xsl:when test="normalize-space($bibitemid) != ''">
4761
+ <fo:inline xsl:use-attribute-sets="eref-style">
4762
+ <xsl:if test="@type = 'footnote'">
4763
+
4764
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4765
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4766
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4767
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4768
+
4769
+
4770
+ </xsl:if>
4771
+
4772
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4773
+ <xsl:if test="normalize-space(@citeas) = ''">
4774
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4775
+ </xsl:if>
4776
+ <xsl:if test="@type = 'inline'">
4777
+
4778
+
4779
+
4780
+
4781
+ </xsl:if>
4782
+
4783
+ <xsl:apply-templates/>
4784
+ </fo:basic-link>
4785
+
4786
+ </fo:inline>
4787
+ </xsl:when>
4788
+ <xsl:otherwise>
4789
+ <fo:inline><xsl:apply-templates/></fo:inline>
4790
+ </xsl:otherwise>
4791
+ </xsl:choose>
4757
4792
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
4758
4793
  <!-- zero-space char -->
4759
4794
  <xsl:variable name="depth">
@@ -4936,6 +4971,153 @@
4936
4971
  </fo:block>
4937
4972
  </xsl:otherwise>
4938
4973
  </xsl:choose>
4974
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
4975
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
4976
+ <bookmark><xsl:value-of select="@id"/></bookmark>
4977
+ </xsl:for-each>
4978
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
4979
+ <xsl:copy>
4980
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
4981
+ </xsl:copy>
4982
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
4983
+ <xsl:variable name="id">
4984
+ <xsl:call-template name="generateIndexXrefId"/>
4985
+ </xsl:variable>
4986
+ <xsl:copy> <!-- add id to xref -->
4987
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
4988
+ <xsl:attribute name="id">
4989
+ <xsl:value-of select="$id"/>
4990
+ </xsl:attribute>
4991
+ <xsl:apply-templates mode="index_add_id"/>
4992
+ </xsl:copy>
4993
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
4994
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
4995
+ <xsl:if test="@to">
4996
+ <xsl:value-of select="$dash"/>
4997
+ <xsl:copy>
4998
+ <xsl:copy-of select="@*"/>
4999
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
5000
+ <xsl:attribute name="id">
5001
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
5002
+ </xsl:attribute>
5003
+ <xsl:apply-templates mode="index_add_id"/>
5004
+ </xsl:copy>
5005
+ </xsl:if>
5006
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
5007
+ <xsl:copy>
5008
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
5009
+ </xsl:copy>
5010
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
5011
+ <xsl:copy>
5012
+ <xsl:apply-templates select="@*" mode="index_update"/>
5013
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
5014
+ </xsl:copy>
5015
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
5016
+ <xsl:param name="element"/>
5017
+ <xsl:param name="remove" select="'false'"/>
5018
+ <xsl:param name="target"/>
5019
+ <!-- <node></node> -->
5020
+ <xsl:choose>
5021
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
5022
+ <!-- skip text (i.e. remove it) and process next element -->
5023
+ <!-- [removed_<xsl:value-of select="."/>] -->
5024
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5025
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
5026
+ </xsl:apply-templates>
5027
+ </xsl:when>
5028
+ <xsl:when test="self::text()">
5029
+ <xsl:value-of select="."/>
5030
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5031
+ </xsl:when>
5032
+ <xsl:when test="self::* and local-name(.) = 'xref'">
5033
+ <xsl:variable name="id" select="@id"/>
5034
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
5035
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
5036
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
5037
+
5038
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
5039
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
5040
+
5041
+ <xsl:choose>
5042
+ <!-- 2nd pass -->
5043
+ <!-- if page is equal to page for next and page is not the end of range -->
5044
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
5045
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
5046
+ <!-- [removed_xref] -->
5047
+
5048
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5049
+ <xsl:with-param name="remove">true</xsl:with-param>
5050
+ <xsl:with-param name="target">
5051
+ <xsl:choose>
5052
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
5053
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
5054
+ </xsl:choose>
5055
+ </xsl:with-param>
5056
+ </xsl:apply-templates>
5057
+ </xsl:when>
5058
+
5059
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
5060
+ <!-- remove xref -->
5061
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5062
+ <xsl:with-param name="remove">true</xsl:with-param>
5063
+ </xsl:apply-templates>
5064
+ </xsl:when>
5065
+
5066
+ <xsl:otherwise>
5067
+ <xsl:apply-templates select="." mode="xref_copy">
5068
+ <xsl:with-param name="target" select="$target"/>
5069
+ </xsl:apply-templates>
5070
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5071
+ </xsl:otherwise>
5072
+ </xsl:choose>
5073
+ </xsl:when>
5074
+ <xsl:when test="self::* and local-name(.) = 'ul'">
5075
+ <!-- ul -->
5076
+ <xsl:apply-templates select="." mode="index_update"/>
5077
+ </xsl:when>
5078
+ <xsl:otherwise>
5079
+ <xsl:apply-templates select="." mode="xref_copy">
5080
+ <xsl:with-param name="target" select="$target"/>
5081
+ </xsl:apply-templates>
5082
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5083
+ </xsl:otherwise>
5084
+ </xsl:choose>
5085
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
5086
+ <xsl:param name="target"/>
5087
+ <xsl:copy>
5088
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
5089
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
5090
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
5091
+ </xsl:if>
5092
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
5093
+ </xsl:copy>
5094
+ </xsl:template><xsl:template name="generateIndexXrefId">
5095
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5096
+
5097
+ <xsl:variable name="docid">
5098
+ <xsl:call-template name="getDocumentId"/>
5099
+ </xsl:variable>
5100
+ <xsl:variable name="item_number">
5101
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
5102
+ </xsl:variable>
5103
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
5104
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
5105
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
5106
+ <xsl:apply-templates/>
5107
+ <fo:block>
5108
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
5109
+ <fo:block> </fo:block>
5110
+ </xsl:if>
5111
+ </fo:block>
5112
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
5113
+ <xsl:apply-templates/>
5114
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
5115
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5116
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
5117
+ <xsl:apply-templates/>
5118
+ </fo:block>
5119
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']">
5120
+ <fo:inline id="{@id}"/>
4939
5121
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4940
5122
  <!-- <row>
4941
5123
  <date>05-07-2013</date>
@@ -5294,70 +5476,68 @@
5294
5476
  <xsl:variable name="lang">
5295
5477
  <xsl:call-template name="getLang"/>
5296
5478
  </xsl:variable>
5297
- <fo:declarations>
5298
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
5299
- <pdf:dictionary type="normal" key="ViewerPreferences">
5300
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
5301
- </pdf:dictionary>
5302
- </pdf:catalog>
5303
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
5304
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
5305
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
5306
- <!-- Dublin Core properties go here -->
5307
- <dc:title>
5308
- <xsl:variable name="title">
5309
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5310
-
5311
-
5312
-
5313
-
5314
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
5315
-
5316
-
5317
-
5318
- </xsl:for-each>
5319
- </xsl:variable>
5320
- <xsl:choose>
5321
- <xsl:when test="normalize-space($title) != ''">
5322
- <xsl:value-of select="$title"/>
5323
- </xsl:when>
5324
- <xsl:otherwise>
5325
- <xsl:text> </xsl:text>
5326
- </xsl:otherwise>
5327
- </xsl:choose>
5328
- </dc:title>
5329
- <dc:creator>
5479
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
5480
+ <pdf:dictionary type="normal" key="ViewerPreferences">
5481
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
5482
+ </pdf:dictionary>
5483
+ </pdf:catalog>
5484
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
5485
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
5486
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
5487
+ <!-- Dublin Core properties go here -->
5488
+ <dc:title>
5489
+ <xsl:variable name="title">
5330
5490
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5331
5491
 
5332
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
5333
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
5334
- <xsl:if test="position() != last()">; </xsl:if>
5335
- </xsl:for-each>
5336
-
5337
5492
 
5338
5493
 
5339
- </xsl:for-each>
5340
- </dc:creator>
5341
- <dc:description>
5342
- <xsl:variable name="abstract">
5343
-
5344
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
5494
+
5495
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
5345
5496
 
5346
5497
 
5347
- </xsl:variable>
5348
- <xsl:value-of select="normalize-space($abstract)"/>
5349
- </dc:description>
5350
- <pdf:Keywords>
5351
- <xsl:call-template name="insertKeywords"/>
5352
- </pdf:Keywords>
5353
- </rdf:Description>
5354
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
5355
- <!-- XMP properties go here -->
5356
- <xmp:CreatorTool/>
5357
- </rdf:Description>
5358
- </rdf:RDF>
5359
- </x:xmpmeta>
5360
- </fo:declarations>
5498
+
5499
+ </xsl:for-each>
5500
+ </xsl:variable>
5501
+ <xsl:choose>
5502
+ <xsl:when test="normalize-space($title) != ''">
5503
+ <xsl:value-of select="$title"/>
5504
+ </xsl:when>
5505
+ <xsl:otherwise>
5506
+ <xsl:text> </xsl:text>
5507
+ </xsl:otherwise>
5508
+ </xsl:choose>
5509
+ </dc:title>
5510
+ <dc:creator>
5511
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5512
+
5513
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
5514
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
5515
+ <xsl:if test="position() != last()">; </xsl:if>
5516
+ </xsl:for-each>
5517
+
5518
+
5519
+
5520
+ </xsl:for-each>
5521
+ </dc:creator>
5522
+ <dc:description>
5523
+ <xsl:variable name="abstract">
5524
+
5525
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
5526
+
5527
+
5528
+ </xsl:variable>
5529
+ <xsl:value-of select="normalize-space($abstract)"/>
5530
+ </dc:description>
5531
+ <pdf:Keywords>
5532
+ <xsl:call-template name="insertKeywords"/>
5533
+ </pdf:Keywords>
5534
+ </rdf:Description>
5535
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
5536
+ <!-- XMP properties go here -->
5537
+ <xmp:CreatorTool/>
5538
+ </rdf:Description>
5539
+ </rdf:RDF>
5540
+ </x:xmpmeta>
5361
5541
  </xsl:template><xsl:template name="getId">
5362
5542
  <xsl:choose>
5363
5543
  <xsl:when test="../@id">