/// ------------------------------------------------------------------------------------ /// <summary> /// Optionally apply an XSLT to the output file. /// </summary> /// <param name="sXsltFile">The s XSLT file.</param> /// <param name="sOutputFile">The s output file.</param> /// <param name="iPass">The i pass.</param> /// ------------------------------------------------------------------------------------ public override void PostProcess(string sXsltFile, string sOutputFile, int iPass) { if (!String.IsNullOrEmpty(sXsltFile)) { base.PostProcess(sXsltFile, sOutputFile, iPass); } else if (m_sFormat == "xhtml") { string sTempFile = RenameOutputToPassN(sOutputFile, iPass); m_xhtml.FinalizeXhtml(sOutputFile, sTempFile); File.Delete(sTempFile); } }
private void ExportTE() { m_xhtml.WriteXhtmlHeading(m_fileName, m_sDescription, "scrBody"); ExportScripture(); m_xhtml.WriteXhtmlEnding(); m_writer.Close(); string sXsltFile = Path.Combine(DirectoryFinder.GetFWCodeSubDirectory("Translation Editor"), "XhtmlExport.xsl"); string sTempFile1 = m_fileName + "-1"; if (File.Exists(sTempFile1)) { File.Delete(sTempFile1); } File.Move(m_fileName, sTempFile1); XslCompiledTransform xsl = new XslCompiledTransform(); xsl.Load(sXsltFile); xsl.Transform(sTempFile1, m_fileName); //#if DEBUG // string sSave = m_fileName + "-Phase1"; // File.Delete(sSave); // File.Copy(sTempFile1, sSave); //#endif File.Delete(sTempFile1); string sTempFile2 = m_fileName + "-2"; if (File.Exists(sTempFile2)) { File.Delete(sTempFile2); } File.Move(m_fileName, sTempFile2); m_xhtml.FinalizeXhtml(m_fileName, sTempFile2); //#if DEBUG // sSave = m_fileName + "-Phase2"; // File.Delete(sSave); // File.Copy(sTempFile2, sSave); //#endif File.Delete(sTempFile2); m_xhtml.WriteCssFile(Path.ChangeExtension(m_fileName, ".css"), m_styleSheet, XhtmlHelper.CssType.Scripture, m_pub); }