nobody <no****@nowhere.org> writes:
do you know of any (free) preprocessor able to deal with
DTDs?
Two good preprocessors:
http://math.polytechnique.fr/cmat/auroux/prog/gpp.html
http://www.ross.net/funnelweb/
I'dlike to do things as
#define with_b
...
<!ELEMENT a (#PCDATA)>
<!ELEMENT c (#PCDATA)>
#ifdef with_b
<!ELEMENT b (#PCDATA)>
#endif
...
#ifdef with_b
<!ELEMENT x (a+,
#ifdef with_b
b*,
#endif
c)>
I would use any language, or even better: Perl, i.e.:
use strict;
use warnings;
sub with_b
{ return "
<!ELEMENT a (#PCDATA)>
<!ELEMENT c (#PCDATA)>
"; }
if( defined with_b )
{ print "
<!ELEMENT b (#PCDATA)>
"; }
This (perl) is even better than any pre-processor - you could
easily query a database or a remote web page, if you want to
make you DTD depending on its contents or arbitrarily complex
functions of both. There are even CPAN modules to help you
to parse DTDs, so you could also analyze another DTD with
that "preprocessor" and then generate your DTD depending on
this.