{"record":{"id":"1b03ab3ec881e46c","repo":"SubtitleEdit/subtitleedit","slug":"e-message-1b03ab","errorCode":null,"errorMessage":"{e.Message}","messagePattern":"\\{e\\.Message\\}","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/libse/SubtitleFormats/DCinemaSmpte2014.cs","lineNumber":604,"sourceCode":"                    xmld.LoadXml(result);\n                    using (var xr = XmlReader.Create(zip))\n                    {\n                        xmld.Schemas.Add(null, xr);\n                        xmld.Validate(ValidationCallBack);\n                    }\n                }\n                catch (Exception exception)\n                {\n                    Errors = \"Error validating xml via SMPTE-428-7-2014-DCST.xsd: \" + exception.Message;\n                }\n            }\n\n            return DCinemaSmpte2010.FixDcsTextSameLine(result);\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/2014/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                XmlNode node = xml.DocumentElement.SelectSingleNode(\"Id\");\n                if (node != null)\n                {\n                    ss.CurrentDCinemaSubtitleId = node.InnerText;","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/libse/SubtitleFormats/DCinemaSmpte2014.cs#L586-L622","documentation":"Thrown by DCinemaSmpte2014.ValidationCallBack during ToText export when the generated DCinema XML fails validation against SMPTE-428-7-2014-DCST.xsd. Identical mechanism to the 2007/2010 variants: a ValidationEventArgs message is re-thrown as a bare Exception. The 2014 schema adds further constraints on top of 2010.","triggerScenarios":"Exporting to DCinema 2014 XML whose content violates the 2014 schema — additional required attributes, stricter time code or language rules, or Font/Region constraints not present in earlier versions.","commonSituations":"Subtitles without the newer required metadata (e.g. Region dimensions, language tags); content targeting the 2010 or 2007 profile that does not satisfy 2014 additions.","solutions":["Read e.Message in the exception to identify the precise schema rule and element.","Add the missing 2014-specific attributes/elements (language, Region, etc.).","If 2014 features are not needed, export using the 2010 or 2007 profile.","Cross-check with an external SMPTE 428-7-2014 XSD validator."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-validate against SMPTE-428-7-2014-DCST.xsd with a collecting handler\nvar schemas = new XmlSchemaSet();\nschemas.Add(null, \"SMPTE-428-7-2014-DCST.xsd\");\nvar settings = new XmlReaderSettings { ValidationType = ValidationType.Schema, Schemas = schemas };\nvar errors = new List<string>();\nsettings.ValidationEventHandler += (s, e) => errors.Add(e.Message);","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 2014 validation failed\");\n}","preventionTips":["Supply all 2014-mandated attributes (Region, language, etc.).","Pre-validate output with a collecting XSD handler before returning to the user.","Export as 2010/2007 if 2014 features are not required."],"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"}