Connecting Tech Pros Worldwide Help | Site Map

XML w/ XSL in Firefox

  #1  
Old March 28th, 2006, 06:25 PM
CColvin
Guest
 
Posts: n/a
I have an XSL file that I have created to format some XML files into a
viewable report for a browser. Viewing it locally I have no problems
in IE v6.0 or Firefox v1.5.0.1.

We plan on distirbuting the .xml files for our clients to view. So we
uploaded the .xsl file to our webserver (ex:
www.mydomain.com/xml/style.xsl) Then in the .xml files we updated the
style sheet reference from pointing to the local copy to the one on the
webserver.
was: <?xml-stylesheet type="text/xsl" href="style.xsl"?>
now to: <?xml-stylesheet type="text/xsl"
href="http://www.mydomain.com/xml/style.xsl"?>

After this change was made the .xml appeared as it should on any
machine that had a web connection when using IE. But it stopped
working when viewing with Firefox. Firefox just displays the raw data
as one string and when viewing the page source it appears just as the
xml file does.

In IIS I have setup .xsl as a registered file type using the content
type of "text/xsl". This did not fix the issue.

What am I doing wrong?

  #2  
Old March 29th, 2006, 08:05 AM
Richard Light
Guest
 
Posts: n/a

re: XML w/ XSL in Firefox


In message <1143569818.027738.76770@g10g2000cwb.googlegroups. com>,
CColvin <b_carmon_colvin@yahoo.com> writes
[color=blue]
>We plan on distirbuting the .xml files for our clients to view. So we
>uploaded the .xsl file to our webserver (ex:
>www.mydomain.com/xml/style.xsl) Then in the .xml files we updated the
>style sheet reference from pointing to the local copy to the one on the
>webserver.
> was: <?xml-stylesheet type="text/xsl" href="style.xsl"?>
> now to: <?xml-stylesheet type="text/xsl"
>href="http://www.mydomain.com/xml/style.xsl"?>
>
>After this change was made the .xml appeared as it should on any
>machine that had a web connection when using IE. But it stopped
>working when viewing with Firefox. Firefox just displays the raw data
>as one string and when viewing the page source it appears just as the
>xml file does.[/color]

It may be a domain-crossing issue.

Try just using a local HREF from the XML to the stylesheet, rather than
an absolute one:

<?xml-stylesheet type="text/xsl" href="freddy.xsl"?>

This simple example certainly works for me in Firefox:

http://richardlight.org.uk/freddy.xml

Richard Light
--
Richard Light
SGML/XML and Museum Information Consultancy
richard@light.demon.co.uk

  #3  
Old March 29th, 2006, 11:25 AM
Martin Honnen
Guest
 
Posts: n/a

re: XML w/ XSL in Firefox




CColvin wrote:

[color=blue]
> was: <?xml-stylesheet type="text/xsl" href="style.xsl"?>
> now to: <?xml-stylesheet type="text/xsl"
> href="http://www.mydomain.com/xml/style.xsl"?>
>
> After this change was made the .xml appeared as it should on any
> machine that had a web connection when using IE. But it stopped
> working when viewing with Firefox.[/color]

It is a security restriction, you can only load a stylesheet from the
same origin the XML file comes from.


--

Martin Honnen
http://JavaScript.FAQTs.com/
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
client side xslt transformation in Firefox Zzzbla answers 7 December 27th, 2006 04:25 AM
Problems with XSL/XML Transform Object in Firefox N. Demos answers 2 July 23rd, 2005 08:46 PM
Xml+XSL: Problems with FireFox displaying Jesper Stocholm answers 7 July 20th, 2005 08:51 AM