XMLDocument.Save adds return carriages to XML when elements are blank

后端 未结 3 1421
刺人心
刺人心 2021-01-08 01:43

I\'m loading a XML Document that has some tags that have no innertext.

If I populate the innertext with some data then it works as needed (you get opening tag, inner

3条回答
  •  一整个雨季
    2021-01-08 02:04

    You control that through the XMLWriter within the Settings Property.

    Check out this example along with the following references. http://msdn.microsoft.com/en-us/library/ms162618.aspx

    Refernces http://msdn.microsoft.com/en-us/library/system.xml.xmlwriter.aspx http://msdn.microsoft.com/en-us/library/system.xml.xmlwritersettings.aspx http://msdn.microsoft.com/en-us/library/system.xml.xmlwritersettings.newlinehandling.aspx

提交回复
热议问题