XML transformed to HTML with XSLT; Javascript cannot use HTML <template>

Assigned to



3 years ago
3 years ago


(Reporter: thomas.rebele, Assigned: peterv)


47 Branch

Firefox Tracking Flags

(Not tracked)


(Whiteboard: btpp-followup-2016-03-11)


(3 attachments)



3 years ago
Created attachment 8725345 [details]

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36 OPR/35.0.2066.82

Steps to reproduce:

I use an XML file with texts, where parts of the texts are annotated by <mark>.
I transform this to a HTML document, which contains Javascript and a <template>.
The code adds two new nodes to the DOM, one with document.createTextNode(...) and one with document.importNode(...) for the template.

I run this directly in Firefox, Chrome, Opera and also generated an HTML file with
   xsltproc out.xml > out.html

I tested this with Firefox 44 and Firefox nightly (47.0a1, 2016-03-01)

Actual results:

When I open out.xml file in Chrome or Opera, both display the new nodes as expected.
Firefox however only shows the node created by document.createTextNode(...)
The out.html file works in all three browsers.

Expected results:

All browsers should show the same page for out.xml and out.html

Comment 1

3 years ago
Created attachment 8725346 [details]
file generated with "xsltproc out.xml > out.html"


3 years ago
Component: Untriaged → XSLT
Product: Firefox → Core
Whiteboard: btpp-followup-2016-03-04
Jonas, what do you think?
Flags: needinfo?(jonas)
Whiteboard: btpp-followup-2016-03-04 → btpp-followup-2016-03-11

Comment 3

3 years ago
Created attachment 8726918 [details] [diff] [review]

Fixing this for transforms from script for the source document looks pretty hard. We'd have to give XPath treewalker a mode in which it knows about template and use that just for XSLT :-/.
Assignee: nobody → peterv
Ever confirmed: true
I'm honestly not sure it's worth investing in this bug at all. XSLT is a dying technology and used by very few websites.
Flags: needinfo?(jonas)

Comment 5

3 years ago
I replaced the HTML template tag with another HTML+js template technology, so that it works in Firefox, Opera and Chrome. I guess that people will rarely encounter this bug.
You need to log in before you can comment on or make changes to this bug.