| 2:58 am on Jul 14, 2004 (gmt 0)|
| 10:34 am on Jul 14, 2004 (gmt 0)|
I've been lurking hoping someone else would suggest a clear answer.
The best I could think was to use PHP5 but it's only just been released. The little I understand suggests this can pull xml + xslt and send the output to the user.
I'd look to write a simple XSLT stylesheet for the RSS and use PHP to do the work but this is not something I've tried before and may be dependant on your getting PHP5.. I've no idea whether PHP4 has XML handling.
Good luck.. I'd be interested to know of other approaches to this.
| 11:03 am on Jul 14, 2004 (gmt 0)|
Blimey, I actually assumed I was asking one of those daft simple questions everyone knew the answer to, except me.
Is it really so complicated?
| 11:20 am on Jul 14, 2004 (gmt 0)|
Cold Fusion should do it... lacking that, poke around on the web for a perl script. Should be some out there that do the trick.
| 11:37 am on Jul 14, 2004 (gmt 0)|
Introduction to Perl's XML::XSLT module [linuxfocus.org] appears to suggest a simple perl script.
my $xmlfile = "example.xml";
my $xslfile = "example.xsl";
my $parser = XML::XSLT->new ($xslfile, "FILE");
$parser->transform_document ($xmlfile, "FILE");
Maybe that's all you need?
for a stylesheet you might use something like..
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<p><xsl:value-of select="description" disable-output-escaping="yes" /></p>
| 12:13 pm on Jul 14, 2004 (gmt 0)|
| 2:20 am on Jul 16, 2004 (gmt 0)|
Smashing! That's a start; clear as mud: but a start.
The perl script goes in the cgi-bin, where does the style sheet go?
And what code do I use on an html page to draw and embed the feed data?
| 8:31 am on Jul 16, 2004 (gmt 0)|
The stylesheet is essentially a template to generate the HTML.
It goes wherever you want it and it's location is suggested by the my $xslfile = "example.xsl"; in the perl. So long as you get the relative location correct it should work.
The xml that the XSL stylesheet/transform works on is your RSS file.
If it does what we expect, the perl should call the XSL to transform the RSS file into HTML. ie. put your rss file location into my $xmlfile = "example.xml";
The transform I suggested is very simple but you can add other html elements to it. The XSL simply copies the HTML to output as it looks for "xsl:" elements.
<xsl:template match="item"> looks for all occurences of elements called 'item'
<xsl:template match="text()¦@*"> gives you control of the output by simply overwriting the default templates for text and attribute nodes. Otherwise you would get simple dump of the contents of nodes.
The only thing that might complicate this is if you are trying to add other <? scripting?> languages as the XSLT processor will try to understand the contents.. but then I believe there may be ways round that too.
Obviously you need to have the perl XML::XSLT module avaliable.
Hope that helps.
You can find more of an introduction to XML, XSL and others at w3schools [w3schools.com]
[edited by: davidpbrown at 9:10 am (utc) on July 16, 2004]
| 8:43 am on Jul 16, 2004 (gmt 0)|
I'm looking at the $parser->print_result(); wondering if perl can insert into an html page. If it can then you might be able to "to draw and embed the feed data".
| 6:25 am on Jul 18, 2004 (gmt 0)|
For those who like (and use) php this requirement is fulfilled by a free script called MagpieRSS.
But my homepage is plain html, so I'm still scratchin' mi' bonce.
David, since you know more than I, why not try making a simple test rig to see if it works?
ie. Install the script and stylesheet, make a simple feed.xml file, and see if it displays in a .htm file on your site.
| 6:27 am on Jul 18, 2004 (gmt 0)|
You can set your site to run PHP on .htm pages using the .htaccess file.
| 6:41 am on Jul 18, 2004 (gmt 0)|
Care to offer the full .htaccess code to allow php to run on a single .htm page called: