{"record":{"id":"192b6de11f5bdd5e","repo":"SubtitleEdit/subtitleedit","slug":"e-message-192b6d","errorCode":null,"errorMessage":"{e.Message}","messagePattern":"\\{e\\.Message\\}","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/libse/SubtitleFormats/DCinemaSmpte2010.cs","lineNumber":626,"sourceCode":"                match = regex.Match(xml, match.Index);\n            }\n\n            regex = RegexWhiteSpaceTextCloseTag;\n            match = regex.Match(xml);\n            while (match.Success)\n            {\n                xml = xml\n                    .Remove(match.Index, match.Value.Length)\n                    .Insert(match.Index, match.Value.Trim());\n                match = regex.Match(xml, match.Index);\n            }\n\n            return xml;\n        }\n\n        private void ValidationCallBack(object sender, ValidationEventArgs e)\n        {\n            throw new Exception(e.Message);\n        }\n\n        public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string fileName)\n        {\n            _errorCount = 0;\n            var sb = new StringBuilder();\n            lines.ForEach(line => sb.AppendLine(line));\n            var xml = new XmlDocument { XmlResolver = null };\n            xml.LoadXml(sb.ToString().Replace(\"<dcst:\", \"<\").Replace(\"</dcst:\", \"</\").Replace(\"xmlns=\\\"http://www.smpte-ra.org/schemas/428-7/2010/DCST\\\"\", string.Empty)); // tags might be prefixed with namespace (or not)... so we just remove them\n\n            var ss = Configuration.Settings.SubtitleSettings;\n            try\n            {\n                ss.InitializeDCinemaSettings(true);\n                var node = xml.DocumentElement.SelectSingleNode(\"Id\");\n                if (node != null)\n                {\n                    ss.CurrentDCinemaSubtitleId = node.InnerText;","sourceCodeStart":608,"sourceCodeEnd":644,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/libse/SubtitleFormats/DCinemaSmpte2010.cs#L608-L644","documentation":"Thrown by DCinemaSmpte2010.ValidationCallBack during ToText export when the generated DCinema XML fails validation against SMPTE-428-7-2010-DCST.xsd. The validation event's message is re-thrown verbatim as a bare Exception, aborting the export. The 2010 schema is stricter than 2007 (e.g. requires EditRate, language attributes).","triggerScenarios":"Exporting to DCinema Interop 2010 XML with content that violates the schema — missing EditUnit, malformed UUID, Font without required Id/Size/Color, a Subtitle with no Text, or an AspectRatio/FontSize out of the permitted range.","commonSituations":"Subtitles originating from formats that lack metadata the 2010 schema mandates (EditRate, language); font or UUID mismatches; very long subtitle text.","solutions":["Inspect e.Message in the thrown exception for the exact schema violation and element path.","Supply the missing required fields (EditRate, language, Font Size/Color) in the subtitle settings before export.","Ensure every referenced FontId is declared in FontList.","If strict 2010 compliance is not required, export as 2007 instead."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-validate against SMPTE-428-7-2010-DCST.xsd with a non-throwing handler\nvar schemas = new XmlSchemaSet();\nschemas.Add(null, \"SMPTE-428-7-2010-DCST.xsd\");\nvar settings = new XmlReaderSettings { ValidationType = ValidationType.Schema, Schemas = schemas };\nvar errors = new List<string>();\nsettings.ValidationEventHandler += (s, e) => errors.Add(e.Message);\n// serialize, then validate the serialized output before returning it to the user","typeGuard":null,"tryCatchPattern":"try\n{\n    var text = format.ToText(subtitle, title);\n}\ncatch (Exception ex) when (ex.Message.Contains(\"validation\"))\n{\n    logger.Error(ex, \"DCinema 2010 validation failed\");\n}","preventionTips":["Provide EditRate and language metadata required by the 2010 profile.","Pre-validate output against the XSD with a collecting handler.","Fall back to the 2007 profile if 2010 strictness is unnecessary."],"tags":["subtitle-format","dcinema","xml","schema-validation","smpte"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}