HTMLBuilder and <A HREF='script.py?foo=bar&ding=bats'>yeah teah</A>

Steve Holden sholden at bellatlantic.net
Thu Mar 9 18:16:39 CET 2000


Vespe Savikko wrote:
> 
> Also sprach Steve Holden <sholden at bellatlantic.net>:
[snippety snip]
> 
> Did you write those links in HTML file? Like in the example page below:
> 
> http://www.cs.tut.fi/~vespe/amp/
> 
> The links on that page invoke a script that tells its arguments and
> behaviour is identical with or without escaping the ampersand. If you
> look at the URL bar of the script page you notice that the browser has
> decoded character entity &amp; to &
> 
>   [SH] and sure enough that's what happens.  HTML encoding surely isn't
>   appropriate inside attribute values: it's used between tags to ensure
>   the browser correctly renders text which might otherwise be incorrectly
>   interpreted as markup, or require illegal characters in the HTML stream.
> 
> [Quotes HTML specification]
> 
> Source: http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.2.2
> 
>   So the question remains: how to stop the startElement from HTML
>   entity-encoding the HREF attribute of an <A> tag.  Some kind of escape
>   mechanism?  Or are you suggesting that Netscape 4.7 os broken in some
>   fundamental way?
> 
It turns out I was misguided by an artifact of the mail reader, which of
course does not interpret the entity references in the same way as the browser.
Putting links into my test page yields the same behaviour as yours.

> I can only insist that you try out the example I prepared.
> 

Which works perfectly and proves that the startElement procedure appears to
be functioning correctly (unlike my brain).

>   ++Vespe
> 
> --
>   ------------------------------------------------------------------
>        Vespe Savikko     vespe at cs.tut.fi     - to doom de doomsday -

Keeping-away-from-that-send-key-for-a-while-ly y'rs - Steve
--
"If computing ever stops being fun, I'll stop doing it"



More information about the Python-list mailing list