Skip to content

Commit 535da31

Browse files
committed
version bump
1 parent a6c59af commit 535da31

File tree

5 files changed

+117
-54
lines changed

5 files changed

+117
-54
lines changed

lib/isodoc/iho/iho.specification.xsl

+37-25
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,7 @@
16661666
<xsl:variable name="title-table">
16671667

16681668
<xsl:text>Table </xsl:text>
1669-
1669+
16701670

16711671
</xsl:variable><xsl:variable name="title-note">
16721672

@@ -1683,7 +1683,7 @@
16831683
<xsl:text>EXAMPLE </xsl:text>
16841684

16851685

1686-
</xsl:variable><xsl:variable name="title-annex">
1686+
</xsl:variable><xsl:variable name="title-inequality">Inequality </xsl:variable><xsl:variable name="title-equation">Equation </xsl:variable><xsl:variable name="title-annex">
16871687

16881688
<xsl:text>Annex </xsl:text>
16891689

@@ -1699,7 +1699,8 @@
16991699
<xsl:text>Edition </xsl:text>
17001700
</xsl:variable><xsl:variable name="title-toc">
17011701
Contents
1702-
</xsl:variable><xsl:variable name="title-key">Key</xsl:variable><xsl:variable name="title-where">where</xsl:variable><xsl:variable name="title-descriptors">Descriptors</xsl:variable><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
1702+
1703+
</xsl:variable><xsl:variable name="title-page">Page</xsl:variable><xsl:variable name="title-key">Key</xsl:variable><xsl:variable name="title-where">where</xsl:variable><xsl:variable name="title-descriptors">Descriptors</xsl:variable><xsl:variable name="title-part-en">Part </xsl:variable><xsl:variable name="title-part-fr">Partie </xsl:variable><xsl:variable name="title-note-to-entry">Note # to entry: </xsl:variable><xsl:variable name="title-modified">modified</xsl:variable><xsl:variable name="title-source">SOURCE</xsl:variable><xsl:variable name="title-keywords">Keywords</xsl:variable><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
17031704

17041705
<xsl:attribute name="color">blue</xsl:attribute>
17051706
<xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -2019,13 +2020,16 @@
20192020
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
20202021
<xsl:value-of select="@target"/>
20212022
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2023+
<xsl:param name="cols-count"/>
20222024
<!-- font-weight="bold" -->
2023-
<fo:table-header>
2025+
<fo:table-header>
2026+
20242027
<xsl:apply-templates/>
20252028
</fo:table-header>
20262029
</xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
20272030
<xsl:apply-templates/>
20282031
</xsl:template><xsl:template name="insertTableFooter">
2032+
<xsl:param name="cols-count"/>
20292033
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
20302034
<xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
20312035

@@ -2036,22 +2040,7 @@
20362040
<!-- if there are note(s) or fn(s) then create footer row -->
20372041
<xsl:if test="$isNoteOrFnExist = 'true'">
20382042

2039-
<xsl:variable name="cols-count">
2040-
<xsl:choose>
2041-
<xsl:when test="../*[local-name()='thead']">
2042-
<!-- <xsl:value-of select="count(../*[local-name()='thead']/*[local-name()='tr']/*[local-name()='th'])"/> -->
2043-
<xsl:call-template name="calculate-columns-numbers">
2044-
<xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
2045-
</xsl:call-template>
2046-
</xsl:when>
2047-
<xsl:otherwise>
2048-
<!-- <xsl:value-of select="count(./*[local-name()='tr'][1]/*[local-name()='td'])"/> -->
2049-
<xsl:call-template name="calculate-columns-numbers">
2050-
<xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
2051-
</xsl:call-template>
2052-
</xsl:otherwise>
2053-
</xsl:choose>
2054-
</xsl:variable>
2043+
20552044

20562045
<fo:table-row>
20572046
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
@@ -2081,9 +2070,28 @@
20812070
</xsl:if>
20822071
</xsl:template><xsl:template match="*[local-name()='tbody']">
20832072

