
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
embulk-parser-xpath2
Advanced tools
Embulk parser plugin for parsing xml data by XPath perfectly!
"xpath2"
(string, required)false
)parser:
type: xpath2
root: '/ns1:root/ns2:entry'
schema:
- { path: 'ns2:id', name: id, type: long }
- { path: 'ns2:title', name: title, type: string }
- { path: 'ns2:meta/ns2:author', name: author, type: string }
- { path: 'ns2:date', name: date, type: timestamp, format: '%Y%m%d' }
- { path: 'ns2:ratings/ns2:rating[@by="subscribers"]', name: ratings, type: json }
namespaces: {ns1: 'http://example.com/ns1/', ns2: 'http://example.com/ns2/'}
Then you can fetch entries from the following xml:
<?xml version="1.0"?>
<ns1:root
xmlns:ns1="http://example.com/ns1/"
xmlns:ns2="http://example.com/ns2/">
<ns2:entry>
<ns2:id>1</ns2:id>
<ns2:title>Hello!</ns2:title>
<ns2:meta>
<ns2:author>maji-KY</ns2:author>
</ns2:meta>
<ns2:date>20010101</ns2:date>
<ns2:ratings>
<ns2:rating by="subscribers">1</ns2:rating>
<ns2:rating by="subscribers">2</ns2:rating>
<ns2:rating>3</ns2:rating>
</ns2:ratings>
</ns2:entry>
</ns1:root>
parser:
type: xpath2
root: '/ns1:root/ns2:entry'
schema:
- { path: 'ns2:id', name: id, type: long }
- path: 'ns2:list'
name: list
type: json
structure: # adding structure key to enabling complex json array column
- path: 'ns2:list'
name: list
type: array
- path: 'ns2:list/ns2:elements'
name: elements
type: array
- path: 'ns2:list/ns2:elements/ns2:name'
name: elementName
type: string
- path: 'ns2:list/ns2:elements/ns2:value'
name: elementValue
type: long
- path: 'ns2:list/ns2:elements/ns2:active'
name: elementActive
type: boolean
namespaces: {ns1: 'http://example.com/ns1/', ns2: 'http://example.com/ns2/'}
Then you can fetch entries from the following xml:
<?xml version="1.0"?>
<ns1:root
xmlns:ns1="http://example.com/ns1/"
xmlns:ns2="http://example.com/ns2/">
<ns2:entry>
<ns2:id>1</ns2:id>
<ns2:list>
<ns2:elements>
<ns2:name>foo1</ns2:name>
<ns2:value>1</ns2:value>
<ns2:active>true</ns2:active>
</ns2:elements>
<ns2:elements>
<ns2:name>foo2</ns2:name>
<ns2:value>2</ns2:value>
<ns2:active>false</ns2:active>
</ns2:elements>
</ns2:list>
<ns2:list>
<ns2:elements>
<ns2:name>bar1</ns2:name>
<ns2:value>3</ns2:value>
<ns2:active>true</ns2:active>
</ns2:elements>
</ns2:list>
</ns2:entry>
</ns1:root>
result of list
column:
{
"list": [
{
"elements": [
{
"elementActive": true,
"elementName": "foo1",
"elementValue": 1
},
{
"elementActive": false,
"elementName": "foo2",
"elementValue": 2
}
]
},
{
"elements": [
{
"elementActive": true,
"elementName": "bar1",
"elementValue": 3
}
]
}
]
}
$ ./gradlew gem
$ sbt benchmark/jmh:run
FAQs
Unknown package
We found that embulk-parser-xpath2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.