我正在使用X.Instance由in.jlibs提供使用Java从XSD生成XML并且它工作正常,但问题是当我将XSD转换为XML时,它会自动向生成的XML添加虚拟值。
示例: -
<Customer>
<Address>Address1</Address>
<Address2>Address21</Address2>
<Address3>Address31</Address3>
<Business_Unit>Business_Unit1</Business_Unit>
<City>City1</City>
</Customer>
这里Address1,Address21,Address31,Business_Unit1,City1是XSInstance在进行转换时添加的Dummy值,所以是否有任何解决方案只生成没有虚拟值的xml,如下所示。
<Customer>
<Address></Address>
<Address2></Address2>
<Address3></Address3>
<Business_Unit></Business_Unit>
<City></City>
</Customer>