| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Reviewed: no -->
- <!-- EN-Revision: 24249 -->
- <sect1 id="zend.feed.consuming-atom-single-entry">
- <title>単一の Atom エントリの処理</title>
- <para>
- Atom の個々の <command><entry></command> 要素は、それ単体でも有効です。通常、
- エントリの <acronym>URL</acronym> はフィードの <acronym>URL</acronym> に <command>/<エントリId></command>
- を続けたものになります。先に使用した例の場合は、
- <filename>http://atom.example.com/feed/1</filename> となります。
- </para>
- <para>
- 単一のエントリを読み込む場合にも <classname>Zend_Feed_Atom</classname>
- オブジェクトを使用しますが、この場合は「無名 (anonymous)」
- フィードが自動的に作成され、エントリがその中に含まれる形式になります。
- </para>
- <example id="zend.feed.consuming-atom-single-entry.example.atom">
- <title>Atom フィードからの単一のエントリの読み込み</title>
- <programlisting language="php"><![CDATA[
- $feed = new Zend_Feed_Atom('http://atom.example.com/feed/1');
- echo 'このフィードには ' . $feed->count() . ' 件のエントリが含まれます。';
- $entry = $feed->current();
- ]]></programlisting>
- </example>
- <para>
- <command><entry></command> のみのドキュメントにアクセスすることがわかっている場合は、
- エントリオブジェクトを直接作成することもできます。
- </para>
- <example id="zend.feed.consuming-atom-single-entry.example.entryatom">
- <title>単一エントリの Atom フィードに対する、エントリオブジェクトを直接使用したアクセス</title>
- <programlisting language="php"><![CDATA[
- $entry = new Zend_Feed_Entry_Atom('http://atom.example.com/feed/1');
- echo $entry->title();
- ]]></programlisting>
- </example>
- </sect1>
- <!--
- vim:se ts=4 sw=4 et:
- -->
|