Re: XML_Atom?
| From: | Joe Stump | Date: | Mon, 01 Aug 2005 16:52:32 +0000 |
| Subject: | Re: XML_Atom? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-39094@lists.php.net to get a copy of this message | ||
1.) How am I supposed to make sure my feed can be parsed? :)
2.) I disagree. I plan on having an ambiguous entry class that you could hand off to the Writer's driver that would then handle building the Atom/RSS specific tags. So you'd do something like this:
$entry = new XML_Feed_Entry();
$entry->title = 'foo';
$entry->summary = 'This is a summary';
$entry->content = '<div><p> this is a paragraph </p></div>';
$writer = & XML_Feed_Writter::factory('Atom','0.3');
$writer->addEntry($entry);
$writer->output();
OR
$writer = & XML_Feed_Writer::factory('RSS','2.0');
$writer->addEntry($entry);
$writer->output();
What's great about this (IMO) is that you could easily do feed conversion if you needed or wanted to by combining the parser and the writer:
$feed = & XML_Feed::factory('RSS');
$feed->parse();
$writer = & XML_Feed_Writer::factory('Atom','1.0');
foreach ($feed->entries as $entry) {
$writer->addEntry($entry);} $writer->output(); So, an abstracted entry class (which the reader would output to and the writer would take as an argument) makes a ton of sense IMO. I've also created similar classes for Encapsulations and generic Feed/Channel Info. --Joe On Jul 31, 2005, at 11:05 PM, Koistya `Navin wrote:
Joe, The main reason why these packages should be separated is because most of the users which use XML_Feed_Writer doesn't need a parser. The second reason is that there won't be any common logic in these packages. Sincerely, Koistya `Navin http://navin.biz-----Original Message----- From: Joe Stump [mailto:joe@joestump.net] Sent: Monday, August 01, 2005 8:32 AM To: Koistya `Navin Cc: pear-dev@lists.php.net Subject: Re: [PEAR-DEV] XML_Atom? No, I think everything should be XML_Feed - it should be an all encompassing package for reading and writing feeds, which is why I sent my email about XML_Feed_Writer. We should combine forces to create XML_Feed IMO. I'll be contacting those who proposed XML_Feed_Writer and talk to them about combining forces. As a side note, our efforts will most likely deprecate XML_RSS. I've found that parser doesn't support enclosures, among other features I want to include in XML_Feed. At any rate, I want to make it clear I'd like to work WITH XML_Feed_Writer's devs and create a great feed reading/writing package for PEAR. If you are an XML_Feed_Writer dev please email me offlist and we'll hook up and compare notes.