Parsing XML in a Web Worker

风流意气都作罢 提交于 2019-11-29 10:34:59
Mathieu

according to the spec

The DOM APIs (Node objects, Document objects, etc) are not available to workers in this version of this specification.

I guess thats why DOMParser is not availlable, but I don't really understand why that decision was made. (fetching and processing an XML document in a WebWorker does not seems unreasonnable)

but you can import other tools available: a "Cross Platform XML Parsing in JavaScript"

At this point I like to share my parser: https://github.com/tobiasnickel/tXml

with its tXml() method you can parse a string into an object and it takes only 0.5kb minified + gzipped

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!