开发者

how to generate sample xml from xsd runtime

开发者 https://www.devze.com 2023-04-03 05:30 出处:网络
I am working on a web application. In that I am having a xsd file and I want to generate xml files ru开发者_如何转开发ntime which follows the given xsd file.

I am working on a web application. In that I am having a xsd file and I want to generate xml files ru开发者_如何转开发ntime which follows the given xsd file.

As it is web application, using IDE's like eclipse, etc. for xml file generation are not helpful.

I tried jaxb but it generates java classes which I can use to generate xml but that is also not helpful on web.

xmlspy & oxygen tools I don’t want to use as they are not freeware.

I heard xsd.exe tool will do that but I don’t know how to use it.

I want to generate xml files from xsd runtime like on a click of button or by submitting a form in GUI. Please help me.

Thanks


The XML Schema Definition Tool (Xsd.exe) is, I believe, intended to generate an XSD from XML not the other way around, or a least I cannot see anything documented for this. It will generate source code for you also, but this cannot really be done dynamically with any schema and then used at runtime without knowledge of the schema.

I have generated classes before from an XSD using the xsd.exe tool. Then used the generated class objects to create the XML. The major issue with this is managing the change of schema versions.


you can try Generating Sample XML for given XMLSchema from jlibs project

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号