Comments (3)
As an idea, parsing could be offloaded to a tool like himalaya or html-parse-stringify or similar, and then all you need to do is to pipe the result to jq
like you already do for other tools 🙂
from yq.
Thanks for your interest. I probably will not support this. For XML, I rely on https://github.com/martinblech/xmltodict, which uses expat, which does not do well parsing HTML. I am unlikely to switch away from xmltodict, and I value its use of expat (because it's in the Python standard library). (In addition, I am likely to discontinue tq
, because I find TOML not to be useful and am not aware of many users.)
You might consider using LXML to parse your HTML, then adapting xmltodict to use it, or use LXML's suggested recipe: https://lxml.de/FAQ.html#how-can-i-map-an-xml-tree-into-a-dict-of-dicts. If you find an elegant way to integrate that on top of yq, with LXML as an optional dependency, I'd be open to a PR.
from yq.
There is also https://github.com/sibprogrammer/xq
from yq.
Related Issues (20)
- A scalar starting with 00 (double zero) is interpreted as octal number HOT 2
- Use python built in TOML support? HOT 4
- [xq] Parse optional schema (xsd) file to determine the types for better json output HOT 1
- Array indexing diverges from jq syntax HOT 3
- Some advice about license compliance HOT 1
- Parsing nmap's XML: single script node into object, multiple script nodes into array HOT 4
- add `fromyaml` like jqs `fromjson` HOT 3
- tomlq throws TypeError on documents containing date-time values HOT 1
- test output too noisy HOT 1
- order of parameters changes behavior HOT 1
- Add indentation & improve sorting of TOML output HOT 4
- Python 3.6 installation from PyPI broken HOT 4
- XML streaming mode HOT 2
- ConstructorError: found unconstructable recursive node HOT 2
- Tests fail with a variety of errors: argparse.ArgumentError: argument files: can't open '/dev/fd/3': [Errno 2] No such file or directory: '/dev/fd/3', etc HOT 1
- xml: is keeping the namespace possible? HOT 1
- Test fails with jq-1.7 HOT 1
- Ubuntu 23.04 disallows `pip install yq` by default HOT 2
- output string '08' and '09' without quote using yaml output format HOT 1
- xq no longer outputting JSON HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yq.