DTD for maxima internal form



The equivalent to a DTD is available
in lisp as the function  READ.   Conforming data is a lisp
expression which can be parsed by READ.  catching a
failure to read with an appropriate error handler would take
maybe 2 or 3 lines of lisp, and could say "not conforming to
Lisp syntax" or some other appropriate response.