Zend_Feed-ConsumingAtomSingle.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 24249 -->
  4. <sect1 id="zend.feed.consuming-atom-single-entry">
  5. <title>単一の Atom エントリの処理</title>
  6. <para>
  7. Atom の個々の <command>&lt;entry&gt;</command> 要素は、それ単体でも有効です。通常、
  8. エントリの <acronym>URL</acronym> はフィードの <acronym>URL</acronym> に <command>/&lt;エントリId&gt;</command>
  9. を続けたものになります。先に使用した例の場合は、
  10. <filename>http://atom.example.com/feed/1</filename> となります。
  11. </para>
  12. <para>
  13. 単一のエントリを読み込む場合にも <classname>Zend_Feed_Atom</classname>
  14. オブジェクトを使用しますが、この場合は「無名 (anonymous)」
  15. フィードが自動的に作成され、エントリがその中に含まれる形式になります。
  16. </para>
  17. <example id="zend.feed.consuming-atom-single-entry.example.atom">
  18. <title>Atom フィードからの単一のエントリの読み込み</title>
  19. <programlisting language="php"><![CDATA[
  20. $feed = new Zend_Feed_Atom('http://atom.example.com/feed/1');
  21. echo 'このフィードには ' . $feed->count() . ' 件のエントリが含まれます。';
  22. $entry = $feed->current();
  23. ]]></programlisting>
  24. </example>
  25. <para>
  26. <command>&lt;entry&gt;</command> のみのドキュメントにアクセスすることがわかっている場合は、
  27. エントリオブジェクトを直接作成することもできます。
  28. </para>
  29. <example id="zend.feed.consuming-atom-single-entry.example.entryatom">
  30. <title>単一エントリの Atom フィードに対する、エントリオブジェクトを直接使用したアクセス</title>
  31. <programlisting language="php"><![CDATA[
  32. $entry = new Zend_Feed_Entry_Atom('http://atom.example.com/feed/1');
  33. echo $entry->title();
  34. ]]></programlisting>
  35. </example>
  36. </sect1>
  37. <!--
  38. vim:se ts=4 sw=4 et:
  39. -->