Stretchwickster
Programmer
When I open the following xml file in Internet Explorer 6 everything is formatted neatly into a table as desired. However, when I view the same xml file in Firefox the header_record and table all appear on one line appropriately coloured by the style set at the top of the stylesheet. Does anyone know the reason for this?
Here is my source code:
example.xsl
example.xml
Clive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
Here is my source code:
example.xsl
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL] xmlns:fo="[URL unfurl="true"]http://www.w3.org/1999/XSL/Format">[/URL]
<xsl:template match="/">
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<style type="text/css">
h2
{
background-color: #000000;
color: #FFFFCC;
text-align: center;
}
h3
{
background: #FFFFCC;
text-align: center;
}
h4
{
background: #FFCC99;
text-align: center;
}
table
{
border-color: #000000 #000000 #000000 #000000;
border-spacing: 2;
border-width: 2;
padding: 2;
}
td.heading
{
background: #0000CC;
color: #FFFFFF;
font-weight: bold;
}
td.total
{
font-weight: bold;
}
td
{
background: #CCCCFF;
}
</style>
<title>Network Data File</title>
</head>
<body>
<h2>Network Data File</h2>
<xsl:apply-templates select="network_data_file/header_record"/>
</body>
</html>
</xsl:template>
<xsl:template match="header_record">
<h3>Header Record</h3>
<table border="1">
<tr>
<td class="heading"> Network Name </td>
<td class="heading"> State Name </td>
</tr>
<tr>
<td><xsl:value-of select="netName"/></td>
<td><xsl:value-of select="stateName"/></td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="example.xsl" ?>
<network_data_file xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xsi:noNamespaceSchemaLocation="network_data_file.xsd">
<header_record>
<netName>Example</netName>
<stateName>On</stateName>
</header_record>
</network_data_file>
Clive

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096