Build xml based on xml schema in Node.js

2019-02-26 06:40发布

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条回答
老娘就宠你
2楼-- · 2019-02-26 07:12

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:

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.

查看更多
登录 后发表回答