preprocessor for DTDs?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nobody

    preprocessor for DTDs?

    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_co ntext.ch)
  • Stefan Ram

    #2
    Re: preprocessor for DTDs?

    nobody <nobody@nowhere .org> writes:[color=blue]
    >do you know of any (free) preprocessor able to deal with
    >DTDs?[/color]

    Two good preprocessors:


    FunnelWeb is a portable literate-programming macro preprocessor that enables you to weave code and documentation together.

    [color=blue]
    >
    >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)>[/color]

    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 "preprocess or" and then generate your DTD depending on
    this.




    Comment

    • nobody

      #3
      Re: preprocessor for DTDs?

      > do you know of any (free) preprocessor able to deal with DTDs?
      found one that nicely fits the bill:
      Double Helix DHpp - a standalone text preprocessor at

      Comment

      • Alain Ketterlin

        #4
        Re: preprocessor for DTDs?

        nobody <nobody@nowhere .org> writes:
        [color=blue]
        > 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.[/color]

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

        -- Alain.

        Comment

        • nobody

          #5
          Re: preprocessor for DTDs?

          Alain Ketterlin wrote:[color=blue][color=green]
          >> do you know of any (free) preprocessor able to deal with DTDs?
          >> like with the good old C preproc.[/color]
          > Why not use... the good old preproc. It's called cpp on my system.[/color]
          C preprocessors expect C syntax, at least those I tried out
          couldn't preproc non C sources ;-(

          Comment

          Working...