preprocessor for DTDs?

Discussion in 'XML' started by nobody, Oct 13, 2003.

  1. nobody

    nobody Guest

    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 (ala_NO@SPAM_context.ch)
     
    nobody, Oct 13, 2003
    #1
    1. Advertising

  2. nobody

    Stefan Ram Guest

    nobody <> 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.
     
    Stefan Ram, Oct 13, 2003
    #2
    1. Advertising

  3. nobody

    nobody Guest

    nobody, Oct 14, 2003
    #3
  4. nobody <> writes:

    > 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.
     
    Alain Ketterlin, Oct 15, 2003
    #4
  5. nobody

    nobody Guest

    Alain Ketterlin wrote:
    >> do you know of any (free) preprocessor able to deal with DTDs?
    >> like with the good old C preproc.

    > 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 ;-(
     
    nobody, Oct 19, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JimO

    DTDs and syntax

    JimO, May 30, 2005, in forum: HTML
    Replies:
    3
    Views:
    443
    Jukka K. Korpela
    May 31, 2005
  2. chris

    Local DTDs: Where?

    chris, Aug 14, 2003, in forum: XML
    Replies:
    3
    Views:
    391
    Bob Foster
    Aug 16, 2003
  3. Tad McClellan

    Re: Analyzing DTDs

    Tad McClellan, Aug 29, 2003, in forum: XML
    Replies:
    0
    Views:
    390
    Tad McClellan
    Aug 29, 2003
  4. Clifford W. Racz
    Replies:
    4
    Views:
    2,035
    Clifford W. Racz
    Feb 13, 2004
  5. Cronus
    Replies:
    1
    Views:
    676
    Paul Mensonides
    Jul 15, 2004
Loading...

Share This Page