Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Converting RSS file to HTMLby Vautrin (Hermit) |
on Mar 27, 2004 at 16:54 UTC ( [id://340279]=note: print w/replies, xml ) | Need Help?? |
RSS feeds are a form of XML. If you are unfamiliar with XML, you should read up on it. You may be able to use XSLT or XML Schema to automatically do what you want to do for you. And, you should use some kind of XML parser. Also, check out XML::Simple. You can use it to load the XML File into a combination of arrays and hashes. Then you could print out your HTML like so:
Multiple XML tags which are the same will be in an array. So if you have more than one items you can do this, but be careful though. XML::Simple is supposed to be simple and easy to use, and thus doesn't do any kind of validation, and doesn't necessarily preserve the order of the XML. Go to CPAN and get a copy of another XML parser if you want to do something more complex. Oh, and never roll your own parser unless it's for educational purposes. It's not a good idea as there are plenty of parsers out there which include more work and effort then you would probably want to, and thus work much better. Want to support the EFF and FSF by buying cool stuff? Click here.
In Section
Seekers of Perl Wisdom
|
|