= RelatonIev Refactor IEV reference
image:https://img.shields.io/gem/v/relaton-iev.svg["Gem Version", link="https://rubygems.org/gems/relaton-iev"]
image:https://github.com/relaton/relaton-iev/workflows/rake/badge.svg["Build Status", link="https://github.com/relaton/relaton-iev/actions?workflow=rake"]
image:https://codeclimate.com/github/relaton/relaton-iev/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/relaton/relaton-iev"]
image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-iev.svg["Pull Requests", link="https://github.com/relaton/relaton-iev/pulls"]
image:https://img.shields.io/github/commits-since/relaton/relaton-iev/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-iev/releases"]
Metanorma references IEV as a single source, IEC 60050. In reality, IEC 60050 is dozens of separate documents, each with their own part number (corresponding to the starting number of the clause reference; so IEV clause 101-2-3 is actually IEC 60050-101 clause 101-2-3.) This gem helps rewrite the single IEV reference in a Metanorma document, out into all the references it actually corresponds to in the given document. It does so by parsing all first-level clauses in citations to IEV, replacing each by a reference to the IEC 60050 part corresponding to that clause, then looking up each of the IEC 60050 part documents using `relaton-iec`, and inserting those references into the XML document.
== Installation
Add this line to your application's Gemfile:
[source,ruby]
----
gem 'relaton-iev'
----
And then execute:
$ bundle
Or install it yourself as:
$ gem install relaton-iev
== Usage
[source,ruby]
----
require 'relaton_iev'
bibdb = Relaton::Db.new nil, nil
xmldoc = Nokogiri::XML <<~XML_DOC
102-01-01
XML_DOC
RelatonIev.iev_cleanup(xmldoc, bibdb)
=> [#