开发者

Can I load an XmlDocument without validation?

is it possible to load an XmlDocument like XDocument.Load(myXmlFile) with开发者_JAVA百科out validating the document? I would like to do the validation myself later.


Validating XML refers to checking whether the schema maps to the xml data.

XML still has be well-formed in order for it to be loaded into the XmlDocument as it parses the xml into an internal structure.


Take a look at the XmlReaderSettings Class which has properties used to control things like validation. There's no one-size-fits-all answer for turning off validation, as there are different things one may wish to turn off, so browse the object's properties to see what you need. This answer is an example of using the XmlReaderSettings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