Firefox 3 fails to process XSLT files if they are outside of the current XML file's path (or descendant paths).
For example, these work:
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<?xml-stylesheet type="text/xsl" href="sub/test.xsl"?>
But these fail:
<?xml-stylesheet type="text/xsl" href="../test.xsl"?>
<?xml-stylesheet type="text/xsl" href="../sub/test.xsl"?>
This seems to only be for local files (not handled by a web server). I can reproduce it in both Ubuntu and Vista.
Firefox 2 and IE7 don't have this problem.
Any idea how to fix it?
Thanks!
Travis
Firefox 3 - XLST - Fails if local with .. in path [FIXED]
-
- Posts: 5
- Joined: August 1st, 2006, 11:25 am
Firefox 3 - XLST - Fails if local with .. in path [FIXED]
Last edited by tripecac on June 17th, 2008, 5:40 pm, edited 2 times in total.
-
- Posts: 5
- Joined: August 1st, 2006, 11:25 am
Re: Firefox 3 - XLST - Fails if local stylesheet has .. in path
Here are my simplified test files:
test/xsl/test.xsl
test/xsl/test.xml (xsl in same path, works)
test/test.xml (xsl in child path, works)
test/xsl/sub/test.xml (xsl in parent path, FAILS)
test/xml/test.xml (xsl in sibling path, FAILS)
test/xsl/test.xsl
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/test"><html><body><h1>This worked: <xsl:apply-templates /></h1></body></html></xsl:template>
</xsl:stylesheet>
test/xsl/test.xml (xsl in same path, works)
Code: Select all
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<test>xsl in same path</test>
test/test.xml (xsl in child path, works)
Code: Select all
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="xsl/test.xsl"?>
<test>xsl in child path</test>
test/xsl/sub/test.xml (xsl in parent path, FAILS)
Code: Select all
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../test.xsl"?>
<test>xsl in parent path</test>
test/xml/test.xml (xsl in sibling path, FAILS)
Code: Select all
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../xsl/test.xsl"?>
<test>xsl in sibling path</test>
- Daifne
- Moderator
- Posts: 123071
- Joined: July 31st, 2005, 9:17 pm
- Location: Where the Waters Meet, Wisconsin
Re: Firefox 3 - XLST - Fails if local stylesheet has .. in path
Moving to Web Development
- jscher2000
- Posts: 11771
- Joined: December 19th, 2004, 12:26 am
- Location: Silicon Valley, CA USA
- Contact:
Re: Firefox 3 - XLST - Fails if local stylesheet has .. in path
I don't have Firefox 3. Is the problem limited to relative ../ paths? How about an absolute sibling path, such as "/styles/text.xsl"?
-
- Posts: 5
- Joined: August 1st, 2006, 11:25 am
Re: Firefox 3 - XLST - Fails if local stylesheet has .. in path
Good question!
This works: file:///X:/temp/xslt-test/xsl/test.xsl
but this doesn't: /temp/xslt-test/xsl/test.xsl
(at least in Vista)
This works: file:///X:/temp/xslt-test/xsl/test.xsl
but this doesn't: /temp/xslt-test/xsl/test.xsl
(at least in Vista)
- jscher2000
- Posts: 11771
- Joined: December 19th, 2004, 12:26 am
- Location: Silicon Valley, CA USA
- Contact:
Re: Firefox 3 - XLST - Fails if local stylesheet has .. in path
This blog post seems relevant: John Resig - Tightened Local File Security
And this bug: Bug 402983 – Security checks that should be symmetric are now asymmetric
And this bug: Bug 402983 – Security checks that should be symmetric are now asymmetric
-
- Posts: 5
- Joined: August 1st, 2006, 11:25 am
Re: Firefox 3 - XLST - Fails if local stylesheet has .. in path
Thank you so much!!!
Here's the solution:
1) type about:config in the address bar
2) change security.fileuri.strict_origin_policy to false
This worked for me (so far).
Here's the solution:
1) type about:config in the address bar
2) change security.fileuri.strict_origin_policy to false
This worked for me (so far).