preprocessor for DTDs?

N

nobody

hello!

do you know of any (free) preprocessor able to deal with DTDs?

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)>
...
like with the good old C preproc.
I'm aware of the INCLUDE/IGNORE "feature" but I'm missing dynamic evaluation of this statements.

thx for any hints, andreas
 

Stefan Ram

Usenet Archive
Joined
Sep 3, 2001
Messages
3,281
Reaction score
0
nobody said:
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.
 

Alain Ketterlin

Usenet Archive
Joined
Apr 27, 2000
Messages
401
Reaction score
0
nobody said:
do you know of any (free) preprocessor able to deal with DTDs?

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)>
...
like with the good old C preproc.

Why not use... the good old preproc. It's called cpp on my system.

-- Alain.
 
N

nobody

Alain said:
Why not use... the good old preproc. It's called cpp on my system.
C preprocessors expect C syntax, at least those I tried out couldn't preproc non C sources ;-(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top