473,324 Members | 2,313 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Problem converting XML to HTML using XSLT on Netscape 7.0

Hi all,

I'm having a bizarre problem converting XML files to HTML using an
XSLT. The problem is only occuring in my Netscape 7.0 browser. What
makes it more bizarre is that it is only happening when I put my XML
files and the .xsl files on my ISP's system for my home page. If I
try to open the XML files in Netscape 7.0 on my own machine (ie, not
on the ISP's system), the pages convert file and the result is
displayed in HTML.

Under IE 6.0 there is no problem, both when the files are on the ISP's
system or on my own machine.

When I try to view the files from my ISP's system under Netscape 7.0,
all I see is the XML code. There is no error message or anything like
that, just the XML code.

Something else that is bizarre...I went out to www.w3schools.com and
was working through one of their tutorials on XSLT. I took a look at
one of their examples converted XML to HTML by applying an XSLT. When
I tried their example on their system using Netscape 7.0, it worked
fine. However, when I took THEIR files and loaded them on my ISP's
system and tried to view them using Netscape 7.0, again all I got to
see was the XML code. Again, under IE 6.0 it worked fine in all
cases.

Below is one of the XML files:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="transcript.xsl"?>
<transcript>
<school>
<name>University of Massachusetts - Lowell</name>
<city>Lowell</city>
<state abbreviation="MA">Massachusetts</state>
<websiteurl>http://www.uml.edu/dce</websiteurl>
<degree_program>None - Continuing Education Courses
only</degree_program>
</school>
<courses>
<course>
<coursenumber>92.268</coursenumber>
<coursename>C++ Programming</coursename>
<semester>Spring</semester>
<year>1993</year>
<grade>A/B</grade>
<credits>3.0</credits>
<qualitypoints>3.5</qualitypoints>
</course>
<course>
<coursenumber>92.270</coursenumber>
<coursename>Visual C++ Programming</coursename>
<semester>Spring</semester>
<year>1998</year>
<grade>A</grade>
<credits>3.0</credits>
<qualitypoints>4.0</qualitypoints>
</course>
<course>
<coursenumber>90.301</coursenumber>
<coursename>Java Programming</coursename>
<semester>Spring</semester>
<year>1999</year>
<grade>A</grade>
<credits>3.0</credits>
<qualitypoints>4.0</qualitypoints>
</course>
<course>
<coursenumber>91.373</coursenumber>
<coursename>Dynamic HTML</coursename>
<semester>Spring</semester>
<year>1999</year>
<grade>A/B</grade>
<credits>3.0</credits>
<qualitypoints>3.5</qualitypoints>
</course>
<course>
<coursenumber>92.269</coursenumber>
<coursename>Advanced C++ Programming</coursename>
<semester>Summer</semester>
<year>1999</year>
<grade>A</grade>
<credits>3.0</credits>
<qualitypoints>4.0</qualitypoints>
</course>
<course>
<coursenumber>90.303</coursenumber>
<coursename>Advanced Java</coursename>
<semester>Summer</semester>
<year>2001</year>
<grade>A</grade>
<credits>3.0</credits>
<qualitypoints>4.0</qualitypoints>
</course>
<course>
<coursenumber>90.307</coursenumber>
<coursename>Advanced Topics in Java and XML</coursename>
<semester>Summer</semester>
<year>2002</year>
<grade>A</grade>
<credits>3.0</credits>
<qualitypoints>4.0</qualitypoints>
</course>
</courses>
<totals>
<gradepointaverage maximum="4.0">3.857</gradepointaverage>
<credits>21</credits>
</totals>
<notes>
<note>These courses were taken through the Universitys
Department of Continuing Education, and are not part of a degree or
certificate program.</note>
<note>It is worth noting that these courses were not paid for by
an employer, but out of my pocket, because I believe it is my
responsibility to keep my skills as modern as possible.</note>
</notes>
</transcript>

And here is the XSLT that is supposed to convert this into HTML:

<?xml version="1.0"?>
<xsl:stylesheet id="transcript"
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html"/>

<xsl:template match="/">
<xsl:element name="html">
<xsl:element name="body">
<xsl:apply-templates select="transcript/school"/>
<xsl:element name="table">
<xsl:attribute
name="width"><xsl:text>100%</xsl:text></xsl:attribute>
<xsl:apply-templates select="transcript/courses"/>
<xsl:apply-templates select="transcript/totals"/>
</xsl:element>
<xsl:apply-templates select="transcript/notes"/>
</xsl:element>
</xsl:element>
</xsl:template>

<xsl:template match="school">
<xsl:element name="title">
<xsl:value-of select="./name"/><xsl:text>
Transcripts</xsl:text>
</xsl:element>
<xsl:element name="h2">
<xsl:attribute
name="align"><xsl:text>center</xsl:text></xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of
select="./websiteurl"/></xsl:attribute>
<xsl:value-of select="./name"/>
</xsl:element>
</xsl:element>
<xsl:element name="h3">
<xsl:attribute
name="align"><xsl:text>center</xsl:text></xsl:attribute>
<xsl:value-of select="./city"/><xsl:text>,
</xsl:text><xsl:value-of select="./state/@abbreviation"/>
<xsl:element name="br"/>
</xsl:element>
<xsl:element name="h4">
<xsl:attribute
name="align"><xsl:text>center</xsl:text></xsl:attribute>
<xsl:element name="u"><xsl:text>DEGREE
PROGRAM:</xsl:text></xsl:element>
<xsl:text> </xsl:text><xsl:value-of
select="./degree_program"/>
</xsl:element>
</xsl:template>

<xsl:template match="courses">
<xsl:element name="tr">
<xsl:element name="th">Course Number</xsl:element>
<xsl:element name="th">Course Name</xsl:element>
<xsl:element name="th">Semester</xsl:element>
<xsl:element name="th">Year</xsl:element>
<xsl:element name="th">Grade</xsl:element>
<xsl:element name="th">Credits</xsl:element>
<xsl:element name="th">Quality Points</xsl:element>
</xsl:element>
<xsl:for-each select="./course">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>

<xsl:template match="course">
<xsl:element name="tr">
<xsl:element name="td"><xsl:value-of
select="./coursenumber"/></xsl:element>
<xsl:element name="td"><xsl:value-of
select="./coursename"/></xsl:element>
<xsl:element name="td"><xsl:value-of
select="./semester"/></xsl:element>
<xsl:element name="td"><xsl:value-of
select="./year"/></xsl:element>
<xsl:element name="td"><xsl:value-of
select="./grade"/></xsl:element>
<xsl:element name="td"><xsl:value-of
select="./credits"/></xsl:element>
<xsl:element name="td"><xsl:value-of
select="./qualitypoints"/></xsl:element>
</xsl:element>
</xsl:template>

<xsl:template match="totals">
<xsl:element name="tr">
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
<xsl:element name="td">
<xsl:attribute
name="align"><xsl:text>right</xsl:text></xsl:attribute>
<xsl:element name="b"><xsl:text>TOTAL
CREDITS:</xsl:text></xsl:element>
</xsl:element>
<xsl:element name="td"><xsl:value-of
select="./credits"/></xsl:element>
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
</xsl:element>
<xsl:element name="tr">
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
<xsl:element name="td">
<xsl:attribute
name="align"><xsl:text>right</xsl:text></xsl:attribute>
<xsl:element name="b"><xsl:text>GPA:</xsl:text></xsl:element>
</xsl:element>
<xsl:element name="td"><xsl:value-of
select="./gradepointaverage"/></xsl:element>
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
</xsl:element>
<xsl:element name="tr">
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
<xsl:element name="td">
<xsl:attribute
name="align"><xsl:text>right</xsl:text></xsl:attribute>
<xsl:element name="b"><xsl:text>MAX
GPA:</xsl:text></xsl:element>
</xsl:element>
<xsl:element name="td">
<xsl:value-of select="./gradepointaverage/@maximum"/>
</xsl:element>
<xsl:element name="td"><xsl:text> </xsl:text></xsl:element>
</xsl:element>
</xsl:template>

<xsl:template match="notes">
<xsl:for-each select="./note">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>

<xsl:template match="note">
<xsl:element name="p">
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>

</xsl:stylesheet>

Does anyone see what might be causing the problem? Any help would be
greatly appreciated.

Thanks

Kevin
Jul 20 '05 #1
2 3367
nanookfan wrote:
Hi all,

I'm having a bizarre problem converting XML files to HTML using an
XSLT. The problem is only occuring in my Netscape 7.0 browser. What
makes it more bizarre is that it is only happening when I put my XML
files and the .xsl files on my ISP's system for my home page. If I
try to open the XML files in Netscape 7.0 on my own machine (ie, not
on the ISP's system), the pages convert file and the result is
displayed in HTML.

Under IE 6.0 there is no problem, both when the files are on the ISP's
system or on my own machine.


Perhaps your IPS's web server serves the files with a wrong content-type
header.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Jul 20 '05 #2


nanookfan wrote:

I'm having a bizarre problem converting XML files to HTML using an
XSLT. The problem is only occuring in my Netscape 7.0 browser. What
makes it more bizarre is that it is only happening when I put my XML
files and the .xsl files on my ISP's system for my home page. If I
try to open the XML files in Netscape 7.0 on my own machine (ie, not
on the ISP's system), the pages convert file and the result is
displayed in HTML.


Please post a URL next time and not all that code. As already suggested
the problem is usually the content type the web server sends, see
http://www.mozilla.org/projects/xslt/faq.html

--

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

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: H. Kaya | last post by:
Hallo, I have a problem converting a XML file to a other. I have no idea how I can do this. I try it for a long time but I can not find a solution. Has anyone a Idea? Below you can find my...
1
by: Pavel | last post by:
Greetings to all - I've noticed that my xsl transformation does not work in Netscape 7. It worked fine in Netscape 6.1, or if html file is generated using xalan (and it works in IE 5, not that...
3
by: Pavel | last post by:
Greetings to all, I need use different xsl stylesheet files with the same xml data. I haven't been able to make the following xml include working under NN7: ---cut---- <?xml version="1.0"...
4
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my...
13
by: Tjerk Wolterink | last post by:
Hello i've an xsl stylesheet that must support xhtml entities, my solution: ---- <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE xsl:stylesheet > <xsl:stylesheet version="1.0"...
20
by: Al Moritz | last post by:
Hi all, I was always told that the conversion of Word files to HTML as done by Word itself sucks - you get a lot of unnecessary code that can influence the design on web browsers other than...
2
by: jkflens | last post by:
Hello, i convert one XML-document by using XSLT into another XML-document. First change all attributes to elements is no problem. Then i try to insert a new element into the new document by...
0
by: micu.radu | last post by:
Hello, Here is my problem, I was trying to generate an html table from an xml file... the easy method is to to use span an data src but this only works in IE so to make it work in mozzila...
6
by: Dennis | last post by:
I am in the process of converting some program output from HTML to XML/XSLT. I have an XSL stylesheet that inserts some javascript in the output that gets called further down to pop up a window)....
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.