Invalid XDocument is getting validated

后端 未结 1 1433
野性不改
野性不改 2021-01-28 07:20

I have following xml schema




        
相关标签:
1条回答
  • 2021-01-28 07:54

    The issue is that both cases 2 and 3 are valid per the schema - your schema doesn't have any opinion on elements in namespaces other than its targetNamespace.

    XmlReader can return a warning for this, but there's no overload for XDocument that will do it. The snippet in your linked question uses an XmlReader wrapper around XDocument, I can't see why you'd have any issue with doing it this way.

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