Skip to content

Expose Nokogiri parsing options for xml reader #6

@avit

Description

@avit

Currently:

  • The :soap provider returns a Nori hash from Savon by default
  • The :xml reader either accepts a Nori hash, or parses XML strings using Nori

Nori is fine for the easy cases but is too lightweight as a general XML tool. We should expose the true XML parsing power of Nokogiri.

Can we make the options work sensibly for a single reader :xml block to provide for both lightweight Nori hashes OR Nokogiri nodes?

The attribute map can read keys from anything that responds to the [] method (remember: proc.call(x) == proc[x]), so it might just be an option for what kind of object we yield for each record, such as:

  • a Nori hash (current default)
  • A wrapper for xpath as ->(key) { node.at_xpath(key) }
  • A wrapper for css as ->(key) { node.at_css(key) }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions