Comments (8)
let me check
from fast-xml-parser.
What if I close submission tag in above sample XML and then validate?
from fast-xml-parser.
closing as no update. Please reopen if you fell there is any issue.
from fast-xml-parser.
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.
It should return return false only. if it is throwing error there may be some case to cover.
from fast-xml-parser.
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.
I got your point now. I have fixed it. Sorry for the confusion.
from fast-xml-parser.
No problem; thanks!
from fast-xml-parser.
Related Issues (20)
- Validation of invalid XML declarations HOT 6
- Validation of multiple root elements
- Parsing an invalid XML element
- isArray behavior on missing/empty tags HOT 1
- TypeError: Cannot read properties of undefined (reading 'tagName') when parsing closing tag without an opening tag at the start of XML document HOT 3
- V3 to V4 migration guide? HOT 5
- Circular Dependency Error While trying to validate xml HOT 3
- Online demo does not handle DOCTYPE correctly and gives an error HOT 2
- Regex Injection Via Doctype Entities HOT 4
- unreliable for parsing html HOT 2
- Introduce isObject option for unpaired tags HOT 2
- Parsing of Empty Tags HOT 4
- Entities are being processed in CDATA sections HOT 1
- Attribute in oneListGroup is not parsed correctly HOT 1
- All special characters are not correctly parsed HOT 4
- Ability to read & write DOCTYPE information HOT 2
- parser malfunctions when textNodeName is the same as a tag name HOT 8
- Node attributes get lost on XML parsing HOT 1
- Decimal point is not preserved after parsed to json. HOT 6
- Difficulty treating some numeric tags as string 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 fast-xml-parser.