Missing entitites - Invalid or not well-formed ?

A

Andy Dingley

Suppose I have a XML document, in a format such as RSS.
I then use a reference to a well-known HTML entity, such as é

Clearly this isn't "correct" (the entity is unknown) - but is this
an error of well-formedness (i.e. at the XML level) or an error of
validity (incompatible with the referenced schema) ?
 
J

jmm-list-gn

Andy said:
Suppose I have a XML document, in a format such as RSS.
I then use a reference to a well-known HTML entity, such as é

Clearly this isn't "correct" (the entity is unknown) - but is this
an error of well-formedness (i.e. at the XML level) or an error of
validity (incompatible with the referenced schema) ?
It is not well-formed: it is a syntax error, an unknown entity.
Validation is more of a lexical (meaning) test.
 
R

Richard Tobin

Andy Dingley said:
Suppose I have a XML document, in a format such as RSS.
I then use a reference to a well-known HTML entity, such as é

Clearly this isn't "correct" (the entity is unknown) - but is this
an error of well-formedness (i.e. at the XML level) or an error of
validity (incompatible with the referenced schema) ?

That depends.

If there is no external DTD, and standalone="yes" is not specified,
then it is only a validity error. The reason for this is that a
parser that doesn't read the external DTD can't be sure that there
isn't a declaration there.

If there is no external DTD, or standalone="yes" is specified, then
any processor can be sure that there isn't a declaration, and the
error is a well-formedness error.

Bear in mind that even if it's "only" a validity error, many programs
will not be able to process such a document because they require fully
expanded documents. XSLT is a typical example of this.

Also bear in mind that DTD validation is the only kind of validation
related to entity declarations. Other schema mechanisms (XML Schemas,
RelaxNG, Schematron etc) do not address this issue because they are
not tied in to parsing in the way that DTD validation is.

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top