Build xml based on xml schema in Node.js

扶醉桌前 提交于 2019-12-02 05:55:31

问题


Is there any easy way to create XML based on XML schema in Node.js? Currently I see modules like xmlbuilder that does help in creating XML from scratch ( does not follow schema). I want something high level, based on XML schema /XSD which will help in creating xml. Like POJOs are created based on XSD and now easy to populate POJOs and then create XML.

Thanks for any hints...


回答1:


I am the author of Jsonix which is a powerful schema-driven XML<->JS converter, working in Node.js as well as in browsers.

See this answer for a complete example:

  • XML parser for JavaScript

Schema-driven means that you can take an XML Schema and generate Jsonix mappings out of it. You can then serialize your JSON data conforming to the original XML Schema or unmarshal XML in that schema. Jsonix considers types and structures of the schema.



来源:https://stackoverflow.com/questions/29367474/build-xml-based-on-xml-schema-in-node-js

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