2084-
<xsl:apply-templates select="../*[local-name()='thead']" mode="process"/>
2073+
<xsl:variable name="cols-count">
2074+
<xsl:choose>
2075+
<xsl:when test="../*[local-name()='thead']">
2076+
<xsl:call-template name="calculate-columns-numbers">
2077+
<xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
2078+
</xsl:call-template>
2079+
</xsl:when>
2080+
<xsl:otherwise>
2081+
<xsl:call-template name="calculate-columns-numbers">
2082+
<xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
2083+
</xsl:call-template>
2084+
</xsl:otherwise>
2085+
</xsl:choose>
2086+
</xsl:variable>
2087+
2088+
<xsl:apply-templates select="../*[local-name()='thead']" mode="process">
2089+
<xsl:with-param name="cols-count" select="$cols-count"/>
2090+
</xsl:apply-templates>
20852091

2086-
<xsl:call-template name="insertTableFooter"/>
2092+
<xsl:call-template name="insertTableFooter">
2093+
<xsl:with-param name="cols-count" select="$cols-count"/>
2094+
</xsl:call-template>
20872095

20882096
<fo:table-body>
20892097
<xsl:apply-templates/>
@@ -2158,6 +2166,7 @@
21582166
</xsl:attribute>
21592167
</xsl:if>
21602168
<fo:block>
2169+
21612170
<xsl:apply-templates/>
21622171
</fo:block>
21632172
<!-- <xsl:choose>
@@ -2336,7 +2345,7 @@
23362345

23372346

23382347
<fo:block margin-bottom="12pt" text-align="left">
2339-
2348+
23402349
<xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
23412350
<xsl:apply-templates select="*[local-name()='dt']/*"/>
23422351
<xsl:text/>
@@ -2349,7 +2358,7 @@
23492358

23502359

23512360

2352-
2361+
23532362
<xsl:value-of select="$title-where"/>
23542363
</fo:block>
23552364
</xsl:when>
@@ -2495,6 +2504,7 @@
24952504

24962505
<fo:table-row>
24972506
<fo:table-cell>
2507+
24982508
<fo:block margin-top="6pt">
24992509

25002510

@@ -2508,8 +2518,10 @@
25082518
<xsl:attribute name="margin-top">0pt</xsl:attribute>
25092519
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
25102520

2521+
2522+
25112523
<xsl:apply-templates/>
2512-
2524+
25132525
</fo:block>
25142526
</fo:table-cell>
25152527
<fo:table-cell>

lib/isodoc/iho/iho.standard.xsl

+37-25
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,7 @@
16661666
<xsl:variable name="title-table">
16671667

16681668
<xsl:text>Table </xsl:text>
1669-
1669+
16701670

16711671
</xsl:variable><xsl:variable name="title-note">
16721672

@@ -1683,7 +1683,7 @@
16831683
<xsl:text>EXAMPLE </xsl:text>
16841684

16851685

1686-
</xsl:variable><xsl:variable name="title-annex">
1686+
</xsl:variable><xsl:variable name="title-inequality">Inequality </xsl:variable><xsl:variable name="title-equation">Equation </xsl:variable><xsl:variable name="title-annex">
16871687

16881688
<xsl:text>Annex </xsl:text>
16891689

@@ -1699,7 +1699,8 @@
16991699
<xsl:text>Edition </xsl:text>
17001700
</xsl:variable><xsl:variable name="title-toc">
17011701
Contents
1702-
</xsl:variable><xsl:variable name="title-key">Key</xsl:variable><xsl:variable name="title-where">where</xsl:variable><xsl:variable name="title-descriptors">Descriptors</xsl:variable><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
1702+
1703+
</xsl:variable><xsl:variable name="title-page">Page</xsl:variable><xsl:variable name="title-key">Key</xsl:variable><xsl:variable name="title-where">where</xsl:variable><xsl:variable name="title-descriptors">Descriptors</xsl:variable><xsl:variable name="title-part-en">Part </xsl:variable><xsl:variable name="title-part-fr">Partie </xsl:variable><xsl:variable name="title-note-to-entry">Note # to entry: </xsl:variable><xsl:variable name="title-modified">modified</xsl:variable><xsl:variable name="title-source">SOURCE</xsl:variable><xsl:variable name="title-keywords">Keywords</xsl:variable><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
17031704

