Connecting Tech Pros Worldwide Help | Site Map

XML w/ XSL in Firefox

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 28th, 2006, 05:25 PM
CColvin
Guest
 
Posts: n/a
Default XML w/ XSL in Firefox

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, 07:05 AM
Richard Light
Guest
 
Posts: n/a
Default 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, 10:25 AM
Martin Honnen
Guest
 
Posts: n/a
Default 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/
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.