开发者

How can I customize the ending node style while saving an XmlDocument?

Simply put, after calling XmlDocument.Save method, I want the resulting xml look like this:

<somenode />

instead of this:

<somenode></somenode>

Can I achieve this?

I don't think how I constructed the XmlDocument matters. I just have such an instance, make开发者_C百科 some changes and save it. I want to know if it's possible to control the formatting for empty node.

Thanks, Nico


It's done automatically for elements that have no child elements, and it's illegal for elements that have child elements... so I'm not sure what you're trying to do here.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