From 0f65f67629459bf0a7d9eeb286312c8fc1690f8e Mon Sep 17 00:00:00 2001 From: OmrSi Date: Thu, 9 Dec 2021 23:56:46 +0200 Subject: [PATCH] Add missing namespaces to manager in TimedText properties --- src/ui/Forms/TimedTextProperties.cs | 13 ++++++++----- src/ui/Forms/TimedTextPropertiesItunes.cs | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/ui/Forms/TimedTextProperties.cs b/src/ui/Forms/TimedTextProperties.cs index 2e405bf8e..465d86acd 100644 --- a/src/ui/Forms/TimedTextProperties.cs +++ b/src/ui/Forms/TimedTextProperties.cs @@ -10,10 +10,10 @@ namespace Nikse.SubtitleEdit.Forms { public partial class TimedTextProperties : PositionAndSizeForm { - private Subtitle _subtitle; - private XmlDocument _xml; - private XmlNamespaceManager _nsmgr; - private string _NA; + private readonly Subtitle _subtitle; + private readonly XmlDocument _xml; + private readonly XmlNamespaceManager _nsmgr; + private readonly string _NA; public TimedTextProperties(Subtitle subtitle) { @@ -40,7 +40,10 @@ namespace Nikse.SubtitleEdit.Forms _xml.LoadXml(subtitle.Header); // load default xml } _nsmgr = new XmlNamespaceManager(_xml.NameTable); - _nsmgr.AddNamespace("ttml", "http://www.w3.org/ns/ttml"); + _nsmgr.AddNamespace("ttml", TimedText10.TtmlNamespace); + _nsmgr.AddNamespace("ttp", TimedText10.TtmlParameterNamespace); + _nsmgr.AddNamespace("tts", TimedText10.TtmlStylingNamespace); + _nsmgr.AddNamespace("ttm", TimedText10.TtmlMetadataNamespace); XmlNode node = _xml.DocumentElement.SelectSingleNode("ttml:head/ttml:metadata/ttml:title", _nsmgr); if (node != null) diff --git a/src/ui/Forms/TimedTextPropertiesItunes.cs b/src/ui/Forms/TimedTextPropertiesItunes.cs index b0c0cda81..0595cf1e9 100644 --- a/src/ui/Forms/TimedTextPropertiesItunes.cs +++ b/src/ui/Forms/TimedTextPropertiesItunes.cs @@ -10,10 +10,10 @@ namespace Nikse.SubtitleEdit.Forms { public partial class TimedTextPropertiesItunes : PositionAndSizeForm { - private Subtitle _subtitle; - private XmlDocument _xml; - private XmlNamespaceManager _nsmgr; - private string _NA; + private readonly Subtitle _subtitle; + private readonly XmlDocument _xml; + private readonly XmlNamespaceManager _nsmgr; + private readonly string _NA; public TimedTextPropertiesItunes(Subtitle subtitle) { @@ -40,7 +40,10 @@ namespace Nikse.SubtitleEdit.Forms _xml.LoadXml(subtitle.Header); // load default xml } _nsmgr = new XmlNamespaceManager(_xml.NameTable); - _nsmgr.AddNamespace("ttml", "http://www.w3.org/ns/ttml"); + _nsmgr.AddNamespace("ttml", TimedText10.TtmlNamespace); + _nsmgr.AddNamespace("ttp", TimedText10.TtmlParameterNamespace); + _nsmgr.AddNamespace("tts", TimedText10.TtmlStylingNamespace); + _nsmgr.AddNamespace("ttm", TimedText10.TtmlMetadataNamespace); XmlNode node = _xml.DocumentElement.SelectSingleNode("ttml:head/ttml:metadata/ttml:title", _nsmgr); if (node != null)