Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oleksiyp/xml-grep

XML grep tool.
https://github.com/oleksiyp/xml-grep

Last synced: about 1 month ago
JSON representation

XML grep tool.

Awesome Lists containing this project

README

        

h1. XML grep tool

h2. Commandline usage


Argument "file/url" is required
java -jar xmlgrep.jar [options...] file/url entryPath [matchesField...]
file/url : File or URL to parse
entryPath : Period('.') separated path to the
element where xml extraction starts e.g.
'ROOT Element'.'subelement'.'subsubelemen
t'
matchesField : Pairs field=value to match field(which
is indeed path inside entry) and value -
value to match
-c (--contain) field=value : Matches text
-ec (--exclude-contain) field=value : Does not match text
-em (--exclude-match) field=value : Does not contains text
-ep (--exclude-pattern) field=value : Does not match pattern
-m (--match) field=value : Contains text
-of (--output-format) VAL : Output format - any expression like:
"#{value1} #{subelement.value2}"
-ot (--output-type) VAL : Type of output: text, xml, json
-p (--pattern) field=value : Match pattern

h3. Example1

Gets dependecies from pom file.


java -jar xmlgrep-1.0.jar pom.xml project.dependencies.dependency -of "#{groupId}:#{artifactId}:#{version}"

h3. Example2

Gets entries from virus database. Searching dropbox or hotfile


java -jar xmlgrep-1.0.jar http://support.clean-mx.de/clean-mx/xmlviruses.php output.entries.entry -of "#{domain} #{ip}" -c domain=dropbox -c domain=hotfile

h3. Example3

Gets entries from virus database. Searching domain contains dropbox and virusname contains Dropper.


java -jar xmlgrep-1.0.jar http://support.clean-mx.de/clean-mx/xmlvirusephp output.entries.entry -of "#{domain} #{ip} #{virusname}" -c domain=dropbox,virusname=Dropper

h3. Example4

Gets entries from virus database. Searching ip matches the pattern "64\.120\.227\.\d+"


java -jar xmlgrep-1.0.jar http://support.clean-mx.de/clean-mx/xmlvirusephp output.entries.entry -of "#{domain} #{ip} #{virusname}" -p ip=64\.120\.227\.\d+