Sha256: 71764ad9fed6ac1184065c8ad6b71fe8f4b159c7f7879d2c4cbf430c1b461907
Contents?: true
Size: 672 Bytes
Versions: 5
Compression:
Stored size: 672 Bytes
Contents
# frozen_string_literal: true module TrajectPlus module Macros # Macros for extracting MODS values from Nokogiri documents module Xml # @param xpath [String] the xpath query expression # @param namespaces [Hash<String,String>] The namespaces for the xpath query # @param options [Hash] other options, may include :trim def extract_xml(xpath, namespaces, options = {}) lambda do |xml, accumulator, _context| result = xml.xpath(xpath, namespaces).map(&:text) result = TrajectPlus::Extraction.apply_extraction_options(result, options) accumulator.concat(result) end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems