Lists Home |
Date Index |
In article <417DED08.firstname.lastname@example.org> you write:
>"An internal general parsed entity is well-formed if its replacement
>text matches the production labeled content."
>My question is: when should such a WFness check be performed.
>(a) Immediately after the literal is parsed
>(b) Immediately after the DTD has been parsed
>(c) Only when it is referenced
>I don't think (c) is the answer
But it turns out that (c) *is* the answer, because the well-formedness
of an entity is only relevant to the well-formedness of the document
if it is referenced. See the definition of document well-formedness
at the beginning of section 2.1.
This means that you don't really have to check the entity's
well-formedness as such. Just expanding the entity and checking the
well-formedness of the document as you go along will have the same
effect, provided you check that elements end in the same entity that
they started in (and maybe one or two other things, I forget).