DTD generation from XML Schema

Discussion in 'XML' started by Rob Exley, Jan 26, 2004.

  1. Rob Exley

    Rob Exley Guest

    I think this is a sensible question but am happy to be pointed out the
    error of my ways.

    I am specifying a new product for which I would like to have an XML
    Schema interface (not sure whether W3C or Relax NG as yet). I would
    also like to have a DTD that describes the same interface for those
    clients who are unable to use Schemas for one reason or another. Is it
    possible to generate a DTD from a given Schema ? I can seem to find
    lots of things about specific tools generating DTD's and Schemas from
    a given XML document.

    However logically I would like to maintain one schema for which I can
    then generate an equally valid DTD and also example XML documents.

    BTW: I would ideally like this to be possible from either command line
    such that it can be hooked into the build process or from some kind of
    Emacs mode ?

    Appreciate any help in advance.....

    --
    Rob Exley
     
    Rob Exley, Jan 26, 2004
    #1
    1. Advertising

  2. Rob Exley wrote:

    > I think this is a sensible question but am happy to be pointed out the
    > error of my ways.
    >
    > I am specifying a new product for which I would like to have an XML
    > Schema interface (not sure whether W3C or Relax NG as yet). I would
    > also like to have a DTD that describes the same interface for those
    > clients who are unable to use Schemas for one reason or another. Is it
    > possible to generate a DTD from a given Schema ? I can seem to find
    > lots of things about specific tools generating DTD's and Schemas from
    > a given XML document.
    >
    > However logically I would like to maintain one schema for which I can
    > then generate an equally valid DTD and also example XML documents.


    I am not going to say that it is not solvable but at least a W3C XML
    schema can specify/constrain a lot of things a DTD can't do, for
    instance if you use some regular expression pattern to restrict the
    value of an element or attribute how would you want to express that in a
    DTD?
    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jan 26, 2004
    #2
    1. Advertising

  3. Rob Exley

    Rob Exley Guest

    Martin Honnen <> wrote in message news:<>...
    > Rob Exley wrote:
    >
    > > I think this is a sensible question but am happy to be pointed out the
    > > error of my ways.
    > >
    > > I am specifying a new product for which I would like to have an XML
    > > Schema interface (not sure whether W3C or Relax NG as yet). I would
    > > also like to have a DTD that describes the same interface for those
    > > clients who are unable to use Schemas for one reason or another. Is it
    > > possible to generate a DTD from a given Schema ? I can seem to find
    > > lots of things about specific tools generating DTD's and Schemas from
    > > a given XML document.
    > >
    > > However logically I would like to maintain one schema for which I can
    > > then generate an equally valid DTD and also example XML documents.

    >
    > I am not going to say that it is not solvable but at least a W3C XML
    > schema can specify/constrain a lot of things a DTD can't do, for
    > instance if you use some regular expression pattern to restrict the
    > value of an element or attribute how would you want to express that in a
    > DTD?


    I am happy to lose validation information that I have no way to
    specify in the DTD as long as the structure and relationships
    cardinality etc are maintained. I appreciate that using schemas I can
    provide a lot better validation for any documents using the schema.
     
    Rob Exley, Jan 26, 2004
    #3
    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.

Share This Page