DTD names root element?

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

    #1

    DTD names root element?

    HI NG,

    AFAIK, a dtd names the root element, i.e.

    <!DOCTYPE test SYSTEM "SomeURL">

    must be followed by the root element named "test".
    However, Xerces 2.4.0 does not complain, if SomeURL refers to a
    DTDefinition which's root element name is different.

    Bug in Xerces or in my understanding?? ?

    Any help appreciated!
    Thx
    Christian
  • Johannes Koch

    #2
    Re: DTD names root element?

    Christian wrote:[color=blue]
    > HI NG,
    >
    > AFAIK, a dtd names the root element, i.e.
    >
    > <!DOCTYPE test SYSTEM "SomeURL">
    >
    > must be followed by the root element named "test".[/color]

    Yep
    [color=blue]
    > However, Xerces 2.4.0 does not complain, if SomeURL refers to a
    > DTDefinition which's root element name is different.
    >
    > Bug in Xerces or in my understanding?? ?[/color]

    A DTD does not define a root element. Several elements defined in a DTD
    can act as root elements for XML documents based on this DTD.
    --
    Johannes Koch
    In te domine speravi; non confundar in aeternum.
    (Te Deum, 4th cent.)

    Comment

    • Christian

      #3
      Re: DTD names root element?

      Johannes Koch <koch@w3develop ment.de> wrote in message news:<bhv9k4$3e t0h$1@ID-61067.news.uni-berlin.de>...[color=blue]
      > Christian wrote:[color=green]
      > > HI NG,
      > >
      > > AFAIK, a dtd names the root element, i.e.
      > >
      > > <!DOCTYPE test SYSTEM "SomeURL">
      > >
      > > must be followed by the root element named "test".[/color]
      >
      > Yep[/color]
      Nope! As far as Xerces is concerned. Using the example above, Xerces
      does not complain about a root element named 'toast' or whatever.[color=blue]
      >[color=green]
      > > However, Xerces 2.4.0 does not complain, if SomeURL refers to a
      > > DTDefinition which's root element name is different.
      > >
      > > Bug in Xerces or in my understanding?? ?[/color]
      >
      > A DTD does not define a root element. Several elements defined in a DTD
      > can act as root elements for XML documents based on this DTD.[/color]

      Comment

      • Bob Foster

        #4
        Re: DTD names root element?

        Really? Then Xerces is wrong (if it is validating). The name used in the
        DOCTYPE declaration and the root element name are required to be the same.
        Validity constraint: Root Element Type.

        This has nothing to do with the DTD.

        Bob

        "Christian" <christian@it-oeckinghaus.de> wrote in message
        news:12b6f66f.0 308260023.3506e 506@posting.goo gle.com...[color=blue]
        > Johannes Koch <koch@w3develop ment.de> wrote in message[/color]
        news:<bhv9k4$3e t0h$1@ID-61067.news.uni-berlin.de>...[color=blue][color=green]
        > > Christian wrote:[color=darkred]
        > > > HI NG,
        > > >
        > > > AFAIK, a dtd names the root element, i.e.
        > > >
        > > > <!DOCTYPE test SYSTEM "SomeURL">
        > > >
        > > > must be followed by the root element named "test".[/color]
        > >
        > > Yep[/color]
        > Nope! As far as Xerces is concerned. Using the example above, Xerces
        > does not complain about a root element named 'toast' or whatever.[color=green]
        > >[color=darkred]
        > > > However, Xerces 2.4.0 does not complain, if SomeURL refers to a
        > > > DTDefinition which's root element name is different.
        > > >
        > > > Bug in Xerces or in my understanding?? ?[/color]
        > >
        > > A DTD does not define a root element. Several elements defined in a DTD
        > > can act as root elements for XML documents based on this DTD.[/color][/color]


        Comment

        Working...