When running the Xml AST output through xmllint, a validation error is thrown:
element document: validity error : root and DTD name do not match 'document' and 'CommonMark'
The offending line seems to be the DTD declaration in conjunction with the document’s root element:
<!DOCTYPE CommonMark SYSTEM "CommonMark.dtd"> <document xmlns="http://commonmark.org/xml/1.0">
Evidently, the DTD name
CommonMark does not match the name of the root element
The respective rule is given in the W3C Xml specification as
The Name in the document type declaration MUST match the element type of the root element.
Is that known, and are any changes (in particular, changes to
CommonMark.dtd, such as a renaming of the root element according to the DTD) planned for this?
The reason for my question is that in a project I am working on, ASTs are stored as Xml files at some point, and I’d like to make sure these Xml files are valid while also sticking to the conventions laid down by official CommonMark materials.