Closed Bug 269474 Opened 20 years ago Closed 20 years ago

XML displays as concatenated text instead of using stylesheet

Categories

(Core :: XSLT, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: none98765, Assigned: peterv)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

When viewing an XML file in Firefox that has a XSL attached 
<?xml-stylesheet type="text/xsl" href="simple.xsl" ?>

the XML file displays as concatenated text instead of rendering the styles to a
nice display.

(This also happens in Netscape 7.2 if that is at all relevant)

Seems similar to bug 249153 but not identical since that bug dealt with plain
XML being displayed as text.  Here plain XML displays correctly, it is only when
using an XSL that it displays incorrectly.

Reproducible: Always
Steps to Reproduce:
1. Go to http://www.w3schools.com/xml/simplexsl.xml in Firefox
2.
3.

Actual Results:  
XML was displayed as plain concatenated text

Expected Results:  
XML should have been styled.  Compare to results in IE 6 which are correct.
Assignee: bugs → general
Component: File Handling → Browser-General
Product: Firefox → Browser
QA Contact: bmo → general
Version: unspecified → Trunk
Hmmm... Trying some other xml files on the web - even on the same site - I have
found it does work for some - not for others.

For example, it works for this URL:
http://www.w3schools.com/xsl/cdcatalog_with_xsl.xml

Which links the XSL using the following line:
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>

Not sure why some work and some don't in Firefox while all seem to work in IE.
Wild guess: in the CD catalogue example (which works) the XSL stylesheet file is
of the form:
<xsl:stylesheet version="1.0">
...
</xsl:stylesheet>

In the simplexsl example (which doesn't work) the XSL stylesheet file is of the
form 
<html xsl:version="1.0" ... >
...
</html>

I'm no XSLT expert, but shouldn't that second one actually be XSL, rather than
"HTML"?
Assignee: general → peterv
Component: Browser-General → XSLT
QA Contact: general → keith
The stylesheet is applied in both cases. However the stylesheet at
http://www.w3schools.com/xml/simplexsl.xml
uses the wrong namespace for the xhtml that it's creating which means that we'll
just treat it as a random collection of unknown xml elements.

This works fine in IE because they don't support xml-output from XSLT but treat
everything as HTML (which of course is wrong on many levels)
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.