xml2json
xml to json and json to xml convert
Details
Installs
- Total 47K
- Win 26K
- Mac 15K
- Linux 6K
| Apr 26 | Apr 25 | Apr 24 | Apr 23 | Apr 22 | Apr 21 | Apr 20 | Apr 19 | Apr 18 | Apr 17 | Apr 16 | Apr 15 | Apr 14 | Apr 13 | Apr 12 | Apr 11 | Apr 10 | Apr 9 | Apr 8 | Apr 7 | Apr 6 | Apr 5 | Apr 4 | Apr 3 | Apr 2 | Apr 1 | Mar 31 | Mar 30 | Mar 29 | Mar 28 | Mar 27 | Mar 26 | Mar 25 | Mar 24 | Mar 23 | Mar 22 | Mar 21 | Mar 20 | Mar 19 | Mar 18 | Mar 17 | Mar 16 | Mar 15 | Mar 14 | Mar 13 | Mar 12 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 3 | 1 | 0 | 5 | 2 | 3 | 0 | 0 | 0 | 4 | 2 | 4 | 4 | 1 | 1 | 3 | 4 | 1 | 1 | 1 | 2 | 1 | 1 | 4 | 2 | 5 | 5 | 0 | 1 | 3 | 6 | 4 | 8 | 3 | 1 | 1 | 3 | 5 | 1 | 3 | 1 | 1 | 1 | 3 | 2 |
| Mac | 0 | 2 | 0 | 2 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 2 | 1 | 4 | 2 | 2 | 1 | 0 | 3 | 3 | 2 | 0 | 0 | 3 | 1 | 3 | 0 | 0 | 1 | 2 | 0 | 1 | 0 | 1 | 2 | 1 | 1 | 1 | 1 | 2 | 2 | 4 | 0 | 0 | 2 | 3 |
| Linux | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 3 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 2 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
Readme
- Source
- raw.githubusercontent.com
Sublime xml to json and json to xml
convert xml file to json file or json file to xml file.
Installation:
- you should use sublime package manager
- use
cmd+shift+PthenPackage Control: Install Package - look for
xml2jsonand install it. - OR, Clone or unpack to “xml2json” folder inside “Packages” of your Sublime installation.
Usage :
- use
cmd+shift+Pthenxml2jsonorjson2xml(opens result in a new unsaved buffer) - use
cmd+shift+Pthenxml2json (Save to file)orjson2xml (Save to file)to save next to the source file (e.g.abc.xml->abc.json,abc.json->abc.xml); if the target exists you will be asked whether to overwrite, and choosing not to overwrite leaves the result in an unsaved buffer - use
cmd+shift+PthenPretty JSON,Pretty XML,Compact JSONorCompact XMLto format the current buffer without saving - or goto menubar
Toolsthenxml2json - or bind some key in your user key binding:
{
"keys": ["ctrl+alt+shift+j"],
"command": "xml2json"
},
{
"keys": ["ctrl+alt+shift+l"],
"command": "json2xml"
}
Settings
empty_tag_style: how empty tags are written when generating XML.compact(<tag/>, default),spaced(<tag />),expanded(<tag></tag>).pretty_json_indent: indentation size for pretty JSON (default2).pretty_xml_indent: indentation size for pretty XML (default2).default_conversion_pretty: whether conversion commands default to pretty (true/"pretty") or compact (false/"compact"); defaulttrue.json_ensure_ascii: whether to escape non-ASCII when emitting JSON (defaultfalse).json_sort_keys: whether to sort keys when emitting JSON (defaultfalse).normalize_attribute_text_pairs: when converting XML to JSON, convert simple attribute/text pairs (e.g.,{"@name": "...", "#text": "..."}) into{name: "...", value: "..."}(defaulttrue).attribute_text_value_key: key name to store text content whennormalize_attribute_text_pairsis enabled (default"value").default_xml_root_name: fallback root element name when wrapping JSON that lacks a single root (default"root").include_xml_declaration: include<?xml version="1.0" encoding="utf-8"?>when converting JSON to XML (defaulttrue).line_ending: line endings for generated output:auto(preserve from source),unix(\n),windows(\r\n),mac(\r) (defaultauto).ensure_final_newline: ensure generated output ends with a newline (defaulttrue).trim_trailing_whitespace: trim trailing spaces/tabs on generated lines (defaulttrue; removes spaces after commas in pretty JSON).
You can adjust plugin settings and shortcuts via Sublime Text -> Settings -> Package Settings -> xml2json -> Settings and Key Bindings.