jeudi 25 août 2016

How can I empty the schema cache?

I'm writing an automated test for a piece of code based on MSXML 6.0 that, in the process of validating XML, adds several schemas to the schema cache (by attaching an IXMLDOMSchemaCollection to a IXMLDOMDocument2).

Unfortunately these schemas seem to stick around even through reboots. To make sure that I'm adding the right schemas, I need the system to forget about these schemas before each test. Otherwise, the schemas may be in there just because my code succeeded any previous time (before breaking), potentially causing a false positive.

There is a way to remove a schema from the cache by adding Null, but for that I need to know the namespace. I'd prefer my test not to know what schemas should be loaded – that's an implementation detail. As such, I'm looking for a way to either clear the cache all at once, or to see what namespaces are in there, so I can add Null for each of those.

Aucun commentaire:

Enregistrer un commentaire