Open
Bug 749641
Opened 13 years ago
Updated 1 month ago
Incorrect rendering of HTML output from XSLT
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
NEW
People
(Reporter: joel.hp, Unassigned)
Details
Attachments
(4 files, 3 obsolete files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.36 Safari/536.5
Steps to reproduce:
I used two <xsl:apply-templates> to apply a template recursively.
XML input:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="main.xsl" type="text/xsl" ?>
<page>
<title>Home</title>
<content>
<h1>I am displaying things.</h1>
<p>these are the things I am displaying.</p>
<foobar>This is some other thing.</foobar>
</content>
</page>
XSL:T stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/xhtml1/transitional">
<xsl:output method="html" indent="yes" />
<xsl:template match="page">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><xsl:value-of select="title" /></title>
</head>
<body>
<div id="container">
<xsl:apply-templates select="content" />
</div>
</body>
</html>
</xsl:template>
<xsl:template match="foobar">
<h1>OMG FIREFOX WHY U NO WERK</h1>
</xsl:template>
<xsl:template match="h1 | p">
<xsl:copy-of select="." />
</xsl:template>
</xsl:stylesheet>
Actual results:
The second-level <xsl:apply-templates> was applied but not rendered. Saving the file (webpage-complete) and then opening it yields the correct results.
Expected results:
The nested template should have been rendered once applied.
Tested on 10.0.2 and 11.0
Comment 1•9 years ago
|
||
Hi Joel,
I have tested this issue using the latest Firefox release (43.0.4), latest Nightly build (46.0a1). I used your provided code and I have created an “.html” page to run it and the result is in my attachment. I`ve got the same result in Chrome. What should the code display exactly?
Firefox: 43.0.4, Build ID: 20160105164030, User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:43.0) Gecko/20100101 Firefox/43.0
Firefox: 46.0a1, Build ID: 20160113135947, User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:46.0) Gecko/20100101 Firefox/46.0
Also, can you please test this on the latest Firefox release (43.0.4) or latest Nightly (46.0a1, https://nightly.mozilla.org/) and tell me if this still reproduces for you ? When doing this please use a new fresh Firefox profile, maybe also in safe mode (https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problems).
Thanks,
Cosmin.
Flags: needinfo?(joel.hp)
Hi,
The test case (from four years ago) still doesn't work on my machine. Unfortunately, I've since changed my work machine (twice) and OS (I now use linux), and am not able to verify if it reproduces on my old configuration. It seems like it's not been fixed, though.
Unfortunately you seem to have misinterpreted my test case. I've provided two files: the first is an XML file, and the second an XSL:T stylesheet (to be saved as main.xsl in the same directory). When viewed in Firefox, the XSL:T stylesheet generates a <h1> element that correctly displays as such in the DOM viewer, but does not have the CSS <h1> style applied. (instead it appears as an ordinary block-level element). Saving the XSL:T output to a new HTML file and viewing that separately does produce the correct render output. I'll put images up to show what I mean.
Flags: needinfo?(joel.hp)
SL:T stylesheet used by test XML file
Attachment #619055 -
Attachment is obsolete: true
Comment 7•9 years ago
|
||
Attachment #8707909 -
Attachment is obsolete: true
Attachment #8710421 -
Attachment is obsolete: true
Comment 8•9 years ago
|
||
Sorry this report got lost the first time (it seems we'll be much better with this in 2016 - see https://groups.google.com/d/msg/firefox-dev/N3tipULr-HA/UdgRyfFeAgAJ). Also sorry this was not moved to an appropriate component, where someone with knowledge of XSLT would see it!
Now back to the point:
If I change this:
> xmlns="http://www.w3.org/TR/xhtml1/transitional">
to this:
> xmlns="http://www.w3.org/1999/xhtml">
everything works like you expect (the h1 inside <xsl:template match="foobar"> is displayed as a header).
I'm not sure what xmlns="http://www.w3.org/TR/xhtml1/transitional" is supposed to mean. Was this a typo?
Flags: needinfo?(joel.hp)
Comment 9•9 years ago
|
||
Firefox: 45.0.1, Build ID: 20160315153207
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Hi,
I have retest this on the latest Firefox (45.0.1) release, latest Nightly (48.a01 - Build ID: 20160328030215) build and I was able to reproduce this issue using the provided test case from comment 7.
Joel can you please look over the comment 8, and come back with an answer?
Thanks,
Cosmin.
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM
Ever confirmed: true
Product: Firefox → Core
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Updated•2 years ago
|
Severity: normal → S3
Comment 10•1 month ago
|
||
Clear a needinfo that is pending on an inactive user.
Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE
.
For more information, please visit BugBot documentation.
Flags: needinfo?(joel.hp)
You need to log in
before you can comment on or make changes to this bug.
Description
•