vontio / sublime-xml2json Goto Github PK
View Code? Open in Web Editor NEWxml to json and json to xml convert
xml to json and json to xml convert
Is there any way which can specify the prefix for attributes while converting XML to JSON. Right now "@" is used as default prefix, is there some settings which can provide different prefix, which can be used while conversion.
Thank you.
It would be nice if, after conversion, the elements were in the same order.
Tried installing xml2json on sublime text 3. Immediately, I received the error mentioned above. There is no module UserDict in Sublime Text 3. I am not sure if there is an easy workaround for this. Or even if it is a major problem. I have not tried using the plugin, just noticed the error.
Here is the console listing for the error:
reloading plugin xml2json.ordereddict
Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 109, in reload_plugin
m = importlib.import_module(modulename)
File "./python3.3/importlib/init.py", line 90, in import_module
File "", line 1584, in _gcd_import
File "", line 1565, in _find_and_load
File "", line 1532, in _find_and_load_unlocked
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 915, in load_module
exec(compile(source, source_path, 'exec'), mod.dict)
File "ordereddict in C:\Users\rjsha\AppData\Roaming\Sublime Text 3\Installed Packages\xml2json.sublime-package", line 23, in
ImportError: No module named 'UserDict'
reloading plugin xml2json.Xml2json
reloading plugin xml2json.xmltodict
It appears that other portions load without the orderredict.py file. Can you advise? Running on:
Windows 10 Version 1703, Build 15063.674
Sublime Text 3.0, Build 3143 64 bit
It looks like this is running a Python 3.3 subset
I am sorry, but do not have time now to go through the code to find a solution to this error I am getting. Thanks.
Hi, I see that converting xml to json doesn't preserve even slightly exotic UTF8 characters, but converts them into \uXXXX format. For example...
é
becomes
\u00e9
Perhaps there's a way to preserve the original characters?
Note: I've tried using <?xml version='1.0' encoding='UTF-8'?>
at the top of my xml doc.
Also: It's the same on both Sublime 2 & 3.
Documentation might need some updating, or application might require more meaningful implementation
[
{
"keys": ["ctrl+alt+shift+j"],
"command": "xml2json pretty"
},
{
"keys": ["ctrl+alt+shift+l"],
"command": "json2xml pretty"
}
]
{
"keys": ["ctrl+alt+shift+j"],
"command": "xml2json",
"args":{
"pretty":true
}
}
{
"keys": ["ctrl+alt+shift+j"],
"command": "xml2json",
"pretty":true
}
{
"keys": ["ctrl+alt+shift+j"],
"command": "xml2jsonpretty"
},
{
"keys": ["ctrl+alt+shift+l"],
"command": "json2xmlpretty"
}
{
"keys": ["ctrl+alt+shift+j"],
"command": "xml2json",
"args": {
"pretty": true
}
}
Not sure whats wrong here, its basically a fresh install (via ubuntu universe 'sublime-text' package)
Traceback (most recent call last):
File "xmltodict in /home/developer/.config/sublime-text-3/Installed Packages/xml2json.sublime-package", line 201, in parse
TypeError: argument must have 'read' attribute
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "Xml2json in /home/developer/.config/sublime-text-3/Installed Packages/xml2json.sublime-package", line 19, in run
File "xmltodict in /home/developer/.config/sublime-text-3/Installed Packages/xml2json.sublime-package", line 205, in parse
xml.parsers.expat.ExpatError: junk after document element: line 151, column 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 549, in run_
return self.run(edit)
File "Xml2json in /home/developer/.config/sublime-text-3/Installed Packages/xml2json.sublime-package", line 22, in run
AttributeError: 'ExpatError' object has no attribute 'message'
Traceback (most recent call last):
File "xmltodict in /home/developer/.config/sublime-text-3/Installed Packages/xml2json.sublime-package", line 201, in parse
TypeError: argument must have 'read' attribute
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "Xml2json in /home/developer/.config/sublime-text-3/Installed Packages/xml2json.sublime-package", line 19, in run
File "xmltodict in /home/developer/.config/sublime-text-3/Installed Packages/xml2json.sublime-package", line 205, in parse
xml.parsers.expat.ExpatError: junk after document element: line 151, column 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 549, in run_
return self.run(edit)
File "Xml2json in /home/developer/.config/sublime-text-3/Installed Packages/xml2json.sublime-package", line 22, in run
AttributeError: 'ExpatError' object has no attribute 'message'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.