Hi,
I am trying to serialize a DOM document into XML file using OutputFormat.
I like to have the empty text content tags like <name></name>. But the serializer writes like <name/>. Is there a way I can make it write it in the desired manner?
Below is the serializer & formatter classes -
Below method is what i use -
Sample xml output
Thank you!
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 11862
posted
1
According to the XML standard, both forms are equivalent - no properly written XML processing program should notice the difference.
Allowing users to edit XML in a text editor is also a design error. It isn't difficult for them to make the document non-well-formed. So give them a proper XML editor, and your empty-element problem will also cease to exist.
John Jai
Rancher
Joined: May 31, 2011
Posts: 1372
posted
0
Okay... Thanks Billy and Paul
subject: Preserving empty elements in XMLSerializer