1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect1 id="zend.feed.consuming-atom-single-entry">
4 <title>Consuming a Single Atom Entry</title>
7 Single Atom <command><entry></command> elements are also valid by themselves. Usually
8 the <acronym>URL</acronym> for an entry is the feed's <acronym>URL</acronym> followed by
9 <command>/<entryId></command>, such as
10 <filename>http://atom.example.com/feed/1</filename>, using the example
11 <acronym>URL</acronym> we used above.
15 If you read a single entry, you will still have a <classname>Zend_Feed_Atom</classname>
16 object, but it will automatically create an "anonymous" feed to contain the entry.
19 <example id="zend.feed.consuming-atom-single-entry.example.atom">
20 <title>Reading a Single-Entry Atom Feed</title>
22 <programlisting language="php"><![CDATA[
23 $feed = new Zend_Feed_Atom('http://atom.example.com/feed/1');
24 echo 'The feed has: ' . $feed->count() . ' entry.';
26 $entry = $feed->current();
31 Alternatively, you could instantiate the entry object directly if you know you are accessing
32 an <command><entry></command>-only document:
35 <example id="zend.feed.consuming-atom-single-entry.example.entryatom">
36 <title>Using the Entry Object Directly for a Single-Entry Atom Feed</title>
38 <programlisting language="php"><![CDATA[
39 $entry = new Zend_Feed_Entry_Atom('http://atom.example.com/feed/1');