lib/isodoc/presentation_function/terms.rb in isodoc-2.1.4 vs lib/isodoc/presentation_function/terms.rb in isodoc-2.1.5
- old
+ new
@@ -80,11 +80,16 @@
def related1(node)
p = node.at(ns("./preferred"))
ref = node.at(ns("./xref | ./eref | ./termref"))
label = @i18n.relatedterms[node["type"]].upcase
- node.replace(l10n("<p><strong>#{label}:</strong> "\
- "<em>#{p.to_xml}</em> (#{ref.to_xml})</p>"))
+ if p && ref
+ node.replace(l10n("<p><strong>#{label}:</strong> "\
+ "<em>#{p.to_xml}</em> (#{ref.to_xml})</p>"))
+ else
+ node.replace(l10n("<p><strong>#{label}:</strong> "\
+ "<strong>**RELATED TERM NOT FOUND**</strong></p>"))
+ end
end
def designation(docxml)
docxml.xpath(ns("//term")).each do |t|
merge_second_preferred(t)