From: <bo...@us...> - 2010-08-10 15:51:42
|
Revision: 419 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=419&view=rev Author: bodewig Date: 2010-08-10 15:51:36 +0000 (Tue, 10 Aug 2010) Log Message: ----------- On Windows the resolver is not used Modified Paths: -------------- trunk/xmlunit/src/main/net-core/validation/Validator.cs Modified: trunk/xmlunit/src/main/net-core/validation/Validator.cs =================================================================== --- trunk/xmlunit/src/main/net-core/validation/Validator.cs 2010-08-02 10:59:23 UTC (rev 418) +++ trunk/xmlunit/src/main/net-core/validation/Validator.cs 2010-08-10 15:51:36 UTC (rev 419) @@ -109,6 +109,7 @@ } List<ValidationProblem> problems = new List<ValidationProblem>(); settings.ValidationEventHandler += CollectProblems(problems); + settings.XmlResolver = new ThrowingResolver(); using (XmlReader r = XmlReader.Create(instance.Reader, settings)) { while (r.Read()) ; @@ -116,6 +117,17 @@ return new ValidationResult(problems.Count == 0, problems); } + private class ThrowingResolver : XmlResolver { + public override object GetEntity(Uri uri, string role, Type type) { + throw new Exception(string.Format("GetEntity invoked with ({0}, {1}, {2}", + uri, role, type)); + } + + public override System.Net.ICredentials Credentials { + set {} + } + } + private static readonly IDictionary<string, ValidationType> types; static Validator() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |