DTD validation for unused elements

Questions about XML that are not covered by the other forums should go here.
DavidNelson
Posts: 2
Joined: Sat Jun 28, 2008 3:55 pm

DTD validation for unused elements

Post by DavidNelson »

Greetings all -- I'm a newbie here with a novice-level problem. Hopefully some kind XML geek will help me out! I'm using Oxygen 9.2 and am working on some DTD modifications. In the past, I seem to remember being notified of elements in the DTD that are declared, but not actually used in any element models. This (as I remember) happened simply by validating the DTD document.

Now, while any DTD errors are reported, unused elements are not flagged. Thanks in advance for help to solve this mystery.

-David
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: DTD validation for unused elements

Post by sorin_ristache »

Hello,

No, an XML validator is not required to report elements that are declared in a DTD but not used in an element model in the DTD or in an XML document validated against that DTD. If I remember correctly there is no XML validator that had any version that reported unused elements of a DTD. I think you need to create a special application for checking such element names.


Regards,
Sorin
DavidNelson
Posts: 2
Joined: Sat Jun 28, 2008 3:55 pm

Re: DTD validation for unused elements

Post by DavidNelson »

Thanks Sorin, for the feedback. Now I realize that (as Roger Clemens might have put it) I "misremembered" the situation I had dealt with in the past. The problem I dealt with before was removed/undeclared elements being used in active element models -- causing DTD error warnings.

It makes sense that the parser would not balk at seeing a legally declared element even though it is not used anywhere.

-David
Post Reply