Validating DITA input without generating output? #3916
-
Is there a way to run the preprocessing part of the DITA-OT without generating any output, to see if there are any issues (schema, cross-references, missing files, and so on) lurking in the input files? Conceptually, it would be an "empty" transformation, something like
I tried redirecting output to /dev/null:
but I get various filesystem call failures with this approach:
I guess I could create a custom plugin with a new transformation type that does nothing, but it would be great if there's some clever way to do this with the DITA-OT as-is. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Would this DITA Validator Plug-in suit your purposes? dita -f svrl -i document.ditamap Once the command has run, all errors and warnings are echoed to the command line
It doesn't rely on the preprocessor since the errors could be within a The original DITA-OT 2.x code from HERE can be found on their GitHub a maintained DITA-OT 3.x fork can be found on here |
Beta Was this translation helpful? Give feedback.
-
If you only want the validation and checks from preprocess, a custom transtype that only runs preprocess or preprocess2 should do it. |
Beta Was this translation helpful? Give feedback.
-
I ended up writing a Perl script that uses Because Note that Another limitation is that |
Beta Was this translation helpful? Give feedback.
I ended up writing a Perl script that uses
jing
(the RelaxNG validation engine) to do this. Here's a link to the script:ditaot_validate.pl
Because
jing
performs only parsing and validation, it is very fast even for large numbers of files:Note that
ditaot_validate.pl
performs validation of files and directories of files; it does not follow map hierarchy or validate just the files used by a map. For that, the plugin approach described earlier would be better.Another limitation is that
jing
crashes when validating DITA grammars that include thesvg-d
domain. I am not sure how to resolve this yet.