Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XSLT stylesheet relative path problem under windows

I have a stylesheet located at /template.xsl and an xml file located at /en/index.xml, where "/" (the root) is actually of the form "C:\stuff\otherstuff\".

The xml file contains <?xml-stylesheet type="text/xsl" href="../template.xsl"?>, but the stylesheet isn't detected. I've tried countless variation, using backslashes or pair or backslashes instead of slashes, using file:///, absolute path, ...

What is wrong ?

Edit : for the record, it does work in IE but not in Firefox.

Edit : and here is the explanation : http://forums.mozillazine.org/viewtopic.php?f=25&t=670995 This also include the solution :

  1. type about:config in the address bar
  2. change security.fileuri.strict_origin_policy to false
like image 268
Norswap Avatar asked Jan 26 '11 23:01

Norswap


1 Answers

I noticed that if your put template.xsl in a subdirectory say DISPLAY, href="DISPLAY/template.xsl" does work. But if you put your XML in another subdirectory, say A, href="../DISPLAY/template.xsl" doesn't work.

It seems that there is a problem with "..".

(Even in 2015, when using Firefox 40.0 !) See Nicholas Smethurst's attachment in : https://bugzilla.mozilla.org/show_bug.cgi?id=439924

--> as said above, switch security.fileuri.strict_origin_policy

like image 51
Eric H. Avatar answered Oct 26 '22 13:10

Eric H.