17041705
<xsl:attribute name="color">blue</xsl:attribute>
17051706
<xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -2019,13 +2020,16 @@
20192020
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
20202021
<xsl:value-of select="@target"/>
20212022
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2023+
<xsl:param name="cols-count"/>
20222024
<!-- font-weight="bold" -->
2023-
<fo:table-header>
2025+
<fo:table-header>
2026+
20242027
<xsl:apply-templates/>
20252028
</fo:table-header>
20262029
</xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
20272030
<xsl:apply-templates/>
20282031
</xsl:template><xsl:template name="insertTableFooter">
2032+
<xsl:param name="cols-count"/>
20292033
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
20302034
<xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
20312035

@@ -2036,22 +2040,7 @@
20362040
<!-- if there are note(s) or fn(s) then create footer row -->
20372041
<xsl:if test="$isNoteOrFnExist = 'true'">
20382042

2039-
<xsl:variable name="cols-count">
2040-
<xsl:choose>
2041-
<xsl:when test="../*[local-name()='thead']">
2042-
<!-- <xsl:value-of select="count(../*[local-name()='thead']/*[local-name()='tr']/*[local-name()='th'])"/> -->
2043-
<xsl:call-template name="calculate-columns-numbers">
2044-
<xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
2045-
</xsl:call-template>
2046-
</xsl:when>
2047-
<xsl:otherwise>
2048-
<!-- <xsl:value-of select="count(./*[local-name()='tr'][1]/*[local-name()='td'])"/> -->
2049-
<xsl:call-template name="calculate-columns-numbers">
2050-
<xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
2051-
</xsl:call-template>
2052-
</xsl:otherwise>
2053-
</xsl:choose>
2054-
</xsl:variable>
2043+
20552044

20562045
<fo:table-row>
20572046
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
@@ -2081,9 +2070,28 @@
20812070
</xsl:if>
20822071
</xsl:template><xsl:template match="*[local-name()='tbody']">
20832072

2084-
<xsl:apply-templates select="../*[local-name()='thead']" mode="process"/>
2073+
<xsl:variable name="cols-count">
2074+
<xsl:choose>
2075+
<xsl:when test="../*[local-name()='thead']">
2076+
<xsl:call-template name="calculate-columns-numbers">
2077+
<xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
2078+
</xsl:call-template>
2079+
</xsl:when>
2080+
<xsl:otherwise>
2081+
<xsl:call-template name="calculate-columns-numbers">
2082+
<xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
2083+
</xsl:call-template>
2084+
</xsl:otherwise>
2085+
</xsl:choose>
2086+
</xsl:variable>
2087+
2088+
<xsl:apply-templates select="../*[local-name()='thead']" mode="process">
2089+
<xsl:with-param name="cols-count" select="$cols-count"/>
2090+
</xsl:apply-templates>
20852091

2086-
<xsl:call-template name="insertTableFooter"/>
2092+
<xsl:call-template name="insertTableFooter">
2093+
<xsl:with-param name="cols-count" select="$cols-count"/>
2094+
</xsl:call-template>
20872095

20882096
<fo:table-body>
20892097
<xsl:apply-templates/>
@@ -2158,6 +2166,7 @@
21582166
</xsl:attribute>
21592167
</xsl:if>
21602168
<fo:block>
2169+
21612170
<xsl:apply-templates/>
21622171
</fo:block>
21632172
<!-- <xsl:choose>
@@ -2336,7 +2345,7 @@
23362345

23372346

23382347
<fo:block margin-bottom="12pt" text-align="left">
2339-
2348+
23402349
<xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
23412350
<xsl:apply-templates select="*[local-name()='dt']/*"/>
23422351
<xsl:text/>
@@ -2349,7 +2358,7 @@
23492358

23502359

23512360

2352-
2361+
23532362
<xsl:value-of select="$title-where"/>
23542363
</fo:block>
23552364
</xsl:when>
@@ -2495,6 +2504,7 @@
24952504

24962505
<fo:table-row>
24972506
<fo:table-cell>
2507+
24982508
<fo:block margin-top="6pt">
24992509

25002510

@@ -2508,8 +2518,10 @@
25082518
<xsl:attribute name="margin-top">0pt</xsl:attribute>
25092519
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
25102520

2521+
2522+
25112523
<xsl:apply-templates/>
2512-
2524+
25132525
</fo:block>
25142526
</fo:table-cell>
25152527
<fo:table-cell>

lib/metanorma/iho/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Metanorma
22
module IHO
3-
VERSION = "0.0.2"
3+
VERSION = "0.0.3"
44
end
55
end

metanorma-iho.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
2727
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
2828

