Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Newbie - XML displays as File, not With Link.

Reply
Thread Tools

Newbie - XML displays as File, not With Link.

 
 
Larry Lindstrom
Guest
Posts: n/a
 
      09-04-2003
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.../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"

xmlnssl="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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      09-04-2003


Larry Lindstrom wrote:

> 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.../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"
>
> xmlnssl="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

--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
 
Larry Lindstrom
Guest
Posts: n/a
 
      09-04-2003
Martin Honnen wrote:
>
> Larry Lindstrom wrote:


< Sad story snipped>

> Make sure Apache is set up to send .xsl files with Content-Type text/xml
>
> --
>
> Martin Honnen
> http://JavaScript.FAQTs.com/



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
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie: Non-interactive status displays - HOWTO? Chris Perl 3 02-18-2008 04:04 AM
Newbie question - only first word of alt tag displays! Chris Curtis Javascript 2 05-17-2006 01:12 PM
Classic asp date displays- changing over to aspnet date object displays Chumley Walrus ASP .Net 1 12-16-2004 09:57 PM
newbie issue - asp.net file displays as source aacool ASP .Net 4 02-17-2004 01:29 PM
XSLT transformation that just displays original XML? Matt Bradbury XML 3 08-21-2003 12:53 PM



Advertisments