At 02:40 PM 11/24/99 -0500, Rick Graham wrote: >> Is it the expected behavior that if elements are missing >> (ie specified in the DTD) >> from an XML document that the parser doesnt complain ? > >Not sure what all of the spec is, but I do know that an XML parser is >required to stop processing a document that is in error.
It's more complicated than that. If it's a *well-formedness* error, e.g. unbalanced tags, stray & character, unquoted attribute, etc, the XML processor has to die. If it's a *validity* error, i.e. you have a <foo> element even though they DTD says there shouldn't be one here, you're allowed to continue. You do have to report the error in either case. This works pretty well, because well-formedness errors are usually evidence of really gross breakage somewhere upstream. -Tim
