0

While using XMLBeans to generate XML ,

xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" gets inserted.

For example :

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

But i need only <element/>

Please suggest . Thanks in advance.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
John
  • 125
  • 1
  • 3
  • 12

1 Answers1

1

I can only suggest putting an empty (the default) value in the setter, leaving it null will result the nil thing, other way is that you can remove the nil attribute:

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

where xnode is the node that has the nil value.

hope that helps

WiredCoder
  • 916
  • 1
  • 11
  • 39