Using .NET to validate XML against a schema

后端 未结 1 1357
不思量自难忘°
不思量自难忘° 2020-12-30 09:52

I want to test (true or false) whether an arbitrary XML file matches a given schema.

For what it\'s worth, the schema is the Word 2003 WordML schema, which Microsoft

相关标签:
1条回答
  • 2020-12-30 10:34

    We can't see your code, but In many implementations this is handled by redirecting the request for the .xsd to the local copy using a catalog resolver. There is a property XmlReaderSettings.XmlResolver that can be used for this. See XMLCatalog.net for an Apache-licensed implementation you can use.

    A side-effect of this is that you can keep all schemas cached locally. This is especially important since W3C will block excessive reads to their site and randomly your code (or worse, your customer's code) will begin to fail.

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