Giter VIP home page Giter VIP logo

Comments (8)

amitguptagwl avatar amitguptagwl commented on May 17, 2024

let me check

from fast-xml-parser.

amitguptagwl avatar amitguptagwl commented on May 17, 2024

What if I close submission tag in above sample XML and then validate?

from fast-xml-parser.

amitguptagwl avatar amitguptagwl commented on May 17, 2024

closing as no update. Please reopen if you fell there is any issue.

from fast-xml-parser.

issa-tseng avatar issa-tseng commented on May 17, 2024

So perhaps I misunderstand what validate() is meant to do, then. In your sample code it seems to return a boolean indicating if the XML is valid. If it crashes on invalid XML does that mean I also have to try/catch it?

from fast-xml-parser.

amitguptagwl avatar amitguptagwl commented on May 17, 2024

It should return return false only. if it is throwing error there may be some case to cover.

from fast-xml-parser.

issa-tseng avatar issa-tseng commented on May 17, 2024

Right, so that's exactly what's happening. I simplified the case:

> fxp.validate('<a><b/>');
TypeError: Cannot read property '0' of undefined
    at checkForMatchingTag (/Users/cxlt/Code/opendatakit/jubilant/node_modules/fast-xml-parser/bin/validator.js:76:51)
    at Object.exports.validate (/Users/cxlt/Code/opendatakit/jubilant/node_modules/fast-xml-parser/bin/validator.js:16:18)
    at repl:1:5
    at ContextifyScript.Script.runInThisContext (vm.js:50:33)
    at REPLServer.defaultEval (repl.js:240:29)
    at bound (domain.js:301:14)
    at REPLServer.runBound [as eval] (domain.js:314:12)
    at REPLServer.onLine (repl.js:441:10)
    at emitOne (events.js:121:20)
    at REPLServer.emit (events.js:211:7)

from fast-xml-parser.

amitguptagwl avatar amitguptagwl commented on May 17, 2024

I got your point now. I have fixed it. Sorry for the confusion.

from fast-xml-parser.

issa-tseng avatar issa-tseng commented on May 17, 2024

No problem; thanks!

from fast-xml-parser.

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.