示例#1
0
        private void buttonStart_Click(object sender, System.EventArgs e)
        {
            WriteTrace("xliff_in started...");

            try
            {
                xliff_inMapToEPRTRcms xliff_inMapToEPRTRcmsObject = new xliff_inMapToEPRTRcms();
                xliff_inMapToEPRTRcmsObject.RegisterTraceTarget(this);
                xliff_inMapToEPRTRcmsObject.Run(
                    textBoxSource0.Text,
                    textBoxTarget0.Text
                    );
            }
            catch (Exception err)
            {
                WriteTrace("ERROR: ");
                WriteTrace(err.Message);
                WriteTrace(err.StackTrace);
            }

            WriteTrace("xliff_in finished.");
        }
示例#2
0
        public static void Main(string[] args)
        {
            Console.Out.WriteLine("xliff_in Application");

            try
            {
                TraceTargetConsole    ttc = new TraceTargetConsole();
                xliff_inMapToEPRTRcms xliff_inMapToEPRTRcmsObject = new xliff_inMapToEPRTRcms();
                xliff_inMapToEPRTRcmsObject.RegisterTraceTarget(ttc);


                // run mapping
                //
                // you have different options to provide mapping input and output:
                //
                // files using file names (available for XML, text, and Excel):
                //   Altova.IO.FileInput(string filename)
                //   Altova.IO.FileOutput(string filename)
                //
                // streams (available for XML, text, and Excel):
                //   Altova.IO.StreamInput(System.IO.Stream stream)
                //   Altova.IO.StreamOutput(System.IO.Stream stream)
                //
                // strings (available for XML and text):
                //   Altova.IO.StringInput(string content)
                //   Altova.IO.StringOutput(StringBuilder content)
                //
                // Java IO reader/writer (available for XML and text):
                //   Altova.IO.ReaderInput(System.IO.TextReader reader)
                //   Altova.IO.WriterOutput(System.IO.TextWriter writer)
                //
                // DOM documents (for XML only):
                //   Altova.IO.DocumentInput(System.Xml.XmlDocument document)
                //   Altova.IO.DocumentOutput(System.Xml.XmlDocument document)
                //
                // By default, Run will close all inputs and outputs. If you do not want this,
                // set the following property:
                // xliff_inMapToEPRTRcmsObject.CloseObjectsAfterRun = false;

                {
                    Altova.IO.Input xliff_core_1_2_transitional2Source = new Altova.IO.FileInput("C:/EIONET/CMS_XLIFF/xliff_in/testatkins_utf8.xlf");

                    xliff_inMapToEPRTRcmsObject.Run(
                        xliff_core_1_2_transitional2Source,
                        "Provider=SQLOLEDB.1; Data Source=sdkcga6306; User ID=gis;Password=tmggis;Initial Catalog=EPRTRcms;Persist Security Info=true;Auto Translate=false;Tag with column collation=false;Use Encryption for Data=false;Mars_Connection=no;");
                }



                Console.Out.WriteLine("Finished");
            }
            catch (Altova.UserException ue)
            {
                Console.Out.Write("USER EXCEPTION: ");
                Console.Out.WriteLine(ue.Message);
                System.Environment.Exit(1);
            }
            catch (Exception e)
            {
                Console.Out.Write("ERROR: ");
                Console.Out.WriteLine(e.Message);
                Console.Out.WriteLine(e.StackTrace);
                System.Environment.Exit(1);
            }
        }