...

View Full Version : XML document is ignoring stylesheet



Sanford Stein
03-20-2009, 06:49 PM
I am brand new to XML, writing my first RSS feed, and trying to use an XSL stylesheet for the first time.

My code is working and I can see the feeds, but the output must be in some sort of default format that I did not dictate. I have a stylesheet command in the code, but I believe that it is being ignored. I have tried to swap in different stylesheets and CSS files, made changes to my stylesheet such as huge font sizes, and nothing changes. Also I get completely different output with Firefox than I do with IE, so I have a feeling that the browser is calling the shots.

My stylesheet command is as simple as can be:
<?xml-stylesheet type="text/xsl" href="http:{IP}/cyberj/feeder.xsl" ?>

(Yes, I have the actual IP address in the string, don't want to show it here.)

The feeder.xsl file is directly from the companion CD to the book "Teach Yourself XML" by Michael Morrison. And if this file were syntactically incorrect, I would get some sort of error message, correct? So I think it is
never accessed.

Below are the beginnings of my .xml file and my .xsl file. The .xml file has been validated by feedvalidator.org Any help is appreciated.



<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/cyberj/feeder.xsl" ?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>New Arrivals for Baptist Health South Florida Medical Library</title>
<description>The last 30 items added to your catalog</description>
<link>http://cybertools.biz/cyberj/recarr2.xml</link>
<atom:link href="http://dallas.example.com/rss.xml" rel="self" type="application/rss+xml" />
<item>
<title>First item title</title>
<dc:creator>First author</dc:creator>
<description>First description</description>
<link>http://myserver.com/cgi-bin/CyberHTML?BHSFLINK+MARC=3668</link>
<pubDate>12 Feb 2009 14:52:05 EST</pubDate>
</item>

.....

--------------------------------------------------------------------

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

.....



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum