Last Comment Bug 110734 - Report 404 [file not found] for XSLT document
: Report 404 [file not found] for XSLT document
: regression, testcase
Product: Core
Classification: Components
Component: XSLT (show other bugs)
: Trunk
: All All
-- minor (vote)
: ---
Assigned To: Peter Van der Beken [:peterv]
: Keith Visco
: Andrew Overholt [:overholt]
: 144396 181571 (view as bug list)
Depends on: 203192
  Show dependency treegraph
Reported: 2001-11-19 02:40 PST by Alex Vincent [:WeirdAl]
Modified: 2013-08-12 22:46 PDT (History)
7 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Testcase (391 bytes, text/xml)
2001-11-19 02:50 PST, Alex Vincent [:WeirdAl]
no flags Details

Description User image Alex Vincent [:WeirdAl] 2001-11-19 02:40:24 PST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.5+) Gecko/20011116
BuildID:    Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.5+) Gecko/20011116

Loading an XHTML document saved as .xml, I have a missing XSLT document
referenced by a <?xml-stylesheet ?> processing instruction.  This 404 means the
XML parser should ignore the processing instruction; it does not.

Reproducible: Always
Steps to Reproduce:
1. Load the attached testcase (coming up)

Actual Results:  Blank page.

Expected Results:  "If you can read this, you don't need glasses" appears on the
page in H1 format.

Mozilla 0.9.5 renders the page without the special H1 formatting.  So this is
definitely a regression on an already bad bug.
Comment 1 User image Alex Vincent [:WeirdAl] 2001-11-19 02:50:29 PST
Created attachment 58346 [details]
Comment 2 User image Alex Vincent [:WeirdAl] 2001-11-19 02:54:17 PST
Strange... my local copy of said testcase is coming up blank, but the online
page is giving me plaintext.  :(

Comment 3 User image Axel Hecht 2001-11-19 02:57:18 PST
Neither nor 
specify the behaviour for a 404 in a stylesheet. It's an error, and it should
be reported. A "just do as if nothing ever happened" is plain wrong, IMHO.
Comment 4 User image Bradley Baetz (:bbaetz) 2001-11-19 06:51:01 PST
bz touched this in the last couple of days, at least for css
Comment 5 User image Peter Van der Beken [:peterv] 2001-11-19 07:17:25 PST
CSS stylesheet loading and XSLT stylesheet loading is totally different afaik. I
doubt it is related.
Comment 6 User image Axel Hecht 2002-05-15 00:57:50 PDT
*** Bug 144396 has been marked as a duplicate of this bug. ***
Comment 7 User image Heikki Toivonen (remove -bugzilla when emailing directly) 2002-05-26 23:14:04 PDT
Peter should look at this.
Comment 8 User image Heikki Toivonen (remove -bugzilla when emailing directly) 2002-05-26 23:17:14 PDT
Btw, in the case of CSS we just act as if there was no stylesheet so one could
argue the same should happen with XSLT. On the other hand, it is very likely
that the data would be totally unusable or seriously wrong, so an error result
is also justified. I think I'd prefer seeing an error message. What does IE do?
Comment 9 User image Tim Danner 2002-06-19 08:48:50 PDT
IE6 displays this error message when a referenced xslt stylesheet can't be loaded:

The XML page cannot be displayed 
Cannot view XML input using style sheet. Please correct the error and then click
the Refresh button, or try again later. 
XML document must have a top level element. Error processing resource '<url>'. 

In my opinion, an error message like this is the correct behavior. However, when
using IE in this manner, I wish it had a link/button/something to display the
xml without the stylesheet (perhaps in the spiffy IE xml-pretty printing mode).
Comment 10 User image Alex Vincent [:WeirdAl] 2002-06-19 17:06:48 PDT
IE's behavior is wrong in that they totally deny access to the XML document
underneath.  They block access to the data.

Heikki:  why would it be "totally unusable or seriously wrong"?  MathML and
XHTML are two XML languages Mozilla currently renders (relatively) correctly
without XSLT stylesheets; if the stylesheet is 404 or the wrong mimetype
(there's been another bug filed for that, which this may be a dupe of), an error
is justified, but that doesn't mean the MathML or XHTML aren't any good because
the stylesheet's busted...

For the record, the Amaya 6.1 editor does give the wrong stylesheet PI, which
breaks MathML in Mozilla.  Other than that, the MathML Amaya puts out is on very
solid ground.  (I filed a bug on this, and duped it to that other bug.)
Comment 11 User image Heikki Toivonen (remove -bugzilla when emailing directly) 2002-06-20 13:19:08 PDT
For example, if I send you a P3P policy file in XML, you will have a hard time
reading it without a stylesheet. An XSLT stylesheet can order the data in
logical order, make summaries, indices, links, and generate content to explain
the terse markup. I think this would be a typical situation where XSLT is used:
the raw XML is useless to most people, and needs some kind of stylesheet to make
any sense for humans.

Also it is quite possible that the raw XML would contain information for several
mutually excusive situations, needing a stylesheet to show and hide the relevant
parts. Without a stylesheet you could easily draw wrong conclusions.
Comment 12 User image Jonas Sicking (:sicking) No longer reading bugmail consistently 2002-11-26 02:00:02 PST
*** Bug 181571 has been marked as a duplicate of this bug. ***
Comment 13 User image Alex Vincent [:WeirdAl] 2003-03-28 18:38:25 PST
Re comment 2:  Behavior seems to have changed.  In a recent nightly,
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4a) Gecko/20030328

I get a blank gray screen.

I'm going to e-mail the W3C lists for xml-stylesheet and XSLT.  We really should
get an answer on this.
Comment 15 User image Alex Vincent [:WeirdAl] 2003-04-02 17:00:38 PST
:( W3C hasn't said much yet; the one reply I got says
"implementation-dependent".  We're on our own.
Comment 16 User image Axel Hecht 2003-04-14 10:10:41 PDT
This should be done with a nsIStreamListener, either directly in txStylesheetSink
or in a separate object. This needs to hook itself up between the channel and
the parser.
This should detect all netwerk errors, including 404 and bad mime.
It could provide a hook for both chrome and file schemes to trigger content
sniffing, too. This would be in OnStartRequest, check for unknown-content and
the right scheme, get the stream-converter-service and convert it. But that
should be a separate bug, IMHO.
Comment 17 User image Boris Zbarsky [:bz] (still a bit busy) 2003-04-14 10:39:57 PDT
> It could provide a hook for both chrome and file schemes to trigger content
> sniffing, too.

That should arguably be moved down into the channel impls, a la ftp and http
Comment 18 User image Peter Van der Beken [:peterv] 2003-05-05 06:45:56 PDT
Fixed with checkin for bug 203192.
Comment 19 User image Axel Hecht 2003-05-21 07:47:51 PDT
mass verifying

Note You need to log in before you can comment on or make changes to this bug.