Skip to content

Commit dec57b7

Browse files
committed
debug single-clause annex terms generation
1 parent 9f27453 commit dec57b7

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

lib/isodoc/iho/xref.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ def annex_names(clause, num)
3232
end
3333

3434
def annex_names_recurse(clause, num)
35-
@klass.single_term_clause?(clause) and
36-
return annex_names1(clause.at(ns("./references | ./terms | ./definitions")),
35+
if @klass.single_term_clause?(clause)
36+
annex_names1(clause.at(ns("./references | ./terms | ./definitions")),
3737
nil, num.to_s, 1)
38+
else
3839
i = Counter.new
3940
clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
4041
.each do |c|
4142
i.increment(c)
4243
annex_names1(c, semx(clause, num), i.print, 2)
4344
end
45+
end
4446
end
4547

4648
# avoid ambiguity of Table 1-1 being in Appendix 1 or Clause 1

spec/isodoc/xref_spec.rb

+14
Original file line numberDiff line numberDiff line change
@@ -2753,6 +2753,8 @@
27532753
<xref target="QQ"/>
27542754
<xref target="QQ1"/>
27552755
<xref target="QQ2"/>
2756+
<xref target="PPP"/>
2757+
<xref target="PPP1"/>
27562758
<xref target="R"/>
27572759
</p>
27582760
</foreword>
@@ -2814,6 +2816,10 @@
28142816
<title>An Appendix</title>
28152817
</appendix>
28162818
</annex>
2819+
<annex id="PPP" inline-header="false" obligation="normative">
2820+
<title>Annex X</title>
2821+
<terms id="PPP1"><title>Annex X Terms</title></terms>
2822+
</annex>
28172823
<bibliography><references id="R" obligation="informative" normative="true">
28182824
<title>Normative References</title>
28192825
</references><clause id="S" obligation="informative">
@@ -2943,6 +2949,14 @@
29432949
<span class="fmt-element-name">Appendix</span>
29442950
<semx element="autonum" source="QQ2">1</semx>
29452951
</xref>
2952+
<xref target="PPP">
2953+
<span class="fmt-element-name">Annex</span>
2954+
<semx element="autonum" source="PPP">B</semx>
2955+
</xref>
2956+
<xref target="PPP1">
2957+
<span class="fmt-element-name">Annex</span>
2958+
<semx element="autonum" source="PPP1">B</semx>
2959+
</xref>
29462960
<xref target="R">
29472961
<span class="fmt-element-name">Section</span>
29482962
<semx element="autonum" source="R">2</semx>

0 commit comments

Comments
 (0)