using System; using System.Collections.Generic; using System.Text; using System.Xml; namespace Nikse.SubtitleEdit.Core.SubtitleFormats { public class TimedText200604 : SubtitleFormat { public override string Extension => ".xml"; public override string Name => "Timed Text draft 2006-04"; public bool UseCDataForParagraphText { get; set; } public override bool IsMine(List lines, string fileName) { var sb = new StringBuilder(); lines.ForEach(line => sb.AppendLine(line)); string xmlAsString = sb.ToString().Replace("http://www.w3.org/2006/04/ttaf1#styling\"xml:lang", "http://www.w3.org/2006/04/ttaf1#styling\" xml:lang").Trim(); if (xmlAsString.Contains("http://www.w3.org/2006/10")) { return false; } if (!UseCDataForParagraphText && xmlAsString.Contains(" 0; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); return false; } } return false; } private static string ConvertToTimeString(TimeCode time) { return $"{time.Hours:00}:{time.Minutes:00}:{time.Seconds:00}.{time.Milliseconds:000}"; } public override string ToText(Subtitle subtitle, string title) { string xmlStructure = "" + Environment.NewLine + "" + Environment.NewLine + " " + Environment.NewLine + " " + Environment.NewLine + "