Comments (4)
I reduced this down to this failure:
faq <<EOF
<p>
<span>something</span>
text here
</p>
EOF
Error: failed to encode as: invalid attribute key label: #text - due to attributes not being prefixed
...
Here's the upstream error in the XML library we're using: https://github.com/clbanning/mxj/blob/13245dc365b0de3547c9845087941f04817e7936/xml.go#L1125-L1131
Taking a deeper look in a bit.
from faq.
This also looks like wrong behavior:
faq <<EOF
<p>
text here
<span>something</span>
</p>
EOF
<p>text here</p>
from faq.
The author fixed this issue upstream.
I updated the dependency, and discovered another upstream bug by running it through the same document: clbanning/mxj#91
Right now that specific document parses fine, can get jq expressions ran on it, but cannot be converted back into XML.
# Blocked on #91
curl -s https://www.govinfo.gov/bulkdata/CFR/2020/title-14/CFR-2020-title14-vol2.xml | ./faq
Error: failed to encode as pretty: xml.Decoder.Token() - XML syntax error on line 1: invalid character entity & (no semicolon)
# Works
curl -s https://www.govinfo.gov/bulkdata/CFR/2020/title-14/CFR-2020-title14-vol2.xml | ./faq -o json | head
{
"CFRDOC": {
"-noNamespaceSchemaLocation": "CFRMergedXML.xsd",
"-xsi": "http://www.w3.org/2001/XMLSchema-instance",
"AMDDATE": "Jan. 1, 2020",
"BMTR": {
"ALPHLIST": {
"AGENCY": [
"Administrative Conference of the United States",
"Advisory Council on Historic Preservation",
from faq.
Ok both of these got fixed in fb4f6a4 and 7f3a418
from faq.
Related Issues (20)
- Mac executable is not statically linked HOT 4
- Windows Build..?
- bencode output strangeness
- "raw output" fails to encode HOT 7
- CSV HOT 7
- Explore gojq instead of linking to libjq HOT 1
- error: expected specifier-qualifier-list before 'jv' jv p1; HOT 4
- ARM builds for CI
- faq with no args blocks forever, while jq prints usage
- Investigate goreleaser
- supporess the root tags when outputting with custom format string HOT 3
- Bypass XML decoding errors
- non-zero exit code on errors
- first example doesn't work HOT 1
- String length expressed as byte or character count for bencode HOT 3
- JSON to Bencode issues?
- collect2: error: ld returned 1 exit status HOT 2
- Explore more performant JSON libraries
- What happened to 0.0.8? HOT 2
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 faq.