Last active
April 8, 2018 02:48
-
-
Save hannestyden/7852317091e8712fc1f190622f164f5e to your computer and use it in GitHub Desktop.
XML to JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert XML to JSON | |
# | |
# Usage: | |
# x2j source_path [xsltjson parameters](https://github.com/bramstein/xsltjson#parameters) | |
# | |
# Reads from standard in if `source_path` set to `-`. | |
x2j() { | |
local base | |
base=src/github.com/bramstein/xsltjson | |
# A checkout of https://github.com/bramstein/xsltjson must be available at `$base`. | |
source_path=$1 | |
shift | |
java -classpath $base/lib/saxon/saxon9.jar net.sf.saxon.Transform $source_path $base/conf/xml-to-json.xsl $@ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example usage: