xml-stylesheet referenc problem

T

tjakopec

Hi to all!

Situation:

First document (data.xml):

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="data.xsl"?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
....

</data>

Second document (data.xsl)
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:eek:utput method="html"/>

<xsl:template match="/">
....
</xsl:template>

</xsl:stylesheet>


when these two documents are in same directory on my local disk
everyting is OK, BUT what I want is:
data.xml is on my local disk
data.xsl is somewhere on web (http://www.myweb.com/data.xsl)
load to my web browser (firefox) data.xml and see tranformed data via
data.xsl

then data.xml will look like
<?xml-stylesheet type="text/xsl" href="http://www.myweb.com/data.xsl"?>
and data.xsl is on http://www.myweb.com/data.xsl

This combination dont work!

What I am doing wrong?
 
M

Martin Honnen

BUT what I want is:
data.xml is on my local disk
data.xsl is somewhere on web (http://www.myweb.com/data.xsl)
load to my web browser (firefox) data.xml and see tranformed data via
data.xsl

then data.xml will look like
<?xml-stylesheet type="text/xsl" href="http://www.myweb.com/data.xsl"?>
and data.xsl is on http://www.myweb.com/data.xsl

For security reasons browsers often disallow using/combining resources
from different origins. I am sure Firefox will not allow an XML document
on e.g. http://example.com/ to load an XSLT stylesheet from e.g.
http://example.org/. Whether it also disallows access to stylesheets on
the web for local XML document I am not sure but that could be the problem.
The only other problem I see could be MIME types, make sure that web
server serves the data.xsl with HTTP Content-Type application/xml or
text/xml, see the Mozilla XSLT FAQ:
<http://www.mozilla.org/projects/xslt/faq.html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top