First of all, PE references in the internal subset are required to
be whole declarations, so it's not well formed for that reason.
So suppose it was instead in the external subset. It would still be wrong
(invalid) because declarations must start and end in the same entity
(validity constraint on production 29).
This doesn't rule out something like
<!ENTITY % p1 ""abc">
<!ENTITY % p2 "def"">
<!ENTITY e1 %p1;%p2>
or (more simply)
<!ENTITY % p1 "'abc">
<!ENTITY % p2 "def'">
<!ENTITY e1 %p1;%p2>
I'm sure it was not intended that these be allowed - the purpose
of the extra space added to the expansion of PEs was to ensure that they
produce complete tokens - but I don't see where it is prohibited.
My parser reports "Error: Quoted string goes past entity end" for this
example, and I believe this is the right behaviour.
-- Richard