Newbie - XML displays as File, not With Link.

Larry Lindstrom

Usenet Archive
Joined
Sep 4, 2003
Messages
50
Reaction score
0
Hi Experts:

I'm working my way through the w3schools XML tutorial, using Mozilla 1.3 on my development and my web server PCs which run Solaris 8. Both machines are running Apache 2.0.47.

The w3schools is very Microsoft Internet Explorer oriented. I don't know Mozilla's diagnostic tools to help me troubleshoot XML.

W3Schools has an example XML with an XSL file that Mozilla displays fine when it resides on my web server PC. But when I bring it and it's XSL over to my development PC, under my public_html directories, and link to it in my index.html, only a grey area is displayed. There is no response to Mozilla's right mouse button, so I can't display the XML source

The page fails to display when Mozilla is asked to follow this link to the XML file:

<a
href="http://tiamat/~webuser/learn/xml/www.w3schools.com/xsl_tutorial/xsl_tra nsform/cdcatalog.xml"> XSL transform</a>

or if I type this address into Mozilla's location field:

http://tiamat/~webuser/learn/xml/www.w3schools.com/xsl_tutorial/xsl_transform/cdcatalog.xml

However, the XML displays fine if I want Mozilla to open it using the file menu.

file:///export/home/user/webuser/public_html/learn/xml/www.w3schools.com/xsl_tutorial/xsl_transform/cdcatalog.xml

In order to see if there is a permission problem, I su to "nobody", Apache's "User", and I can cd to the directory that has the XML and I can edit the file. So I don't think it's a permission error.

No error shows up in Apache's error_log.

Here is the xml and xsl:

cdcatalog.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>

<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
</catalog>

cdcatalog.xsl:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/">

<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Title</th>
<th align="left">Artist</th>
</tr>

<xsl:for-each select="catalog/cd">

<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>

</xsl:for-each>
</table>
</body>
</html>

</xsl:template>

</xsl:stylesheet>

I've been chasing this all night, I'm just learning to use XML, so this is probably something stupid.

Thanks
Larry
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
Larry said:
Hi Experts:

I'm working my way through the w3schools XML tutorial, using Mozilla 1.3 on my development and my web server PCs which run Solaris 8. Both machines are running Apache 2.0.47.

The w3schools is very Microsoft Internet Explorer oriented. I don't know Mozilla's diagnostic tools to help me troubleshoot XML.

W3Schools has an example XML with an XSL file that Mozilla displays fine when it resides on my web server PC. But when I bring it and it's XSL over to my development PC, under my public_html directories, and link to it in my index.html, only a grey area is displayed. There is no response to Mozilla's right mouse button, so I can't display the XML source

The page fails to display when Mozilla is asked to follow this link to the XML file:

<a
href="http://tiamat/~webuser/learn/xml/www.w3schools.com/xsl_tutorial/xsl_tra nsform/cdcatalog.xml"> XSL transform</a>

or if I type this address into Mozilla's location field:

http://tiamat/~webuser/learn/xml/www.w3schools.com/xsl_tutorial/xsl_transform/cdcatalog.xml

However, the XML displays fine if I want Mozilla to open it using the file menu.

file:///export/home/user/webuser/public_html/learn/xml/www.w3schools.com/xsl_tutorial/xsl_transform/cdcatalog.xml

In order to see if there is a permission problem, I su to "nobody", Apache's "User", and I can cd to the directory that has the XML and I can edit the file. So I don't think it's a permission error.

No error shows up in Apache's error_log.

Here is the xml and xsl:

cdcatalog.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>

<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
</catalog>

cdcatalog.xsl:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/">

<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Title</th>
<th align="left">Artist</th>
</tr>

<xsl:for-each select="catalog/cd">

<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>

</xsl:for-each>
</table>
</body>
</html>

</xsl:template>

</xsl:stylesheet>

I've been chasing this all night, I'm just learning to use XML, so this is probably something stupid.

Make sure Apache is set up to send .xsl files with Content-Type text/xml
 

Larry Lindstrom

Usenet Archive
Joined
Sep 4, 2003
Messages
50
Reaction score
0
Martin said:
Larry Lindstrom wrote:

Make sure Apache is set up to send .xsl files with Content-Type text/xml

Thanks Martin:

That did it.

It's odd. I built the same Apache/ModSSL 2.0.47 on both systems, I tried to make each Apache install the same for development machine and webserver. But the mime.types file on my web server is 471 lines long, and the mime.types file on my development system, which wasn't handling the XSL, is only 112 lines long.

I appreciate your response.

Thanks
Larry
 

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
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top