473,598 Members | 3,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="transcrip t.xsl"?>
<transcript>
<school>
<name>Universit y of Massachusetts - Lowell</name>
<city>Lowell</city>
<state abbreviation="M A">Massachusett s</state>
<websiteurl>htt p://www.uml.edu/dce</websiteurl>
<degree_program >None - Continuing Education Courses
only</degree_program>
</school>
<courses>
<course>
<coursenumber>9 2.268</coursenumber>
<coursename>C ++ Programming</coursename>
<semester>Sprin g</semester>
<year>1993</year>
<grade>A/B</grade>
<credits>3.0</credits>
<qualitypoints> 3.5</qualitypoints>
</course>
<course>
<coursenumber>9 2.270</coursenumber>
<coursename>Vis ual C++ Programming</coursename>
<semester>Sprin g</semester>
<year>1998</year>
<grade>A</grade>
<credits>3.0</credits>
<qualitypoints> 4.0</qualitypoints>
</course>
<course>
<coursenumber>9 0.301</coursenumber>
<coursename>Jav a Programming</coursename>
<semester>Sprin g</semester>
<year>1999</year>
<grade>A</grade>
<credits>3.0</credits>
<qualitypoints> 4.0</qualitypoints>
</course>
<course>
<coursenumber>9 1.373</coursenumber>
<coursename>Dyn amic HTML</coursename>
<semester>Sprin g</semester>
<year>1999</year>
<grade>A/B</grade>
<credits>3.0</credits>
<qualitypoints> 3.5</qualitypoints>
</course>
<course>
<coursenumber>9 2.269</coursenumber>
<coursename>Adv anced C++ Programming</coursename>
<semester>Summe r</semester>
<year>1999</year>
<grade>A</grade>
<credits>3.0</credits>
<qualitypoints> 4.0</qualitypoints>
</course>
<course>
<coursenumber>9 0.303</coursenumber>
<coursename>Adv anced Java</coursename>
<semester>Summe r</semester>
<year>2001</year>
<grade>A</grade>
<credits>3.0</credits>
<qualitypoints> 4.0</qualitypoints>
</course>
<course>
<coursenumber>9 0.307</coursenumber>
<coursename>Adv anced Topics in Java and XML</coursename>
<semester>Summe r</semester>
<year>2002</year>
<grade>A</grade>
<credits>3.0</credits>
<qualitypoints> 4.0</qualitypoints>
</course>
</courses>
<totals>
<gradepointaver age maximum="4.0">3 .857</gradepointavera ge>
<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:styleshe et 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="transcr ipt/school"/>
<xsl:element name="table">
<xsl:attribut e
name="width"><x sl:text>100%</xsl:text></xsl:attribute>
<xsl:apply-templates select="transcr ipt/courses"/>
<xsl:apply-templates select="transcr ipt/totals"/>
</xsl:element>
<xsl:apply-templates select="transcr ipt/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:attribut e
name="align"><x sl:text>center</xsl:text></xsl:attribute>
<xsl:element name="a">
<xsl:attribut e name="href"><xs l:value-of
select="./websiteurl"/></xsl:attribute>
<xsl:value-of select="./name"/>
</xsl:element>
</xsl:element>
<xsl:element name="h3">
<xsl:attribut e
name="align"><x sl:text>center</xsl:text></xsl:attribute>
<xsl:value-of select="./city"/><xsl:text>,
</xsl:text><xsl:v alue-of select="./state/@abbreviation"/>
<xsl:element name="br"/>
</xsl:element>
<xsl:element name="h4">
<xsl:attribut e
name="align"><x sl:text>center</xsl:text></xsl:attribute>
<xsl:element name="u"><xsl:t ext>DEGREE
PROGRAM:</xsl:text></xsl:element>
<xsl:text> </xsl:text><xsl:v alue-of
select="./degree_program"/>
</xsl:element>
</xsl:template>

<xsl:template match="courses" >
<xsl:element name="tr">
<xsl:element name="th">Cours e Number</xsl:element>
<xsl:element name="th">Cours e Name</xsl:element>
<xsl:element name="th">Semes ter</xsl:element>
<xsl:element name="th">Year</xsl:element>
<xsl:element name="th">Grade </xsl:element>
<xsl:element name="th">Credi ts</xsl:element>
<xsl:element name="th">Quali ty 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:attribut e
name="align"><x sl:text>right</xsl:text></xsl:attribute>
<xsl:element name="b"><xsl:t ext>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:attribut e
name="align"><x sl:text>right</xsl:text></xsl:attribute>
<xsl:element name="b"><xsl:t ext>GPA:</xsl:text></xsl:element>
</xsl:element>
<xsl:element name="td"><xsl: value-of
select="./gradepointavera ge"/></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:attribut e
name="align"><x sl:text>right</xsl:text></xsl:attribute>
<xsl:element name="b"><xsl:t ext>MAX
GPA:</xsl:text></xsl:element>
</xsl:element>
<xsl:element name="td">
<xsl:value-of select="./gradepointavera ge/@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 3396
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
2190
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 Input XML Document, Output XML Document and my scratch XSLT file. At the end is my request Output XML. Greetings H. Kaya
1
1410
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 it's important :-) If I load my xml file in Netscape 7 it goes into the load loop and never comes out of it. I've been able to localize the problem. It's related to the document.write() JS call inside the template. If I would comment out the JS...
3
1370
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" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="contacts.xsl"?> <!DOCTYPE companies >
4
7856
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 "languages" files and these are describes for things on my website. Example text looks like this:
13
3656
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" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
20
7336
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 Internet Explorer. Our computer expert in my company had told me already a while ago that I should learn HTML and encode myself. I was never inclined to do so (I am no computer expert), and when upon his suggestion I looked how my pages (converted to...
2
2357
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 XSLT, but it doesn't work correctly :-( Example:
0
1404
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 browsers I have made a different load for each and used XSL for generatig the table: XSL File <?xml version="1.0" encoding="ISO-8859-1"?>
6
1935
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). It works fine in IE6 but not in Firefox/Netscape. See... http://kowallekfamily.com/genealogy/reports/desc-3817.xml It is the Note link (just to the right of Henry Bales) which is supposed to pop up a window. In Firefox this link even looks...
0
7991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7902
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8395
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8265
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5850
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5438
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3898
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
1250
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.