From: <bo...@us...> - 2010-06-29 04:26:45
|
Revision: 409 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=409&view=rev Author: bodewig Date: 2010-06-29 04:26:39 +0000 (Tue, 29 Jun 2010) Log Message: ----------- unused variable 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-06-28 15:25:39 UTC (rev 408) +++ trunk/xmlunit/src/main/net-core/validation/Validator.cs 2010-06-29 04:26:39 UTC (rev 409) @@ -80,8 +80,7 @@ List<ValidationProblem> problems = new List<ValidationProblem>(); foreach (ISource loc in sourceLocations) { - XmlSchema s = XmlSchema.Read(loc.Reader, - CollectProblems(problems)); + XmlSchema.Read(loc.Reader, CollectProblems(problems)); } return new ValidationResult(problems.Count == 0, problems); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <bo...@us...> - 2010-08-10 16:00:46
|
Revision: 420 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=420&view=rev Author: bodewig Date: 2010-08-10 16:00:40 +0000 (Tue, 10 Aug 2010) Log Message: ----------- OK, this *resolver* isn't consulted on Mono either, maybe the pne of Schemas 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-10 15:51:36 UTC (rev 419) +++ trunk/xmlunit/src/main/net-core/validation/Validator.cs 2010-08-10 16:00:40 UTC (rev 420) @@ -101,6 +101,7 @@ try { XmlSchema s = XmlSchema.Read(loc.Reader, ThrowOnError); settings.Schemas.Add(s); + settings.Schemas.XmlResolver = new ThrowingResolver(); } catch (IOException ex) { throw new XMLUnitException("Schema is not readable", ex); @@ -109,7 +110,6 @@ } 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()) ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2010-08-10 16:03:59
|
Revision: 421 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=421&view=rev Author: bodewig Date: 2010-08-10 16:03:53 +0000 (Tue, 10 Aug 2010) Log Message: ----------- revert experiment, neither resolver is consulted on Mono 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-10 16:00:40 UTC (rev 420) +++ trunk/xmlunit/src/main/net-core/validation/Validator.cs 2010-08-10 16:03:53 UTC (rev 421) @@ -101,7 +101,6 @@ try { XmlSchema s = XmlSchema.Read(loc.Reader, ThrowOnError); settings.Schemas.Add(s); - settings.Schemas.XmlResolver = new ThrowingResolver(); } catch (IOException ex) { throw new XMLUnitException("Schema is not readable", ex); @@ -117,17 +116,6 @@ 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. |
From: <bo...@us...> - 2014-11-29 16:35:49
|
Revision: 554 http://sourceforge.net/p/xmlunit/code/554 Author: bodewig Date: 2014-11-29 16:35:47 +0000 (Sat, 29 Nov 2014) Log Message: ----------- use lambdas in validation namespace 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 2014-11-29 06:45:17 UTC (rev 553) +++ trunk/xmlunit/src/main/net-core/validation/Validator.cs 2014-11-29 16:35:47 UTC (rev 554) @@ -138,9 +138,8 @@ } private static ValidationEventHandler CollectProblems(List<ValidationProblem> problems) { - return delegate(object sender, ValidationEventArgs e) { + return (sender, e) => problems.Add(ValidationProblem.FromEvent(e)); - }; } private static void ThrowOnError(object sender, ValidationEventArgs e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |