The Validate with DTD workflow action validates an XML document against a Document Type Definition (DTD)—for example, JATS, BITS, or a house DTD. You supply the DTD as a zip package, containing the DTD file(s) and, optionally, an OASIS XML catalog (a small file that tells Typefi which file to use for each part of the DTD). Errors appear in the job log with line and column coordinates. Pair it with Annotate errors to insert the flagged issues directly into the source document.
| Field | Description |
|---|---|
| Input | Choose the XML document to be validated. |
| DTD package | Choose a .zip file containing your DTD file(s) and, optionally, an OASIS XML catalog. |
| Catalog file | If your DTD package contains more than one catalog file, enter the filename (not a path) of the one to use. Leave blank to auto-detect. |
| On error |
Choose how the action reacts to validation errors:
|
| Output | Choose a file to write the validation report to. Optional: if left blank, the action still validates and logs results, it just doesn't write a report file. |
How Typefi matches the files in your DTD package
Your DTD package can include a catalog file—an XML file that maps each part your DTD refers to (for example, a set of shared entity definitions) to the right file in the package. If your package includes exactly one catalog file, Typefi uses it automatically. If it includes more than one, Typefi logs a warning and falls back to matching files by name instead—use the Catalog file field to tell Typefi which catalog to use.
If your package doesn't include a catalog at all, Typefi matches the files referenced in your document's DOCTYPE declaration to files of the same name in the package.
Validation report
When you specify an Output file, Typefi writes a report recording: whether validation passed or failed, which DTD was used, the document that was checked, a timestamp, and one entry per issue with its severity, line, column, and message.
A report that lists errors, even though the job succeeded, is expected under Report only. The report always reflects whether the document is valid; the job's outcome is decided separately by your On error choice. Under Report only, the Validate with DTD workflow action keeps the job running even when the report lists errors, so instead of stopping the workflow, you can hand a failed report to Annotate errors, which inserts the flagged issues directly into the source document.
Under Report, then fail and Fail immediately, the job's outcome and the report's result always match each other.
If the XML itself is broken (for example, mismatched or unclosed tags), the job fails no matter which mode you choose.
The DTD package is extracted with protections against zip-based attacks, and file matching is safeguarded against unsafe external references.
Comments
0 comments
Article is closed for comments.