I can never predict XMLReader behavior. Any tips on understanding?

后端 未结 2 1800
没有蜡笔的小新
没有蜡笔的小新 2021-01-17 10:07

It seems every time I use an XMLReader, I end up with a bunch of trial and error trying to figure out what I\'m about to read versus what I\'m reading versus what I just rea

2条回答
  •  鱼传尺愫
    2021-01-17 10:30

    Here's the thing... I've written a fair amount of serialization code (including a lot of xml processing), and I find myself in exactly the same boat as you. I have a very simple piece of guidance, therefore: don't.

    I'll happily use XmlWriter as a way to write xml quickly, but I'd walk over hot coals before choosing to implement IXmlSerializable another time - I'd simply write a separate DTO and map the data into that; it also means the schema (for "mex", "wsdl", etc) comes for free.

提交回复
热议问题