HTML output method and & in URLs 2003-01-28 - By Voytenko, Dimitry
Hi,
>> Are you sure about this? I've just tested a URL string containing I definetely was wrong. Specification states only that '<' character is not encoded and '&' in case of '&{'. I just think Xalan always worked like this, so I took it as a granted.
Sorry for the confusion. This is definietely a XalanJ bug. I'm not sure if it's been reported. Can you take a look in the bugzila and report it, if it's not there?
Thanks, Dimitry
-----Original Message----- From: Angus McIntyre [mailto:angus@(protected)] Sent: Tuesday, January 28, 2003 12:22 To: xalan-j-users@(protected) Subject: RE: HTML output method and & in URLs
At 11:38 -0800 28.01.2003, Voytenko, Dimitry wrote: >Where exactly is this happening? In the attributes HREF/SRC? If so, this >behaviour is correct. Otherwise, links won't work in the browsers.
Are you sure about this? I've just tested a URL string containing '&' against a handful of browsers - Explorer 5, iCab 2.9, Chimera 0.8, Netscape 7 - and they all seem to take it in their stride. Although I think you may be right that older browsers will choke on it.
>I'm not quite sure how exactly you were trying to validate your HTML >document. HTML is not an XML, but SGML. Thus, you can't validate it against >XML rules.
Yes, I know that HTML validation is not the same thing as XML.
I'm going by the validation tool at <http://validator.w3.org/>, which flags as incorrect documents in which I use the:
arg1=foo&arg2=bar
version, and passes as correct documents in which I use:
arg1=foo&arg2=bar
relative to the HTML 4.0.1 Transitional doctype. The error messages are accompanied by an explanation:
http://validator.w3.org/docs/errors.html#bad-entity
and the recommendation to use '&' in URLs.
I believe that I've found a hacky solution, which is to write:
arg1=foo&amp;arg2=bar
in my input XML documents. Xalan munges the first '&' into '&', and I get the right output. This may come back to bite me at some stage in the future, but for the moment it seems to resolve the problem.
Thanks to everyone who answered.
Angus -- angus@(protected) http://pobox.com/~angus
_____________________________________________________ Sector Data, LLC, is not affiliated with Sector, Inc., or SIAC
|
|