Revision [1691]
This is an old revision of CommandXml2json made by DavidLee on 2011-02-03 05:59:45.
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