Closed Bug 38088 Opened 25 years ago Closed 25 years ago

<?xml-stylesheet?> PI not recognized

Categories

(Core :: XML, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED DUPLICATE of bug 48351

People

(Reporter: sytobinh, Assigned: nisheeth_mozilla)

Details

Attachments

(6 files)

I am using build 050111. When I used <link rel=..> the associated stylesheet is used. However, when I use <?xml-stylesheet href=...> nothing happens. This used to work, but I'm not sure when it stopped.
Do you have a testcase? Was the file being served as HTML or XML?
Some additional info. What is happening is that the <?xml-stylesheet?> PI is only recognized if the document has an <?xml?> declaration at the beginning. However, if you have the <?xml?> declaration, then Mozilla wants a style for each element. What I want to do is include a stylesheet in and XHTML document via the <?xml-stylesheet?> PI. Currently, this is impossible in Mozilla.
I've done many times the things that you say don't work, so you're going to have to provide more detail. I've used xml-stylesheet PIs (in documents served as text/xml, not text/html), and I've used the styles from the UA stylesheet in XML documents (via namespaces). Do you have a testcase that demonstrates this bug? I suspect what you're seeing is with a file on your hard disk, where the browser has to (well, it doesn't always have to, but I think it does??) guess the content type. An XML document needs to use namespaces to use HTML elements, and xml-stylesheet won't work in HTML documents.
As I have discoved, the bug I am really reporting is not that well described. In order to use <?xml-stylesheet?> you have to have <?xml?>. However, if you have <?xml?> then Mozilla won't render it as HTML (even if it is declared as XHTML). I think the correct solution would be if Mozilla, upon looking at the doctype, realized that these documents were HTML, despite also being XML, and then used its tools (which work just fine) to process it. This is really a recognition bug.
Do you have a testcase? As what MIME type are the files sent (or, if off a local disk, what extension is used)?
Whiteboard: awaiting clarification from reporter (05-29)
Sorry about not responding. Here's a good example. At the XML Schema Checker at http://cgi.w3.org/cgi-bin/xmlschema-check-new there is an option to return XML as MIME type text/plain. Now, Mozilla ignores this MIME type (in fact, it recently seems to refuse to display most text files) and just outputs some element text. It does this because the document begins with <?xml version='1.0'?>. I think that Mozilla should look at the document, and if it is HTML or has a full stylesheet render it, otherwise display as text.
If a file is sent as text/plain, it should be displayed as text. But what does that have to do with this bug, which is about the xml-stylesheet PI? Do you have a testcase for the xml-stylesheet PI not working? Or is the bug different from the original description?
Here's the problem. <?xml-stylesheet?> doesn't work unless you have <?xml?> (which is incorrect behavior, <?xml?> is optional). But if you include <?xml?> mozilla goes into XML display mode, which means that (1) it won't render the document as HTML (even when it is declared HTML). (2) if it is some sort of XML Mozilla does not recognize it doesn't display at all, unless there is a stylesheet sufficent to display it. What should happen is that if a document is HTML (with appropriate DOCTYPE and all) it should be rendered as HTML, and use <?xml-stylesheet?>. If it is not recognized XML, and has no stylesheet, it should display the text of the document.
David, you seem to know the most about this. Can you respond to the reporter's last comment?
Whiteboard: awaiting clarification from reporter (05-29)
sytobinh@uchicago.edu: Please use the "Create a new attachment" link above to add a testcase to this bug report. The testcase should clearly show the problem that occurs. We cannot fix the bug unless we have a testcase.
Is the document being served as text/html or text/xml?
sytobinh@uchicago.edo: Is this still a problem? Build 050111 is rather old right now, and a better handling for strict dtds has been incoporated into mozilla. If this problem is solved, please close this bug (e.g. as fixed or worksforme). Thanks.
I'm getting weird behaviour in Linux 2000070308. I'm attaching four testcases to illustrate. Here's what Mozilla does for each: Test 1 (uses &lt;link /&gt;, no &lt;?xml?&gt; prolog) - renders correctly Test 2 (uses &lt;link /&gt;, &lt;?xml?&gt; prolog) - renders correctly Test 3 (uses &lt;?xml-stylesheet?&gt;, no &lt;?xml?&gt; prolog) - does not load stylesheet Test 4 (uses &lt;?xml-stylesheet?&gt;, &lt;?xml?&gt; prolog) - does not load stylesheet Hmm, ok, from those results, it looks like Moz doesn't even understand &lt;?xml-stylesheet?&gt;. Did I do something wrong? The http://w3.org validator says I'm good and the "<a href="http://www.w3.org/TR/xml-stylesheet/">Associating Style Sheets with XML documents</a>" doc says I'm good. About to attach the four test cases. All are available from http://eliot.landrum.cx/mozilla/38088/
One last spam.. I told bugzilla to serve all of the testcases as text/html as it was never specified otherwise by the reporter. Reporter, sytobinh@uchicago.edu, please go through these testcases and let us know your results and which of these cases describe your problem. If none, then please attach one that does. We need this bug cleared out if you are not interested in following up on it.
Thanks for the testcases. The behavior of those 4 cases is as I think it should be. Content sent as text/html should (IMO) be treated as HTML, not as XHTML. The XHTML spec is useless for answering this question. What happens if they're attached as "text/xml"?
Attached file Test 3 (text/xml)
Attached file Test 4 (text/xml)
Ok, David.. the behaviour with these text/xml cases seems to be at least consistant. Is it correct? If so, let's resolve as invalid.
Marking invalid. Feel free to discuss further and possibly reopen if needed.
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
Reopening from invalid...
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
... and marking duplicate. *** This bug has been marked as a duplicate of 48351 ***
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → DUPLICATE
Adding keyword 'verifyme' to bug.
Keywords: verifyme
QA Contact: chrisd → petersen
Verified dupe.
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: