Skip to content

Commit

Permalink
fix processing of termsource within designation: #630
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Jan 1, 2025
1 parent 1f2bf52 commit 464bbdf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 26 deletions.
2 changes: 1 addition & 1 deletion lib/isodoc/presentation_function/concepts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def designation1(desgn)
"./graphical-symbol")) or return
designation_annotate(d1, name, desgn)
out << d1
s and out.next = s.wrap("<fmt-termsource></fmt-termsource>")
s and out << s.wrap("<fmt-termsource></fmt-termsource>").parent
end

def designation_annotate(desgn, name, orig)
Expand Down
4 changes: 2 additions & 2 deletions lib/isodoc/presentation_function/terms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def termcleanup(docxml)
%w(preferred admitted deprecates related definition termsource)
.each do |w|
t.xpath(ns("./#{w}//fmt-name | ./#{w}//fmt-xref-label")).each(&:remove)
f = t.at(ns("./fmt-#{w}"))
f = t.at(ns(".//fmt-#{w}"))
f&.children&.empty? and f.remove
end
end
Expand Down Expand Up @@ -88,7 +88,7 @@ def termdomain(elem, fmt_defn)
def termsource(docxml)
copy_baselevel_termsource(docxml)
# TODO should I wrap fmt-definition//termsource in fmt-termsource, in order to preserve termsource attributes?
docxml.xpath(ns("//fmt-termsource/termsource | //fmt-definition//termsource"))
docxml.xpath(ns("//fmt-termsource/termsource | //fmt-definition//termsource | //fmt-preferred//termsource | //fmt-admitted//termsource | //fmt-deprecates//termsource"))
.each do |f|
termsource_modification(f)
end
Expand Down
41 changes: 18 additions & 23 deletions spec/isodoc/terms_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,20 @@
, &lt;in agriculture, dated&gt;
</semx>
</p>
<fmt-termsource>
[SOURCE:
<semx element="termsource" source="_">
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011">
<locality type="clause">
<referenceFrom>3.1</referenceFrom>
</locality>
ISO 7301:2011, Clause 3.1
</origin>
, modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
</semx>
]
</fmt-termsource>
</fmt-preferred>
<termsource status="modified" id="_">
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011">
<locality type="clause">
<referenceFrom>3.1</referenceFrom>
</locality>
</origin>
<modification>
<p original-id="_">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
</modification>
</termsource>
<domain id="_">rice</domain>
<definition id="_">
<verbal-definition>
Expand Down Expand Up @@ -324,18 +327,8 @@
<p original-id="_">with adjustments</p>
</modification>
</termsource>
<fmt-termsource status="modified">
<fmt-termsource status="identical">
[SOURCE:
<semx element="termsource" source="_">
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011">
<locality type="clause">
<referenceFrom>3.1</referenceFrom>
</locality>
ISO 7301:2011, Clause 3.1
</origin>
, modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
</semx>
;
<semx element="termsource" source="_">
<origin citeas="">
<termref base="IEV" target="xyz">t1</termref>
Expand Down Expand Up @@ -543,6 +536,7 @@
<b>paddy</b>
, &lt;in agriculture, dated&gt;
</p>
<p>[SOURCE: ISO 7301:2011, Clause 3.1, modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
<p id="_">&lt;rice&gt; rice retaining its husk after threshing</p>
<div id="_" class="example" style="page-break-after: avoid;page-break-inside: avoid;">
<p class="example-title">EXAMPLE 1</p>
Expand All @@ -561,7 +555,7 @@
</ul>
</div>
</div>
<p>[SOURCE: ISO 7301:2011, Clause 3.1, modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here; t1 — comment; Termbase IEV, term ID xyz, modified — with adjustments]</p>
<p>[SOURCE: t1 — comment; Termbase IEV, term ID xyz, modified — with adjustments]</p>
<p class="TermNum" id="paddy">1.2.</p>
<p class="Terms" style="text-align:left;">
<b>paddy</b>
Expand Down Expand Up @@ -622,6 +616,7 @@
<b>paddy</b>
, &lt;in agriculture, dated&gt;
</p>
<p>[SOURCE: ISO 7301:2011, Clause 3.1, modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
<p id="_">&lt;rice&gt; rice retaining its husk after threshing</p>
<div id="_" class="example" style="page-break-after: avoid;page-break-inside: avoid;">
<p class="example-title">EXAMPLE 1</p>
Expand All @@ -640,7 +635,7 @@
</ul>
</div>
</div>
<p>[SOURCE: ISO 7301:2011, Clause 3.1, modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here; t1 — comment; Termbase IEV, term ID xyz, modified — with adjustments]</p>
<p>[SOURCE: t1 — comment; Termbase IEV, term ID xyz, modified — with adjustments]</p>
<p class="TermNum" id="paddy">1.2.</p>
<p class="Terms" style="text-align:left;">
<b>paddy</b>
Expand Down

0 comments on commit 464bbdf

Please sign in to comment.