xml-flow NPM package - Unexpected XML Parsing Behaviour

拈花ヽ惹草 提交于 2019-12-02 07:59:57

Well! After going through the implementation of these packages, it seems there is no workaround for this problem (I might have missed something) unless explicit support is provided.

I finally decided to write a new logic & ended up writing a new npm package xtreamer which provides xml nodes instead of converting them into JSON objects.

This package exposes a transform stream that can be piped with any readable stream. It expects xml node name in request and emits a custom event xmldata to output the xml node.

The output can the be plugged in to any xml-json npm package as per the requirement to get the final JSON. Check the npm package for further details.

supporting module

I managed to create one more npm package xtagger which uses sax npm package and provides xml structure in following format -

structure: { [name: string]: { [hierarchy: number]: number } };

This package can be used to find the repeating nodes in xml file by considering their hierarchy.

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