XML DeSerialize - Possible to Trap Extra XML in File?

前端 未结 1 746
生来不讨喜
生来不讨喜 2021-01-26 15:50

Is there a way to trap the extra XML tags in a file that you did not anticipate in your class? For Example:

using System;
using System.Collections.Generic;
using         


        
相关标签:
1条回答
  • 2021-01-26 16:46

    I believe you can use XmlSerializer's UnknownAttribute, UnknownElement, etc. events to trap such cases.

    0 讨论(0)
提交回复
热议问题