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'
I added two empty units (without segments) I get exception only for the first error it encounters, not for all the errors.
For example
And I write it using the sample code
I get
while I should also get '#/f=f1/u=u2'