开发者

XMLWriter () Replace blank strings

开发者 https://www.devze.com 2023-02-16 09:56 出处:网络
I am usi开发者_StackOverflow社区ng XMLWriter to create an XML output of my MySQL Database, and I would like to know how I could prevent this happening <hello></hello> by doing this <hel

I am usi开发者_StackOverflow社区ng XMLWriter to create an XML output of my MySQL Database, and I would like to know how I could prevent this happening <hello></hello> by doing this <hello>nil</hello>

So basically replace "" with "nil".


<hello></hello> is proper for indicating an empty node in XML; the other way is <hello />. Replacing with nil means it's no longer an empty node; it's a node with the text content nil.

If you do that replacement, you're changing the meaning of the data in the XML. This is a terrible idea.

0

精彩评论

暂无评论...
验证码 换一张
取 消