Closed Bug 217479 Opened 21 years ago Closed 21 years ago

xml-stylesheet hrefs with & in them don't get decoded to &s

Categories

(Core :: XML, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jerry, Assigned: hjtoi-bugzilla)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5b) Gecko/20030826 Mozilla Firebird/0.6.1+/jtalkington-nightly
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5b) Gecko/20030826 Mozilla Firebird/0.6.1+/jtalkington-nightly

An XML document with an xml-stylesheet declared such as:
<?xml-stylesheet type="text/xsl"
href="/cms.dll/xslshow?channel=-2128958273&amp;path=/articleshow"?>
don't get decoded to include the & (i.e. the URI is requested literally, with
the &amp; in it.)

Reproducible: Always

Steps to Reproduce:
1.
2.
3.




I'll attach a pcap trace showing this happening with the above URL, as well as a
test XML page, an HTML reference page, and a cgi to mail the QUERY_STRING
Contains:
timesofindia.trc - a pcap trace of the transaction
style.cgi - a cgi to mail the environment
test.html - a page that works correctly
text.xml - a page that chokes
Summary: xml-stylesheet hrefs with &amp; in them don't get decoded to &s → xml-stylesheet hrefs with &amp; in them don't get decoded to &s
An ASP had a Java script which generated a link local in the browser. Mozilla
1.5 produced wrong link as follows which also caused an error:

correct URL with IE:
http://xxxx/default.asp?kategori=rapporter&id=xxxx&aar=2003&per=10&rapport=20

wrong URL with Mozilla 1.5:
http://xxxx/default.asp?kategori=rapporter&amp;id=xxxx&amp;aar=2003&amp;per=10&amp;rapport=20
Entity references don't get decoded in processing instructions (if nothing else,
PIs come before you've declared your DTD).  From
http://www.w3.org/TR/REC-xml.html#sec-pi :

"Parameter entity references are not recognized within processing instructions."

And from http://www.w3.org/TR/REC-xml.html#dt-chardata :

 "The ampersand character (&) and the left angle bracket (<) may appear in their
  literal form only when used as markup delimiters, or within a comment, a
  processing instruction, or a CDATA section."

So the behavior here is correct.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: