XML Embedding and XSL Issue. Help Please

admin

Administrator
Staff member
Hello Everyone,

I am having some issues that I wasn't expecting while I was embedding an XML to an HTML page. What seemed to be an easy task gave me a headache. I am trying to view the content of an XML file in a browser, because I don't want to use a database to show 3 fields that can be easily updated through XML. The XML file looks fine when I look at it. But when I try to view it through an HTML page I see nothing! The code of the HTML page that I using is the following:

<html>
<head>
<title>Recent Calls</title>
</head>
<body>
<xml id="recentcalls" src=http://www.webdeveloper.com/forum/archive/index.php/"recentcalls.xml"></xml>
<table height="100%" width="100%" border="1" datasrc="#recentcalls">
<tr>
<td><span datafld="identifier"></span></td>
<td><span datafld="description"></span></td>
<td><span datafld="link"></span></td>
</tr>
</table>
</body>
</html>

The XML file I am using is the following:

<xml id="recentcalls">
<xml-stylesheet type="text/xsl" href="recentcalls.xsl">

<recentcalls>
<calls>
<identifier>1</identifier>
<description>
February 19th, 2005 at 19:30
There did not appear to be any heavy damage to the home, but the owner's Dalmatian "Domino" seemed to really enjoy the company, especially all the fire apparatus. As in all South Whitehall fire calls, one of our most useful new tools are thermal imaging cameras which use new technologies to help locate lost and or trapped individuals ( or any warm blooded animal for that fact). These cameras are also useful in determining the extent of any hidden fire or to confirm that a fire is indeed completely out.
</description>
<link>http://www.google.com</link>
</calls>

<calls>
<identifier>2</identifier>
<description>
South Whitehall Twp., Lehigh County, PA Fire/Rescue units were dispatched to a reported MVA with Rescue, Tuesday July 26, 2005 at 1729.
Two cars had collided in the West bound lane of US Route 22 1/4 mile East of the Cedar Crest Blvd. exit.
The occupants of the rollover vehicle were quickly removed by rescue personnel and transported by Cetronia Ambulance Corps, units to nearby hospitals.
All units were cleared from the scene by 1810 by Incident Commander Rusty Held, Chief, Woodlawn FD
</description>
<link>http://www.google.com</link>
</calls>
</recentcalls>
</xml-stylesheet>
</xml>

I tried to create a style sheet to view the file but it doen't work either. The code of the style sheet is the following:

<?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>Recent Calls</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Identifier</th>
<th>Description</th>
<th>Link</th>
</tr>
<xsl:for-each select="recentcalls/calls">
<tr>
<td><xsl:value-of select="identifier"/></td>
<td><xsl:value-of select="description"/></td>
<td><xsl:value-of select="link"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template></xsl:stylesheet>

I would deeply appreciate any help you can provide me.

Thanks a lot!

Apocalipsis1982
 
Back
Top