In defense of PEs (but not in XML) (was Re: Parameter entities vs. GI name groups)

 
> From: len bullard <cbullard@hiwaay.net>
 
> David G. Durand wrote:
> > 
> > the harders thing about learning PEs is that the string
> > substitution model is _not_ correct.
> 
> Please explain this.  String substitution is 
> precisely what they appear to be.  So, I am missing 
> something and wish tutoring.

Even though I don't think XML particularly needs PEs, I think they are being wrongly criticised because they are not like CPP
macros.  If you demand CPP macros, use them at your server!

PEs are very well-behaved "macros".  The constraints on their placement make them less easy to abuse. In particular, they stop a
"macro" from including text that goes outside the scope of the current production.   So when you read a DTD and you see a parameter
entity reference, you always know that you can skip over it and visually keep parsing: it will not contain any nasty suprises.   


Rick Jelliffe

Received on Saturday, 21 June 1997 01:26:08 UTC