On 2009-05-13, Филимонов Максим Сергеевич <[email protected]> wrote:
> Hi Stefan.
> My comments below.
> 13.05.2009, в 8:06, Stefan Bodewig написал(а):
>> class ValidationError {
>> readonly int line; // with a negative constant for UNKNOWN
>> readonly int column; // ditto
>>
>> readonly String message;
>> }
>> .NET knows warnings in addition to errors, I'm not sure how we should
>> handle them.
>> class ValidationResult {
>> readonly bool valid;
>> readonly Iterable/IEnumerable<ValidationError> errors;
> I think warning is important
OK
> what about use
> IEnumerable<ValidationWarning> warnings
> and
> ValidationError : ValidationWarning
> or
> ValidationWarning : ValidationIncostistency ,
> ValidationError:ValidationIncostistency?
Maybe an enum with Error and Warning and an attribute in
ValidationError would do (together with renaming the class)?
>> Since the Java code will be prettier if it uses different
>> implementations for DTDs and W3C Schema I suggest to add a factory
>> method
>> class Validator {
>> static Validator forLanguage(String);
> What about pass enum not a string than user will know what validation
> sets are supported and didn't try to pass something not supported.
javax.xml.validation can be extended by additional libraries that add
support for new schema languages, see
<https://jaxp-sources.dev.java.net/nonav/docs/api/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String)>
I've successfully used RelaxNG
<http://stefan.samaflost.de/blog/en/oss/XMLUnit/relax_ng_validation_in_xmlunit.html>
An enum would limit the choices to the schema langauges we know at the
time of writing the enum, a string allows us to be forward compatible.
Stefan
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Xmlunit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xmlunit-general