Skip to content
Embulk parser plugin for XML with XPath support
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/embulk/parser
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
embulk-parser-xpath.gemspec

README.md

XML parser plugin for Embulk

Parser plugin for Embulk.

Embulk parser plugin for XML with XPath support ? Edit

Overview

  • Plugin type: parser
  • Load all or nothing: yes
  • Resume supported: no

Configuration

parser:
  type: xpath
  root: /rdf:RDF
  schema:
    - {name: //si:title[1], type: string}
    - {name: //si:author[1], type: string}
  namespaces:
    "rdf" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    "si" : "http://www.w3schools.com/rdf/"
  • type: specify this plugin as xpath
  • root: root property to start fetching each entries, specify in xpath style, required
  • schema: specify the attribute of table and data type, required
  • namespaces: xml namespaces

Then you can fetch entries from the following xml:

<?xml version="1.0"?>
<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:si="http://www.w3schools.com/rdf/">
  <rdf:Description rdf:about="http://www.w3schools.com">
    <si:title>W3Schools</si:title>
    <si:author>Jan Egil Refsnes</si:author>
  </rdf:Description>
</rdf:RDF>
You can’t perform that action at this time.