sai1919 / xml-streamer Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Parsing xml nodes that contains text with new lines results in a text with no new lines.
The cause seems to be that the processText function ignores fully blank strings.
However, the expat parser doc states that : "A single block of contiguous text free of markup may still result in a sequence of calls to this handler."
The expat code seems to break for new lines and for entities. So I suppose "blank" entities will also be lost.
What about a new parsing option to preserve all text ?
Trying to parse xml file that contains multi-byte chars sometime results in a character being replaced with two invalid characters in text nodes (and potentially other).
The cause is probably the boundary of chunks when reading the file, that split a two (or more) bytes char.
Please do note that there is security advisory for the version of lodash this package uses: https://www.npmjs.com/advisories/1065
When the root node is not matched, XmlStreamer will prematurely close. If using pipe, this leaves the input stream partially consumed and unclosed, requiring extra code for cleanup.
var file = fs.createInputStream('file_without_a.xml');
var streamer = new XmlStreamer({
resourcePath: '/a'
});
file.stream(streamer);
// extra code required to close file in case the root tag did not match
Hey @Sai1919, thanks for taking care of the dependency updates. Would it be possible to release 2.0.0 on npm? This would help us getting rid of dependabot security issues.
Kind regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.