Re: Analyzing DTDs

Discussion in 'XML' started by Dennis E. Hamilton, Aug 31, 2003.

  1. Well, first, if you mean only the valid cases, without concern for #PCDATA,
    you would only have (for root element <A>)

    <A><B><C></C></B><C></C></A>

    That is, there is only one valid structure for the given DTD.

    So I can't tell what you are really looking for.

    Maybe you meant <!ELEMENT A (B | C)> ?

    Then your last two examples are the only valid cases.

    How do you intend to deal with elements that are recursively defined?

    It might be good to stand back a little and consider the problem you are
    trying to solve that enumerating all of the valid structures is a solution.

    -- orcmid

    "Bernard Drolet" <> wrote in message
    news:...
    > Hi,
    >
    > we are looking for a way to analyze DTDs and extract all the
    > possibilities it contains.
    >
    > For example, if our DTD contains
    > <!ELEMENT A (B, C)>
    > <!ELEMENT B (C)>
    > <!ELEMENT C EMPTY>
    >
    > We need an output that would look something like
    >
    > A/B
    > A/C
    > A/B/C
    >
    >
    > Any suggestions ?
    >
    >
    > Bernard Drolet
    Dennis E. Hamilton, Aug 31, 2003
    #1
    1. Advertising

  2. You're right, the example was a bit too simple.

    I'm working in a departement writing technical documentation. The
    requirement I was given is to create a kind of quality control tool
    that will ensure the various possibilities of the DTD are covered by
    another document, called a layout (not related to XSL), that will
    display the data (which is SGML, not XML) in a printable way. My boss
    wanted to be sure we have not forgotten any possibility, or for the
    ones that are not covered, somebody will have to confirm there is
    nothing to print.

    The DTD in the example shall have been something like
    <!ELEMENT A (#PCDATA, B, C)>
    <!ELEMENT B (#PCDATA, C)>
    <!ELEMENT C (#PCDATA) >

    If our layout says it supports
    A
    C (general C)
    B/C (C under a B element)

    My boss wants to know the pcdata under B is not supported. He also
    wants to know that C is supported in two places.


    Thank you

    Bernard




    "Dennis E. Hamilton" <> wrote in message news:<>...
    > Well, first, if you mean only the valid cases, without concern for #PCDATA,
    > you would only have (for root element <A>)
    >
    > <A><B><C></C></B><C></C></A>
    >
    > That is, there is only one valid structure for the given DTD.
    >
    > So I can't tell what you are really looking for.
    >
    > Maybe you meant <!ELEMENT A (B | C)> ?
    >
    > Then your last two examples are the only valid cases.
    >
    > How do you intend to deal with elements that are recursively defined?
    >
    > It might be good to stand back a little and consider the problem you are
    > trying to solve that enumerating all of the valid structures is a solution.
    >
    > -- orcmid
    >
    Bernard Drolet, Sep 2, 2003
    #2
    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:
    439
    Jukka K. Korpela
    May 31, 2005
  2. chris

    Local DTDs: Where?

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

    Re: Analyzing DTDs

    Tad McClellan, Aug 29, 2003, in forum: XML
    Replies:
    0
    Views:
    388
    Tad McClellan
    Aug 29, 2003
  4. Miel Bronneberg

    DTDs, schema's and namespaces

    Miel Bronneberg, Sep 30, 2003, in forum: XML
    Replies:
    2
    Views:
    364
    Miel Bronneberg
    Sep 30, 2003
  5. Clifford W. Racz
    Replies:
    4
    Views:
    2,020
    Clifford W. Racz
    Feb 13, 2004
Loading...

Share This Page