public XLSXReader(Altova.IO.Input xlsxInput) { if (xlsxInput.Type != Altova.IO.Input.InputType.Stream) { throw new System.Exception("XLSX output can be read only from the stream"); } inStream = xlsxInput.Stream; xlsxZip = Package.Open(inStream); }
public void Run(Altova.IO.Input xliff_core_1_2_transitional2Source, string EPRTRcmsTargetConnectionString) { mAutoNumberStates = new AutoNumberStateMap(); // Open the source(s) XmlDocument xliff_core_1_2_transitional2DocSourceObject = XmlTreeOperations.LoadDocument(xliff_core_1_2_transitional2Source); System.Collections.IEnumerator itxliff_core_1_2_transitional2 = XmlTreeOperations.GetElements(xliff_core_1_2_transitional2DocSourceObject, xliff_core_1_2_transitional_TypeInfo.binder.Members[xliff_core_1_2_transitional_TypeInfo._altova_mi_xlf_altova_unnamedType_altova_xliff]).GetEnumerator(); if (!itxliff_core_1_2_transitional2.MoveNext()) { throw new Altova.Types.DataSourceUnavailableException("Source is of invalid type: " + xliff_core_1_2_transitional2Source); } m_xliff_core_1_2_transitional2Instance = (System.Xml.XmlNode)itxliff_core_1_2_transitional2.Current; // Create the target WriteTrace("Connecting to EPRTRcms database...\n"); System.Data.OleDb.OleDbConnection EPRTRcmsTargetObject = null; try { EPRTRcmsTargetObject = new System.Data.OleDb.OleDbConnection(EPRTRcmsTargetConnectionString); EPRTRcmsTargetObject.Open(); } catch (Exception e) { throw new DataTargetUnavailableException("Error connecting to database.", e); } mTransactionHelper = new DbTreeOperations.TransactionHelper(EPRTRcmsTargetObject, "BEGIN TRANSACTION ", "COMMIT TRANSACTION ", "ROLLBACK TRANSACTION ", "SAVE TRANSACTION %%TRANSACTION_NAME%% ", "ROLLBACK TRANSACTION %%TRANSACTION_NAME%% "); // Execute mapping loopfile(m_xliff_core_1_2_transitional2Instance, EPRTRcmsTargetObject); // Close the target EPRTRcmsTargetObject.Close(); // Close the Source Library if (runDoesCloseAll) { xliff_core_1_2_transitional2Source.Close(); } }
public static XmlDocument LoadDocument(Altova.IO.Input input) { if (input is Altova.IO.FileInput) { return LoadDocument(((Altova.IO.FileInput)input).Filename); } switch (input.Type) { case Altova.IO.Input.InputType.Stream: return LoadDocument(input.Stream); case Altova.IO.Input.InputType.Reader: return LoadDocument(input.Reader); case Altova.IO.Input.InputType.XmlDocument: return input.Document; default: throw new System.Exception("Unknown input type"); } }