sdesciencelover
sdesciencelover

Reputation: 149

Client-side XSLT Processing in Chrome Browser seems to depend on JavaScript

Simple question

Does the Chrome/Chromium browser built-in XSLT processing depend on JavaScript being enabled?

Context

I have a web application that always serves XML to be transformed client-side using XSLT. It also makes heavy use of client-side JavaScript. I've added a bit of markup and JavaScript that, if JavaScript does not run, displays a warning to the user that the application will not function properly until they turn it on.

This works in IE and Firefox, but when I "do not allow" JavaScript in Chrome browser, the page doesn't get rendered at all.

Upvotes: 0

Views: 1304

Answers (2)

Martin Honnen
Martin Honnen

Reputation: 167491

I tested with Google Chrome Version 23.0.1271.95 m on Windows 7 with the test documents http://home.arcor.de/martin.honnen/xslt/test2012120701.xml (XML document having xml-stylesheet processing instruction to apply XSLT stylesheet test2012120701.xsl which creates HTML result document with script element) and http://home.arcor.de/martin.honnen/xslt/test2012120702.xml (XML document having xml-stylesheet processing instruction to apply XSLT stylesheet test2012120702.xsl which creates HTML result document without any script) and indeed for both documents, when Javascript is disabled in Chrome, nothing is rendered. Using developer tools with F12 shows nothing but the xml-stylesheet processing instruction node in the document tree.

So based on that test it indeed seems that disabling Javascript in Chrome prevents XSLT processing via an xml-stylesheet processing instruction from working. When I enable Javascript again in Chrome and reload the documents the XSLT is applied in both cases.

Whether the Chrome behaviour is intentional or a bug I don't know but I can confirm the problem.

Upvotes: 1

innovimax
innovimax

Reputation: 560

No it doesn't

The problem is the way you call the XSLT Transform

If you do it with the Processing-Instruction

Take this sample (which is working more or less) which doesn't use Javascript

http://innovimax.fr/open-data.xsl

I say "more or less" because that sample was done when Twitter had a XML API. It's now JSON only.

Upvotes: 0

Related Questions