Omitting XML processing instruction when serializing an object

前端 未结 6 1883
别那么骄傲
别那么骄傲 2020-12-14 23:44

I\'m serializing an object in a C# VS2003 / .Net 1.1 application. I need it serialized without the processing instruction, however. The XmlSerializer class puts out somethin

6条回答
  •  情话喂你
    2020-12-14 23:57

    In 2.0, you would use XmLWriterSettings.OmitXmlDeclaration, and serialize to an XmlWriter - however I don't think this exists in 1.1; so not entirely useful - but just one more "consider upgrading" thing... and yes, I realise it isn't always possible.

提交回复
热议问题