Skip to content

Commit

Permalink
update XML parser
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew2net committed Aug 23, 2024
1 parent 38eb6c1 commit a879199
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/relaton_bib/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RelatonBib
VERSION = "1.19.3".freeze
VERSION = "1.19.4".freeze
end
12 changes: 8 additions & 4 deletions lib/relaton_bib/xml_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,17 @@ def create_doctype(type)
# @return [Array<RelatonBib::DocumentIdentifier>]
def fetch_docid(item)
item.xpath("./docidentifier").map do |id|
did = id.to_h.transform_keys(&:to_sym)
did[:id] = id.text
did[:primary] = id[:primary] == "true" ? true : nil
DocumentIdentifier.new(**did)
args = id.to_h.transform_keys(&:to_sym)
args[:id] = id.text
args[:primary] = id[:primary] == "true" ? true : nil
create_docid(**args)
end
end

def create_docid(**args)
DocumentIdentifier.new(**args)
end

# @param item [Nokogiri::XML::Element]
# @return [RelatonBib::TypedTitleStringCollection]
def fetch_titles(item)
Expand Down

0 comments on commit a879199

Please sign in to comment.