Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

XML w/ XSL in Firefox

Question posted by: CColvin (Guest) on March 28th, 2006 05:25 PM
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?

Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Richard Light's Avatar
Richard Light
Guest
n/a Posts
March 29th, 2006
07:05 AM
#2

Re: XML w/ XSL in Firefox
In message <1143569818.027738.76770@g10g2000cwb.googlegroups.c om>,
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
Join Bytes!


Martin Honnen's Avatar
Martin Honnen
Guest
n/a Posts
March 29th, 2006
10:25 AM
#3

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/

 
Not the answer you were looking for? Post your question . . .
183,814 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors