Newbie - XML displays as File, not With Link.

Discussion in 'XML' started by Larry Lindstrom, Sep 4, 2003.

  1. 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
    Larry Lindstrom, Sep 4, 2003
    #1
    1. Advertising

  2. 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.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

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Sep 4, 2003
    #2
    1. Advertising

  3. 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
    Larry Lindstrom, Sep 4, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. aacool
    Replies:
    4
    Views:
    339
    aacool
    Feb 17, 2004
  2. Chumley Walrus
    Replies:
    1
    Views:
    12,164
    =?Utf-8?B?QnJpYW4gQnJvd24=?=
    Dec 16, 2004
  3. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    798
    Kevin Spencer
    May 17, 2005
  4. Earl Teigrob

    Making datagrid hyperlink column displays Link or Text???

    Earl Teigrob, Jan 19, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    164
    Earl Teigrob
    Jan 19, 2004
  5. Vance Collins
    Replies:
    1
    Views:
    141
    Ray at
    Jan 22, 2004
Loading...

Share This Page