External DTD Grammar
Chris Hubick
maillist at chris.hubick.com
Thu Aug 6 01:10:39 BST 1998
On Wed, 5 Aug 1998, John Cowan wrote:
> Quite right; my mistake. So "%foo;" is an eager PE reference, but
> "%foo;" within an entity value is a lazy PE reference (or
> more accurately, a deferred-once reference).
Hmm, this got me thinking, and I think I might understand now.
Basically I have been trying to figure out that if the grammar in the spec
is that for *after* PE's have been included, why does it contain
PEReferences? There are two instances of PEReference in the DTD
grammar, one in DocTypeDecl and the other in EntityValue. I can't see
any way to create a deferred PEReference in the internal subset and the
only way I can see to create one in the external subset, as sighted above,
is to use a CharRef (is this right?). So if you (non-recursively) process
all PEReferences at the "lexical" level, you will catch all the eager
ones, but the deferred ones will still make it up past the "lexical"
level. Since CharRef's are forbidden in the DTD, if you process
PEREferences at the "lexical" level, the only places a (deferred)
PEReference can occur above this level is (only while processing the
external subset) at the two places the grammar allows, DocTypeDecl and
EntityValue:
<!DOCTYPE test [
<!ENTITY % p2 "<!ENTITY e1 'not'>">
<!ENTITY % p1 "%p2;">
%p1;
]>
<test>This is &e1; obvious</test>
My HXP parser currently can recursively evaluate PEReferences occuring in
these two positions, so all I have to do to be able to add support for
parsing the external subset as well, is to process PEReferences at
the lexical level rather than just where specified by the grammar. Now as
I see it, this lower level processing doesn't need to be recursive to
bring everything inline with the grammar, does anyone disagree with this?
I am also under the impression that I don't need to process CharRef's at
this lower level either?
Much Thanks!
---
Chris Hubick
mailto:chris at hubick.com
http://www.hubick.com/
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list