cvs: peardoc /peardoc2/en/package/xml/xml-rss example.xml intro.xml

From: Date: Sat, 08 Mar 2003 14:43:30 +0000
Subject: cvs: peardoc /peardoc2/en/package/xml/xml-rss example.xml intro.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-416@lists.php.net to get a copy of this message
mj Sat Mar 8 09:43:30 2003 EDT Modified files: /peardoc/peardoc2/en/package/xml/xml-rss intro.xml example.xml Log: * Add intro and example for XML_RSS. Index: peardoc/peardoc2/en/package/xml/xml-rss/intro.xml diff -u peardoc/peardoc2/en/package/xml/xml-rss/intro.xml:1.1 peardoc/peardoc2/en/package/xml/xml-rss/intro.xml:1.2 --- peardoc/peardoc2/en/package/xml/xml-rss/intro.xml:1.1 Thu Jan 2 16:40:10 2003 +++ peardoc/peardoc2/en/package/xml/xml-rss/intro.xml Sat Mar 8 09:43:30 2003 @@ -1,16 +1,68 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.xml.xml-rss.intro"> <refnamediv> <refname>Introduction</refname> - <refpurpose>What contains the intro?</refpurpose> + <refpurpose>Introduction to XML_RSS</refpurpose> </refnamediv> - <!-- please replace the "refsect1" id part with a - text related to the refsect1 title --> <refsect1 id="package.xml.xml-rss.intro.refsect1"> - <title></title> - - <para> + <title>Introduction to XML_RSS</title> + + <para> + Resource Description Framework (RDF) Site Summary (RSS) documents + are XML documents, that provide a lightweight multipurpose + extensible metadata description and syndication format. RSS files + are often used to syndicate news or headlines from portal sites + (e.g. Slashdot or freshmeat.net) or weblogs. + </para> + + <para> + For more information on RSS see the website of the RSS working + group (<ulink url="http://www.purl.org/rss/">http://www.purl.org/rss/</ulink>). </para> + + <example id="packages.xml.xml-rss.intro.example_rss"> + <title>RSS file</title> + + <programlisting role="xml"> + <![CDATA[ +<?xml version="1.0"?> + +<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns="http://my.netscape.com/rdf/simple/0.9/"> + +<channel> + <title>FooBar Inc.</title> + <link>http://example.com/</link> + <description>abcd, xyz, 123</description> +</channel> + +<image> + <title>FooBar</title> + <url>http://example.com/images/rssicon.gif</url> + <link>http://example.com/</link> +</image> + +<item> + <title>Headline 1</title> + <link>http://example.com/news.php?h=1</link> +</item> + +<item> + <title>Headline 2</title> + <link>http://example.com/news.php?h=2</link> +</item> + +<textinput> + <title>Search FooBar Inc.</title> + <description>Search FooBar Inc. headlines</description> + <name>q</name> + <link>http://example.com/search.php</link> +</textinput> + +</rdf:RDF> + ]]> + </programlisting> + </example> </refsect1> </refentry> Index: peardoc/peardoc2/en/package/xml/xml-rss/example.xml diff -u peardoc/peardoc2/en/package/xml/xml-rss/example.xml:1.1 peardoc/peardoc2/en/package/xml/xml-rss/example.xml:1.2 --- peardoc/peardoc2/en/package/xml/xml-rss/example.xml:1.1 Thu Jan 2 16:40:10 2003 +++ peardoc/peardoc2/en/package/xml/xml-rss/example.xml Sat Mar 8 09:43:30 2003 @@ -1,24 +1,39 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.xml.xml-rss.example"> - <refnamediv> - <refname>Example(s)</refname> - <refpurpose>What for (an) Example(s)?</refpurpose> - </refnamediv> - - <refsect1 id="package.xml.xml-rss.example.example1"> - <title></title> - <para> - Example description - </para> - <!-- the cdata section will formated "as is - take care for tabulators --> - <programlisting role="php"> -<![CDATA[ -]]> - </programlisting> - </refsect1> + <refnamediv> + <refname>Example</refname> + <refpurpose>Example for the usage of XML_RSS</refpurpose> + </refnamediv> - </refentry> + <refsect1 id="package.xml.xml-rss.example.example1"> + <title>Usage example</title> + <simpara> + The following script fetches the latest headlines from + Slashdot.org via RSS. + </simpara> + <example> + <title>Fetching headlines from Slashdot</title> + <programlisting role="php"> + <![CDATA[ +require_once "XML/RSS.php"; + +$rss =& new XML_RSS("http://slashdot.org/slashdot.rdf"); +$rss->parse(); + +echo "<h1>Headlines from <a href=\"http://slashdot.org\">Slashdot</a></h1>\n"; +echo "<ul>\n"; + +foreach ($rss->getItems() as $item) { + echo "<li><a href=\"" . $item['link'] . "\">" . $item['title'] . "</a></li>\n"; +} + +echo "</ul>\n"; + ]]> + </programlisting> + </example> + </refsect1> + +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml

« previous php.pear.doc (#416) next »