Any sample code available for loading an SDLXLIFF file?

Hi,

I been staring at the Sdl.FileTypeSupport.Framework.BilingualApi Namespace documentation for several days, but I just don't understand how you use this interface to load in an SDLXLIFF file and process segment text strings and save the result.

Can anyone provide a sample for opening an SDLXLIFF file and loading the content in down to the ISegment level?

Thank you for your help.

Tak Osato

Parents
  • Hi,

    you can use this code:

    IFileTypeManager mgr = DefaultFileTypeManager.CreateInstance(true);

    IMultiFileConverter conv = mgr.GetConverterToBilingual("c:\test.sdlxliff", "c:\output.sdlxliff", null);

    conv.AddBilingualProcessor(new MyRegexReplacer());

    conv.Parse();

    Where MyRegexReplacer is the class which will implement IBilingualProcessor interface.

    Regards

    Patrik

  • Hi Patrik,

    Thank you for all the help.

    I was able to implement a bare-bone MyRegexReplacer class which implements the IBilingualContentProcessor interface.

    The project builds okay, but when I run it, I get the following error:

    Failed to create default implementation of the FileTypeManager.

    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Sdl.Core.PluginFramework.PluginFrameworkException: No Application specific plug-in directory found.

    at the following line

    IFileTypeManager mgr = DefaultFileTypeManager.CreateInstance(true);

    What am I supposed to do to fix this error? Pardon me if I am asking a trivial question.

    If I need to learn something to understand this error, I would greatly appreciate any pointers.

    I googled similar errors to see what this error is about, but the explanations are way over my head.

    Best regards,

    Tak Osato

Reply
  • Hi Patrik,

    Thank you for all the help.

    I was able to implement a bare-bone MyRegexReplacer class which implements the IBilingualContentProcessor interface.

    The project builds okay, but when I run it, I get the following error:

    Failed to create default implementation of the FileTypeManager.

    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Sdl.Core.PluginFramework.PluginFrameworkException: No Application specific plug-in directory found.

    at the following line

    IFileTypeManager mgr = DefaultFileTypeManager.CreateInstance(true);

    What am I supposed to do to fix this error? Pardon me if I am asking a trivial question.

    If I need to learn something to understand this error, I would greatly appreciate any pointers.

    I googled similar errors to see what this error is about, but the explanations are way over my head.

    Best regards,

    Tak Osato

Children