Giter Club home page Giter Club logo

sublime-xml2json's People

Contributors

twidi avatar vontio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sublime-xml2json's Issues

Option to provide attribute prefix.

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.

Ordering

It would be nice if, after conversion, the elements were in the same order.

ImportError (No module named 'UserDict') in Python 3

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.

Preserving UTF characters

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.

Setting Keybindings to Pretty Output

Documentation might need some updating, or application might require more meaningful implementation

Doesn't Work

Mimicing Command Palette

[
  {
    "keys": ["ctrl+alt+shift+j"],
    "command": "xml2json pretty"
  },
  {
    "keys": ["ctrl+alt+shift+l"],
    "command": "json2xml pretty"
  }
]

Setting args

{
   "keys": ["ctrl+alt+shift+j"],
   "command": "xml2json",
   "args":{
     "pretty":true
   }
 }

Setting Property

  {
    "keys": ["ctrl+alt+shift+j"],
    "command": "xml2json",
    "pretty":true
  }

Does Work

Concatenating Command

  {
    "keys": ["ctrl+alt+shift+j"],
    "command": "xml2jsonpretty"
  },
  {
    "keys": ["ctrl+alt+shift+l"],
    "command": "json2xmlpretty"
  }

Expected Interface

Set via Args

  {
    "keys": ["ctrl+alt+shift+j"],
    "command": "xml2json",
    "args": {
       "pretty": true
    }
  }

ST3 - LinuxMint 17 (Ubuntu 14)

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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.