SubtitleEdit/subtitleedit · error · Exception
{e.Message}
Error message
{e.Message} What it means
Thrown by DCinemaSmpte2007.ValidationCallBack, an XML schema validation event handler attached during ToText export. When the generated DCinema XML fails validation against SMPTE-428-7-2007-DCST.xsd, the validator raises a ValidationEventArgs whose message is re-thrown as a bare Exception. This interrupts export and surfaces the schema violation.
Source
Thrown at src/libse/SubtitleFormats/DCinemaSmpte2007.cs:591
xmld.LoadXml(result);
using (var xr = XmlReader.Create(zip))
{
xmld.Schemas.Add(null, xr);
xmld.Validate(ValidationCallBack);
}
}
catch (Exception exception)
{
Errors = "Error validating xml via SMPTE-428-7-2007-DCST.xsd: " + exception.Message;
}
}
return DCinemaSmpte2010.FixDcsTextSameLine(result);
}
private void ValidationCallBack(object sender, ValidationEventArgs e)
{
throw new Exception(e.Message);
}
public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string fileName)
{
_errorCount = 0;
var sb = new StringBuilder();
lines.ForEach(line => sb.AppendLine(line));
var xml = new XmlDocument { XmlResolver = null };
xml.LoadXml(sb.ToString().Replace("<dcst:", "<").Replace("</dcst:", "</").Replace("xmlns=\"http://www.smpte-ra.org/schemas/428-7/2007/DCST\"", string.Empty)); // tags might be prefixed with namespace (or not)... so we just remove them
var ss = Configuration.Settings.SubtitleSettings;
try
{
ss.InitializeDCinemaSettings(true);
XmlNode node = xml.DocumentElement.SelectSingleNode("Id");
if (node != null)
{
ss.CurrentDCinemaSubtitleId = node.InnerText;
}View on GitHub (pinned to 17a9f07487)
Solutions
- Read the embedded e.Message — it identifies the exact schema rule violated and the offending element/attribute.
- Fix the subtitle data (UUIDs, font ids, time codes) so it satisfies the rule.
- Verify all referenced FontIds exist in the <FontList> and required attributes (Size, Color) are present.
- Validate against the XSD manually with an external validator to iterate faster.
Defensive patterns
Strategy: try-catch
Validate before calling
// Validate DCinema XML against the XSD yourself to surface errors with detail
var schemas = new XmlSchemaSet();
schemas.Add(null, "SMPTE-428-7-2007-DCST.xsd");
var settings = new XmlReaderSettings { ValidationType = ValidationType.Schema, Schemas = schemas };
settings.ValidationEventHandler += (s, e) => { /* collect e.Message without throwing */ };
using var reader = XmlReader.Create(xmlPath, settings);
while (reader.Read()) { } Try / catch
try
{
var text = format.ToText(subtitle, title);
}
catch (Exception ex) when (ex.Message.Contains("validation"))
{
// e.Message names the schema rule; fix the subtitle data accordingly
logger.Error(ex, "DCinema 2007 validation failed");
} Prevention
- Ensure all FontIds are declared in FontList before export.
- Generate UUIDs in the canonical urn:uuid format.
- Validate against the XSD in a pre-pass that collects (not throws) errors.
When it happens
Trigger: Exporting a subtitle to DCinema XML (Interop 2007) whose content violates the SMPTE 428-7 schema — e.g. a UUID in the wrong format, a Font element missing required attributes, a TimeCode or FontId that does not match the schema's pattern, or text exceeding the max length for a subtitle.
Common situations: Subtitles with unusual characters, missing required UUIDs, font references to undefined Font elements, or empty/mandatory fields. Most often the root cause is in the data fed to ToText, not the schema itself.
Related errors
- {e.Message}
- {e.Message}
- MXF KLV packet - stream does not have 16 bytes available for
- NameList: Unable to read name list file: {fileNameOrUrl}
- Invalid ASSA time code: {time}
AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13).
Data as JSON: /api/errors/49a73e991d4b3fa5.
Report an issue: GitHub.