Code Monkey home page Code Monkey logo

Comments (4)

jzelinskie avatar jzelinskie commented on May 30, 2024

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.

polvi avatar polvi commented on May 30, 2024

This also looks like wrong behavior:

faq <<EOF
<p>
  text here
  <span>something</span>
</p>
EOF
<p>text here</p>

from faq.

jzelinskie avatar jzelinskie commented on May 30, 2024

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.

jzelinskie avatar jzelinskie commented on May 30, 2024

Ok both of these got fixed in fb4f6a4 and 7f3a418

from faq.

Related Issues (20)

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.