[Templates] template-toolkit and GD

Randal L. Schwartz merlyn@stonehenge.com
06 Nov 2002 11:49:59 -0800


>>>>> "Mark" == Mark Fowler <mark@twoshortplanks.com> writes:

Mark> Okay, doesn't that mean that href is CDATA?  And hence 
Mark> "foo?bar=baz&fred=barney" is right and "foo?bar=baz&amp;fred=barney" means 
Mark> something else entirely?

And think about it this way.  How could you ever get a double quote
into

        <img src="foo.jpg" alt="He said &quot;I can't!&quot;">

unless the alt attribute was being entity processed?  So if that's the
case, how do you get an & in there?  You *must* be able to spell it as
"&amp;", otherwise you could never have an ampersand q u o t
semicolon!  (And no, you can't shift to single quotes, because then
you couldn't put "can't" in there.)

So yes, all attribute values are entity processed, simply because we'd
have no way to specify ANY POSSIBLE attribute otherwise.  The XML/SGML
spec is complete in that sense.

But because this is widely misunderstood, the browsers commonly *error correct*
the string HREF="foo?fred=flintstone&barney=rubble" to DWIM.  But
it *is* error correcting, and you'll get burned some day to count on it.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!