Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 83966 - guide.dtd is invalid -- contains reference to undefined element
Summary: guide.dtd is invalid -- contains reference to undefined element
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs-developer
Classification: Unclassified
Component: Guide XML (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Xavier Neys (RETIRED)
URL: http://www.gentoo.org/dtd/guide.dtd
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-03 09:14 UTC by Helmut Enck-Radana
Modified: 2005-03-05 04:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Enck-Radana 2005-03-03 09:14:22 UTC
The definition of element mainpage and that of element guide each contain a reference to the element newsitems. The element newsitems is not defined.


Reproducible: Always
Steps to Reproduce:





There is a definition for an element news. This element is not referenced
anywhere in the DTD.

I assume the element newsitems was meant to be defined as containing one or more
occurrences of element news. To me, however, it doesn't seem to be intuitive to
have news elements as children of a newsitems element. I'd prefer to have
newsitem elements as children of a news element. If these elements have not been
used yet, I'd like to suggest to rename them.
Comment 1 Xavier Neys (RETIRED) gentoo-dev 2005-03-04 15:45:53 UTC
It might have been less confusing to use <newsitem> instead of <news>.

<newsitems> is not defined any further in the DTD because there is nothing to define. The home page uses a simple <newsitems/> element. It's just a placeholder that triggers the inclusion of the latest news items.
<news> is used and describes a newsitem.
Comment 2 Helmut Enck-Radana 2005-03-04 16:46:56 UTC
The problem remains that the DTD is invalid and thus all XML documents conforming to this DTD are invalid.

If documents conforming to this DTD should not have children within the newsitems element, this element has to be defined as an empty element - like this:

<!ELEMENT newsitems EMPTY>

In this case the definition of the element news and its children should be left out of this DTD, because the documents cannot contain any news elements.

If, however, the documents should conform to the DTD after inclusion of the newsitems, the definition of the newsitems element must be:

<!ELEMENT newsitems (news*)>

Comment 3 Xavier Neys (RETIRED) gentoo-dev 2005-03-04 23:11:25 UTC
>> If documents conforming to this DTD should not have children within the
>> newsitems element, this element has to be defined as an empty element - like this:
>> <!ELEMENT newsitems EMPTY>

You're right. I had overlooked this. Fixed.
Strangely enough, the front page was not valid. I suppose no one noticed because it hasn't changed since 2002/11/09 18:49:42.

>> In this case the definition of the element news and its children should be
>> left out of this DTD, because the documents cannot contain any news elements.

Wrong. It's not because <news> elements are not part of <newitems> that they do not exist. They do and they need to be validated.
Comment 4 Helmut Enck-Radana 2005-03-05 04:25:36 UTC
<news> can't be used as child element in the content of any other element in this DTD. It can only be used as root element. Is this the way how it is meant to be used? (If it is, may be it would be useful to have a comment in the DTD to make this clear?)