Command xml2json
Name
json2xml converts a JSON file to an xml file using the JXML schema.Synopsis
xml2json[ serialization options [options] ] [xml file]Options
-p,-print | Pretty Print the JSON output |
Supports the standard [ serialization options ]
If no file is specified then stdin is read.
Examples
Example
Assuming an input file json.xml
<object xmlns="http://www.xmlsh.org/jxml">
<member name="foo">
<array>
<boolean>true</boolean>
<null/>
<number>1.23</number>
<object>
<member name="bar">
<string>spam</string>
</member>
</object>
</array>
</member>
</object>
<member name="foo">
<array>
<boolean>true</boolean>
<null/>
<number>1.23</number>
<object>
<member name="bar">
<string>spam</string>
</member>
</object>
</array>
</member>
</object>
xml2json -p json.xml
Result
{ "foo": [true,null,1.23, { "bar":"spam" }] }
Return Value
Returns 0 if the conversion is successfulSee json2xml
Commands
CategoryCommands