[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: contemporary XML parsing in JavaScript

  • From: "Liam R. E. Quin" <liam@fromoldbooks.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Fri, 02 Dec 2022 00:56:48 -0500

Re:  contemporary XML parsing in JavaScript
On Thu, 2022-12-01 at 16:25 -0500, Simon St.Laurent wrote:
> 
> "fast-XML-parser NPM package has more downloads/week (6 million) than
> Vue (3.4 million) or Angular (3 million)."

Good fined!


It might also suggest they do a lot of bug fixes, since node checks
often for new revisions. Or that there was a mistake that caused the
package to be downloaded every time node.js was started. Or that it's
fairly widely used :)

Checking
https://snyk.io/advisor/npm-package/fast-xml-parser
i see that 658 other projects depend on it. Also, i do notice a spike
of downloads after each release, but it's small compared to the total,
so that's not a major factor.

React.js gets nearly 17 million downloads per week, though, accordingto
that page, and xml-js gets over 14.

It's not a validating parser; the documentation says "DOCTYPE entities
are supported" and also "unpaired tags (Eg <br> in HTML), stop nodes
(Eg <script> in HTML) are supported"
See https://github.com/NaturalIntelligence/fast-xml-parser


The "validator" has an option, "allowBooleanAttributes" but doesn't
seem to have any reference to a DTD or external document type
definition: it's checking well-formedness:

   const xmlData = `<parent><extra></parent>`;
   const result = XMLValidator.validate( xmlData, {
     unpairedTags: ["extra"]
   });
   
Being able to "validate" this as XML is a violation of the XML
specification, but that doesn't mean it isn't useful.

The parser does not allow entity replacement text to contain &, and
also goes wrong (silently returns an incorrect result as XML) if there
is an unescaped & in the input.

So, it's moderately popular, widely used, a little buggy...
interestingly, it has some HTML entities built in such as &inr; for
Indian Rupee but not egrave etc.

It looks like they are actively working to improve it, and are aware
of, and admit to, its limitations, which is excellent.

liam

-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.