简体   繁体   English

Java | 从Xsd和变量生成Xml

[英]Java | Generate Xml from Xsd and Variables

In Java i like to generate a XML-String. 在Java中,我喜欢生成XML-String。 As input there exists an XSD-file and corresponding variables. 作为输入,存在一个XSD文件和相应的变量。 How to accomplish this? 如何做到这一点?

It would be nice to validate the resulting XML backwards against the XSD (eg if some variables are missing or containing invalid values). 最好针对XSD向后验证生成的XML(例如,如果缺少某些变量或包含无效值)。

Is there a way to do this with XMlBeans/Xalan/Xerces? 有没有办法用XMlBeans / Xalan / Xerces做到这一点?

我知道XMLSpy可以从XSD / DTD生成示例XML文件,但是它不是免费的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM