如何删除XSI:无=“真正使用的XMLBeans

问题描述:

在使用的XMLBeans生成XML,如何删除XSI:无=“真正使用的XMLBeans

xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"得到 插入

例如:

<element xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 

但我只需要<element/>

请建议。 在此先感谢。

我只能建议把一个空的(默认)值在二传手,留下空将导致未缴的东西,另一种方法是,你可以删除nil属性:

xnode.RemoveAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance"); 

其中xnode是具有零值的节点。

希望可以帮到