Module: TrajectPlus::Macros::Xml
- Defined in:
- lib/traject_plus/macros/xml.rb
Overview
Macros for extracting MODS values from Nokogiri documents
Instance Method Summary collapse
Instance Method Details
#extract_xml(xpath, namespaces, options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/traject_plus/macros/xml.rb', line 10 def extract_xml(xpath, namespaces, = {}) Deprecation.warn(self, "extract_xml is deprecated and will be removed in the next major release. Use the Traject 3 pipeline instead") lambda do |xml, accumulator, _context| result = xml.xpath(xpath, namespaces).map(&:text) unless .empty? Deprecation.warn(self, "passing options to extract_xml is deprecated and will be removed in the next major release. Use the Traject 3 pipeline instead") end result = TrajectPlus::Extraction.(result, ) accumulator.concat(result) end end |