Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.7k views
in Technique[技术] by (71.8m points)

json - Build xml based on xml schema in Node.js

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...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...