Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When 2 validation errors happen, exception should contain both errors #24

Open
simonech opened this issue May 9, 2017 · 1 comment
Open

Comments

@simonech
Copy link
Contributor

simonech commented May 9, 2017

I added two empty units (without segments) I get exception only for the first error it encounters, not for all the errors.
For example

            XliffDocument xliff = new XliffDocument("en-GB");
            Localization.Xliff.OM.Core.File file = new Localization.Xliff.OM.Core.File("f1");
            xliff.Files.Add(file);

            Unit unit1 = new Unit("u1");
            Unit unit2 = new Unit("u2");

            file.Containers.Add(unit1);
            file.Containers.Add(unit2);

And I write it using the sample code

try
{
	using (IO.Stream stream = new IO.MemoryStream())
	{
		XliffWriter writer;

		writer = new XliffWriter();
		writer.Serialize(stream, document);
	}
}
catch (ValidationException e)
{
	Console.WriteLine("ValidationException Details:");
	Console.WriteLine(e.Message);
	if (e.Data != null)
	{
		foreach (object key in e.Data.Keys)
		{
			Console.WriteLine("  '{0}': '{1}'", key, e.Data[key]);
		}
	}
}

I get

ValidationException Details:
The element must contain one or more Resources.
  'SelectorPath': '#/f=f1/u=u1'

while I should also get '#/f=f1/u=u2'

@VladimirRybalko
Copy link
Contributor

VladimirRybalko commented Aug 30, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants