Wiki source for CommandXml2json


Show raw source

======Command xml2json======

====Name====
**json2xml** converts a JSON file to an xml file using the [[http://xml.calldei.com/JsonXML JXML schema]].

====Synopsis====
xml2json[ [[SerializationOptions serialization options]] [options] ] [xml file]


====Options====

||-p,-print||Pretty Print the JSON output||


Supports the standard [ [[SerializationOptions serialization options]] ]

If no file is specified then stdin is read.




====Examples====

Example

Assuming an input file json.xml
%%(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>

%%

%%(shell)
xml2json -p json.xml
%%

Result
%%
{
"foo":
[true,null,1.23,
{
"bar":"spam"
}]
}
%%


====Return Value====
Returns 0 if the conversion is successful
----
See [[CommandJson2xml json2xml]]
[[Commands]]
[[CategoryCommands]]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki