Derek
Derek

Reputation: 55

Chrome 39 XML/XSLT Renders Blank Page

I have old code from 2011 that has always worked properly. That is until Chrome 39. After beating my head in for awhile to try to diagnose, I determined that it works fine in IE, Firefox, and Chrome <= version 38. As of Chrome version 39, just a blank page is shown.

Seems like there is a change in handling of xsl/xslt, or xml, that is not allowing the page to render properly.

Are there any known changes to Chrome that would cause this? Any fix or workaround?

Thanks!

Example:

http://redemption.armory DOT eternal-wow.com SLASH arena-ladder.xml?ts=2&b=Eternal-WoW%21 http://eternal-wow.com

Upvotes: 3

Views: 2124

Answers (1)

matthias_h
matthias_h

Reputation: 11416

The link works in Firefox but results in blank page in Chrome. I checked with webdev tools and noticed that Chrome loads the xsl files from a different url as Firefox, e.g. .._layout/arena/language.xsl (404) instead of ../_layout/language.xsl (ok). In addition in Chrome I get the error message "Resource interpreted as Stylesheet but transferred with MIME type application/xslt+xml: "http://redemption.armory.eternal-wow.com/_layout/arena/ladder.xsl".
For this issue check Chrome says: Resource interpreted as Stylesheet but transferred with MIME type application/xml

The main problem seems to be the misinterpred xsl:import and xsl:include statements which seems to be a Chrome/Webkit Bug - see e.g. https://code.google.com/p/chromium/issues/detail?id=8441 or google for "xsl import relative path chrome". The first import in ladder.xsl works: <xsl:import href="../includes.xsl" /> (is loaded from ../_layout/includes.xsl). The <xsl:import href="language.xsl"/> in the includes.xsl fails in Chrome - it's resolved to ../_layout/arena/language.xsl instead of ../_layout/language.xsl. Same applies to the xsl:includes, e.g. in the language.xsl - . <xsl:include href="nav/menu.xsl" /> tries to include from ../_layout/arena/nav/menu.xsl instead of ../_layout/nav/menu.xsl.
As it seems to be a Chrome Bug, you could either try to just copy the xsl files to the location where Chrome is looking for them or try to adjust the include/import paths as Chrome seems to interpret the locations based on the main template - as "../includes.xsl" is working as import from the ladder.xsl in the arena-directory but <xsl:import href="language.xsl"/> in the includes.xsl is not resolved relative to the language.xsl, but instead relative to the ladder.xsl, changing to <xsl:import href="../language.xsl"/> might work for Chrome (but maybe won't work for other browsers, so I won't recommend that). Two suggestions - either you double the imports/includes, keeping the current imports/includes and adding each of them with a path relative to the ladder.xsl, or, which would be a cleaner solution, you check if you can move all imports and includes to the ladder.xsl and adjust the paths accordingly.

Upvotes: 2

Related Questions