| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Reviewed: no -->
- <!-- EN-Revision: 15854 -->
- <sect1 id="zend.feed.consuming-atom-single-entry">
- <title>単一の Atom エントリの処理</title>
- <para>
- Atom の個々の <code><entry></code> 要素は、それ単体でも有効です。通常、
- エントリの URL はフィードの URL に <code>/<エントリId></code>
- を続けたものになります。先に使用した例の場合は、
- <code>http://atom.example.com/feed/1</code> となります。
- </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>
- <code><entry></code> のみのドキュメントにアクセスすることがわかっている場合は、
- エントリオブジェクトを直接作成することもできます。
- </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:
- -->
|