Open rabularca opened 7 years ago
It is possible to exclude validation. Just empty the Validators
property of the XliffReader
and you would open the file anyway.
As for getting the errors, you can just create 2 instances of the XliffReader
, one with validators, one without, and get the list of errors from the first.
Thank you very much for the answer!
However, regarding the second part of your answer: is there a way to get the list of errors? As far as I've seen, the library just stops reading after throwing the first exception. Or am I missing something?
Yeah, indeed... it just stops at the first validation error... not applicable then 😞
This feature is finally available in the forked repository: Xliff.OM.NetStandard. Welcome to use it. Don't hesitate to create an issue there in case of any questions.
There are some cases in which we want to open a file even if it has validation errors (for instance if you don't really care about a specific error or want to programmatically fix it). The library should let the user to decide whether he wants to open a file with validation or without validation, and if he chooses the latter one, he should have a way to find out which validation errors the library has thrown.
A way to do this thing would be to create two separate methods: ValidateFile(string filePath), which would return a list of validation errors, and DeserializeWithoutValidating(string filePath), which would return the XLIFF file stream even if the file is not valid.