Connecting Tech Pros Worldwide Help | Site Map

XML w/ XSL in Firefox

CColvin
Guest
 
Posts: n/a
#1: Mar 28 '06
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?

Richard Light
Guest
 
Posts: n/a
#2: Mar 29 '06

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

Martin Honnen
Guest
 
Posts: n/a
#3: Mar 29 '06

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