Gregorius
11-28-2008, 06:19 PM
I'm quite new to web programming, since my only experience with it beyond basic HTML is this class I'm currently taking that's basically a survey of the key markup and scripting languages (HTML, CSS, JavaScript, and XML/XSL). I'm working on an assignment, and I've gotten much of the functionality in place. I have an ASP page that goes through an Access database and generates an XML page that structures the data into a tree. I've also written an XSL stylesheet which is itself supplemented by a linked CSS.
The only problem I'm having is that both of my browsers are refusing to recognize the existence of the style information. IE merely regurgitates the tree in raw code form, and Firefox gives a "This XML file does not appear to have any style information attached to it" warning before it too just regurgitates the code generated by the ASP. After comparing the professor's samples with my own work and correcting several possible bugs, the problem persists. Based on this code, can anyone give me any ideas as to what may be causing it?
Generated XML File:
<?xml version="1.0" encoding="iso-8859-1" ?>
<?xsl-stylesheet type="text/xsl" href="memstyle.xsl" ?>
<listing>
<memrec>
<fname>Marco</fname>
<lname>Cesaroni</lname>
<user>Marco</user>
<gender>Male</gender>
<email>marediguai@hotmail.it</email>
<role>Student</role>
</memrec>
<memrec>
<fname>Julia</fname>
<lname>Cesar</lname>
<user>Julia</user>
<gender>Female</gender>
<email>julia@hotmail.es</email>
<role>Instructor</role>
</memrec>
</listing>
XSL File:
<?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="/listing">
<html>
<head>
<title>Latinitas Hodierna</title>
<link rel="stylesheet" type="text/css" href="memstyle.css" />
</head>
<body>
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
<th>Gender</th>
<th>E-Mail</th>
<th>Role</th>
</tr>
<xsl:for-each select="memrec">
<tr>
<td><xsl:value-of select="fname"/></td>
<td><xsl:value-of select="lname"/></td>
<td><xsl:value-of select="user"/></td>
<td><xsl:value-of select="gender"/></td>
<td><xsl:value-of select="email"/></td>
<td><xsl:value-of select="role"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Referenced CSS File:
.blank {font-family:Times, Times New Roman, serif}
body {background-color:white}
.fname {
font-family: Times, Times New Roman, serif;
font-size: 12pt;
color: #780000;
font-weight: bold;
background-color: #FFFFFF
}
.lname {
font-family: Times, Times New Roman, serif;
font-size: 12pt;
color: #780000;
font-weight: bold;
background-color: #FFFFFF
}
.user {
font-family: Times, Times New Roman, serif;
font-size: 12pt;
color: #780000;
font-weight: bold;
background-color: #FFFFFF
}
.gender {
font-family: Times, Times New Roman, serif;
font-size: 12pt;
color: #780000;
font-weight: bold;
background-color: #FFFFFF
}
.email {
font-family: Times, Times New Roman, serif;
font-size: 12pt;
color: #780000;
font-weight: bold;
background-color: #FFFFFF
}
.role {
font-family: Times, Times New Roman, serif;
font-size: 12pt;
color: #780000;
font-weight: bold;
background-color: #FFFFFF
}
table {
border: outset 3pt;
border-color: #780000;
border-collapse: collapse;
border-spacing: 0px;
background-color: #FFFF00;
color: #000000;
font-family: Times, Times New Roman, serif;
font-size: 14pt;
margin: auto;
text-align: center
}
th {
border: solid 1pt;
border-color: #000000;
background-color: #000087;
color: #FFFF00;
padding: 5px
}
td {
border: solid 1pt;
border-color: #000000;
border-collapse: collapse;
padding: 5px
}
Thanks in advance!
The only problem I'm having is that both of my browsers are refusing to recognize the existence of the style information. IE merely regurgitates the tree in raw code form, and Firefox gives a "This XML file does not appear to have any style information attached to it" warning before it too just regurgitates the code generated by the ASP. After comparing the professor's samples with my own work and correcting several possible bugs, the problem persists. Based on this code, can anyone give me any ideas as to what may be causing it?
Generated XML File:
<?xml version="1.0" encoding="iso-8859-1" ?>
<?xsl-stylesheet type="text/xsl" href="memstyle.xsl" ?>
<listing>
<memrec>
<fname>Marco</fname>
<lname>Cesaroni</lname>
<user>Marco</user>
<gender>Male</gender>
<email>marediguai@hotmail.it</email>
<role>Student</role>
</memrec>
<memrec>
<fname>Julia</fname>
<lname>Cesar</lname>
<user>Julia</user>
<gender>Female</gender>
<email>julia@hotmail.es</email>
<role>Instructor</role>
</memrec>
</listing>
XSL File:
<?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="/listing">
<html>
<head>
<title>Latinitas Hodierna</title>
<link rel="stylesheet" type="text/css" href="memstyle.css" />
</head>
<body>
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
<th>Gender</th>
<th>E-Mail</th>
<th>Role</th>
</tr>
<xsl:for-each select="memrec">
<tr>
<td><xsl:value-of select="fname"/></td>
<td><xsl:value-of select="lname"/></td>
<td><xsl:value-of select="user"/></td>
<td><xsl:value-of select="gender"/></td>
<td><xsl:value-of select="email"/></td>
<td><xsl:value-of select="role"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Referenced CSS File:
.blank {font-family:Times, Times New Roman, serif}
body {background-color:white}
.fname {
font-family: Times, Times New Roman, serif;
font-size: 12pt;
color: #780000;
font-weight: bold;
background-color: #FFFFFF
}
.lname {
font-family: Times, Times New Roman, serif;
font-size: 12pt;
color: #780000;
font-weight: bold;
background-color: #FFFFFF
}
.user {
font-family: Times, Times New Roman, serif;
font-size: 12pt;
color: #780000;
font-weight: bold;
background-color: #FFFFFF
}
.gender {
font-family: Times, Times New Roman, serif;
font-size: 12pt;
color: #780000;
font-weight: bold;
background-color: #FFFFFF
}
.email {
font-family: Times, Times New Roman, serif;
font-size: 12pt;
color: #780000;
font-weight: bold;
background-color: #FFFFFF
}
.role {
font-family: Times, Times New Roman, serif;
font-size: 12pt;
color: #780000;
font-weight: bold;
background-color: #FFFFFF
}
table {
border: outset 3pt;
border-color: #780000;
border-collapse: collapse;
border-spacing: 0px;
background-color: #FFFF00;
color: #000000;
font-family: Times, Times New Roman, serif;
font-size: 14pt;
margin: auto;
text-align: center
}
th {
border: solid 1pt;
border-color: #000000;
background-color: #000087;
color: #FFFF00;
padding: 5px
}
td {
border: solid 1pt;
border-color: #000000;
border-collapse: collapse;
padding: 5px
}
Thanks in advance!