shanahanjrs / xmltojson Goto Github PK
View Code? Open in Web Editor NEWCli tool and Python module to convert XML to JSON
License: Apache License 2.0
Cli tool and Python module to convert XML to JSON
License: Apache License 2.0
Hi.
This is crashing with "not well-formed (invalid token): line 1, column 67".
When I checked what is in inner html that I'm trying to parse, I find, that problems are in this line (yes, I modified it a bit, so it becomes user-friendly):
<h1 class="the_class"><a href="/the_link.html" title="The title is <So important>">And some text here</a></h1>
-----------------------------------------------------------------^
And error links us to where "is" ends.
If I'm correct, fail is because there, on page, someone named title with "<" and ">", so it triggers on it as on new tag and wants me to fix things that there should be something like:
...="The title is" <So
Or something like that.
Is there some way to make it think that anyway there should not be any tags inside "the quotes", even if there are some "<" and ">" inside?
PS At the moment I can just remove title part, but... how soon I will find that "<" and ">" are in part that I need?
$ pip3 install xmltojson
Collecting xmltojson
Using cached xmltojson-0.1.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/8t/b6yfjsvs5nqf44jcyfppm7bw0000gn/T/pip-build-eoo9ou1o/xmltojson/setup.py", line 2, in <module>
import xmltojson
File "/private/var/folders/8t/b6yfjsvs5nqf44jcyfppm7bw0000gn/T/pip-build-eoo9ou1o/xmltojson/xmltojson.py", line 21, in <module>
import xmltodict
ModuleNotFoundError: No module named 'xmltodict'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/8t/b6yfjsvs5nqf44jcyfppm7bw0000gn/T/pip-build-eoo9ou1o/xmltojson/
You can't import xmltodict
in setup.py
:) because it is not installed yet
I might be able to send a PR when I have time.
Hi, #3 was closed and I didn’t find a way to re-open it, but the bug is still present.
$ pip3.11 show xmltojson
Name: xmltojson
Version: 2.0.2
Summary: A Python module and cli tool to quickly convert xml text or files into json
Home-page: https://github.com/shanahanjrs/xmltojson
Author: John Shanahan
Author-email: [email protected]
License: Apache-2.0
Location: /home/me/.local/lib/python3.11/site-packages
Requires: xmltodict
Required-by:
$ xmltojson --version
Traceback (most recent call last):
File "/home/me/.local/bin/xmltojson", line 5, in <module>
from xmltojson.scripts.cli import main
File "/home/me/.local/lib/python3.11/site-packages/xmltojson/scripts/cli.py", line 7, in <module>
import utils
ModuleNotFoundError: No module named 'utils'
Python 3.7.2 (v3.7.2:9a3ffc0492, Dec 24 2018, 02:44:43)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import xmltojson
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/xmltojson.py", line 23, in
import utils
ModuleNotFoundError: No module named 'utils'
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.