On Fri, Sep 13, 2002 at 10:26:19AM -0400, Mark Wilson wrote:
> I thought I understood DTD notation. However, the explain dtd contains glyphs that I have not seen before.
>
> The first is the " - - " after the element name and before the content model, as in:
>
> <!ELEMENT explain - - (serverInfo, databaseInfo?, metaInfo?, indexInfo?, (recordInfo|schemaInfo)?, initInfo?)>
>
> And, although I know what EMPTY means, I did not understand the " - 0 " in:
>
> <!ELEMENT supports - O EMPTY>
>
> These two glyphs imply that " 0 - " and " 0 0 " might also be glyphs.
>
> Can someone give me an on-line reference that explains this notation?
>
> Mark
I don't have an online reference handy, but these indicate when start
and end tags can be omitted. This is not legal in XML, so you don't
specify the - - bits.
- - means start and end tags must always be present
- O means start tag must always be present, but end tag can be omitted
O O means both tags can be omitted (which is rare/bad practice)
For EMPTY, - O is required as EMPTY says the end tag *must* be omitted.
Well, actually I think they changed the rules to say the end tag *may*
be omitted. For the tag <foo/> in XML, '<foo/' is actually the start tag
and '>' is actually the end tag, so the end tag is not actually omitted.
Alan
|