2929
spec.add_dependency "htmlentities", "~> 4.3.4"
30-
spec.add_dependency "metanorma-standoc", "~> 1.3.0"
30+
spec.add_dependency "metanorma-standoc", "~> 1.4.0"
3131
spec.add_dependency "isodoc", "~> 1.0.0"
3232
spec.add_dependency 'metanorma-generic', '~> 1.4.0'
3333

spec/isodoc/iho/html_convert_spec.rb

+41-2
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,50 @@
6767
INPUT
6868

6969
output = <<~"OUTPUT"
70-
{:accesseddate=>"XXX", :agency=>"Ribose", :authors=>[], :authors_affiliations=>{}, :circulateddate=>"XXX", :comment_from=>"2010", :comment_to=>"2011", :confirmeddate=>"XXX", :copieddate=>"XXX", :createddate=>"XXX", :docnumber=>"1000(wd)", :docnumeric=>"1000", :doctitle=>"Main Title", :doctype=>"Standard", :docyear=>"2001", :draft=>"3.4", :draftinfo=>" (draft 3.4, 2000-01-01)", :edition=>"2", :implementeddate=>"2000-01-01", :issueddate=>"XXX", :logo=>"#{File.join(logoloc, 'logo.png')}", :logo_paths=>["#{File.join(logoloc, 'image001.png')}", "#{File.join(logoloc, 'image002.png')}", "#{File.join(logoloc, 'image003.png')}"], :obsoleteddate=>"2001-01-01", :publisheddate=>"XXX", :publisher=>"Ribose", :receiveddate=>"XXX", :revdate=>"2000-01-01", :revdate_monthyear=>"January 2000", :series=>"Bathymetric", :seriesabbr=>"B", :stage=>"Working Draft", :stageabbr=>nil, :tc=>"TC", :transmitteddate=>"XXX", :unchangeddate=>"XXX", :unpublished=>true, :updateddate=>"XXX", :vote_endeddate=>"XXX", :vote_starteddate=>"XXX"}
70+
{:accesseddate=>"XXX",
71+
:agency=>"Ribose",
72+
:authors=>[],
73+
:authors_affiliations=>{},
74+
:circulateddate=>"XXX",
75+
:comment_from=>"2010",
76+
:comment_to=>"2011",
77+
:confirmeddate=>"XXX",
78+
:copieddate=>"XXX",
79+
:createddate=>"XXX",
80+
:docnumber=>"1000(wd)",
81+
:docnumeric=>"1000",
82+
:doctitle=>"Main Title",
83+
:doctype=>"Standard",
84+
:docyear=>"2001",
85+
:draft=>"3.4",
86+
:draftinfo=>" (draft 3.4, 2000-01-01)",
87+
:edition=>"2",
88+
:implementeddate=>"2000-01-01",
89+
:issueddate=>"XXX",
90+
:keywords=>[],
91+
:logo=>"#{File.join(logoloc, 'logo.png')}",
92+
:logo_paths=>["#{File.join(logoloc, 'image001.png')}", "#{File.join(logoloc, 'image002.png')}", "#{File.join(logoloc, 'image003.png')}"],
93+
:obsoleteddate=>"2001-01-01",
94+
:publisheddate=>"XXX",
95+
:publisher=>"Ribose",
96+
:receiveddate=>"XXX",
97+
:revdate=>"2000-01-01",
98+
:revdate_monthyear=>"January 2000",
99+
:series=>"Bathymetric",
100+
:seriesabbr=>"B",
101+
:stage=>"Working Draft",
102+
:stageabbr=>nil,
103+
:tc=>"TC",
104+
:transmitteddate=>"XXX",
105+
:unchangeddate=>"XXX",
106+
:unpublished=>true,
107+
:updateddate=>"XXX",
108+
:vote_endeddate=>"XXX",
109+
:vote_starteddate=>"XXX"}
71110
OUTPUT
72111

73112
docxml, filename, dir = csdc.convert_init(input, "test", true)
74-
expect(htmlencode(Hash[csdc.info(docxml, nil).sort].to_s)).to be_equivalent_to output
113+
expect(htmlencode(Hash[csdc.info(docxml, nil).sort].to_s).gsub(/, :/, ",\n:")).to be_equivalent_to output
75114
end
76115

77116
it "processes section names" do

0 commit comments

Comments
 (0)