Re: [PHP Template] A suggestion

[email protected] (Dan Libby) Tue, 29 Feb 2000 16:16:16 -0800
Newsgroups php.template
Message-ID <[email protected]>
Andrei Zmievski wrote:

> On Mon, 28 Feb 2000, Dan Libby wrote:
> > html escaping should work for XML also, so long as it uses character entities.
> > For plain ascii, why would they want to escape?  Anyway, the attribute should
> > probably be called "htmlescape" instead of escape. Actually, more useful would be
> > escape="html|xml|url", and equivalent unescape="html|xml|url".  There are
> > probably some other escape types that would be good too.
>
> Yeah, that was my question, is there a difference between HTML and XML
> escaping?

Not to my knowledge.  It is possible that some html escaping routines might use &copy;
et al instead of the ordinal value, which would not work for xml.  But I don't know
about the PHP routines.

> URL escaping might be good, but I have to ask, should it really be done
> in the template or in the script?

It is a common enough requirement that I think designers may need to do it on a
semi-regular basis.  Further, it is a more general escaping mechanism than html escape,
which doesn't escape newlines, tabs, etc that people often need escaped.

-dan