https://github.com/fs02/embulk-parser-flexml
Flexible xml parser for embulk - supports xpath and attributes
https://github.com/fs02/embulk-parser-flexml
Last synced: over 1 year ago
JSON representation
Flexible xml parser for embulk - supports xpath and attributes
- Host: GitHub
- URL: https://github.com/fs02/embulk-parser-flexml
- Owner: Fs02
- License: mit
- Created: 2021-11-15T14:43:52.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-17T12:59:19.000Z (over 4 years ago)
- Last Synced: 2024-09-23T10:47:41.570Z (almost 2 years ago)
- Language: Ruby
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# embulk-parser-flexml
Parser plugin for [Embulk](https://github.com/embulk/embulk).
Flexible xml parser for embulk. read data using xpath and from attributes
* **Plugin type**: parser
* **Load all or nothing**: yes
* **Resume supported**: no
## Configuration
- **type**: specify this plugin as `flexml` .
- **root**: root property to start fetching each entries, specify in *path/to/node* style (string, required)
- **schema**: specify the attribute of table and data type (required)
- **name**: name of the attribute (string, required)
- **type**: type of the attribute (string, required)
- **attribute**: if specified, value of this attribute will be the output, otherwise child will be the output (string, optional)
- **xpath**: child element to select (string, required)
- **format**: timestamp format to parse (string, required)
- **timezone**: timestamp will be parsed in this timezone (string, optional)
## Example
### Configuration
```yaml
parser:
type: flexml
root: Team/Players/Player
schema:
- { name: name, type: string, attribute: name }
- { name: age, type: long, attribute: age }
- { name: about, type: string, xpath: About }
- { name: facebook, type: string, xpath: "SocialMedia[@type='facebook']", attribute: url }
- { name: twitter, type: string, xpath: "SocialMedia[@type='twitter']", attribute: url }
```
### XML
```xml
Manuel Locatelli Cavaliere OMRI (born 8 January 1998) is an Italian professional footballer who plays as a midfielder for Serie A club Juventus, on loan from Serie A club Sassuolo, and the Italy national team.
```