Empty documents always DTD-valid?

Discussion in 'XML' started by Soren Kuula, Sep 20, 2005.

  1. Soren Kuula

    Soren Kuula Guest

    Hi,

    Is an empty XML document valid by any valid DTD?

    -- I guess it is .. after all, declarations apply just to elements in
    the document, and hey, if there are none, there can be nothing wrong...

    Soren
     
    Soren Kuula, Sep 20, 2005
    #1
    1. Advertising

  2. Soren Kuula wrote:

    > Is an empty XML document valid by any valid DTD?


    I document can't be valid without a Doctype Declaration, and I'm pretty sure
    it can't be valid without a root element.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Sep 20, 2005
    #2
    1. Advertising

  3. In article <dgns78$6rl$-c.dk>,
    Soren Kuula <> wrote:

    >Is an empty XML document valid by any valid DTD?


    An empty document isn't even well-formed, let alone valid. An XML
    document must contain exactly one top-level element.

    -- Richard
     
    Richard Tobin, Sep 20, 2005
    #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.
Similar Threads
  1. Andy Carson
    Replies:
    8
    Views:
    391
  2. Joseph Tilian
    Replies:
    0
    Views:
    354
    Joseph Tilian
    Dec 21, 2004
  3. Ronald Fischer
    Replies:
    4
    Views:
    1,759
    Ronald Fischer
    Mar 17, 2005
  4. test
    Replies:
    2
    Views:
    2,039
    Oliver Wong
    Jul 28, 2006
  5. Berlin  Brown
    Replies:
    1
    Views:
    313
Loading...

Share This Page