How to export Multiterm to XML

I would like to export the Multiterm termbase to an XML file. Well, this seemed simple at first glance, but I am struggling already a couple of hours with the API.
Could it be that the SDK description is a bit outdated? On the community page, I found that the TMO interop is deprecated (http://community.sdl.com/phase_2_groups/sdl_openexchange_developers/f/57/t/1134.aspx).
Does someone have a piece of sample code how to open an .sdltb file and export the content to XML?
Thank you so much,
Henk
Parents
  • Hello Henk,

    you can try to use this. You must first connect to your application, then add the termbase you want to open, select an export definition and from it run the export process. This means that the path where the export has to be saved has to be entered previously in your export definition (otherwise, it won't export anything, or maybe but I don't know where :o))

    That the basic idea of exporting from multiterm (2014)

    Kind regards

    Sébastien


           private void exportFromSDLTB(string fileLocation)

           {

               Sdl.MultiTerm.TMO.Interop.Application oMt = new Sdl.MultiTerm.TMO.Interop.Application();

               TermbaseRepository rep = oMt.LocalRepository;

               try

               {

                   rep.Connect("", "");

               }

               catch (Exception ex)

               {

                   MessageBox.Show(ex.ToString() + "\nConnection to local termbase failed");

               }

               Termbases oTbs2 = rep.Termbases;

               oTbs2.Add(fileLocation, "", "");


               //load the termbase

               Termbase oTb2 = oTbs2[fileLocation];


               //export

               ExportDefinition oExp = oTb2.ExportDefinitions[0];

               oExp.ProcessExport(MtTaskType.mtScript);

           }

Reply
  • Hello Henk,

    you can try to use this. You must first connect to your application, then add the termbase you want to open, select an export definition and from it run the export process. This means that the path where the export has to be saved has to be entered previously in your export definition (otherwise, it won't export anything, or maybe but I don't know where :o))

    That the basic idea of exporting from multiterm (2014)

    Kind regards

    Sébastien


           private void exportFromSDLTB(string fileLocation)

           {

               Sdl.MultiTerm.TMO.Interop.Application oMt = new Sdl.MultiTerm.TMO.Interop.Application();

               TermbaseRepository rep = oMt.LocalRepository;

               try

               {

                   rep.Connect("", "");

               }

               catch (Exception ex)

               {

                   MessageBox.Show(ex.ToString() + "\nConnection to local termbase failed");

               }

               Termbases oTbs2 = rep.Termbases;

               oTbs2.Add(fileLocation, "", "");


               //load the termbase

               Termbase oTb2 = oTbs2[fileLocation];


               //export

               ExportDefinition oExp = oTb2.ExportDefinitions[0];

               oExp.ProcessExport(MtTaskType.mtScript);

           }

Children