cvs: peardoc /en/package/xml/xml-feed-parser extensions.xml intro.xml
| From: | Daniel Convissor | Date: | Sun, 15 Jan 2006 19:50:05 +0000 |
| Subject: | cvs: peardoc /en/package/xml/xml-feed-parser extensions.xml intro.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-7445@lists.php.net to get a copy of this message | ||
danielc Sun Jan 15 19:50:05 2006 UTC
Modified files:
/peardoc/en/package/xml/xml-feed-parser extensions.xml intro.xml
Log:
Fix the build:
* intro id was used in extension file.
* Put code samples in CDATA.
* Clean up nesting and white space.
# jystewart, please read the manual on how to write documentation
and make sure you have your docs tested.
http://cvs.php.net/viewcvs.cgi/peardoc/en/package/xml/xml-feed-parser/extensions.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/xml/xml-feed-parser/extensions.xml diff -u peardoc/en/package/xml/xml-feed-parser/extensions.xml:1.2 peardoc/en/package/xml/xml-feed-parser/extensions.xml:1.3 --- peardoc/en/package/xml/xml-feed-parser/extensions.xml:1.2 Sun Jan 8 17:53:54 2006 +++ peardoc/en/package/xml/xml-feed-parser/extensions.xml Sun Jan 15 19:50:05 2006 @@ -1,33 +1,41 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.xml.xml-feed-parser.extensions"> <refnamediv> <refname>XML_Feed_Parser and Extensions</refname> <refpurpose>Handling extensions with XML_Feed_Parser</refpurpose> </refnamediv> - <refsect1 id="package.xml.xml-feed-parser.intro.desc"> + + <refsect1 id="package.xml.xml-feed-parser.extensions.desc"> &title.desc; - <para>Using XML namespaces, the various syndication formats are very - easy to extend and the number of extensions in use is enormous.</para> + <para> + Using XML namespaces, the various syndication formats are very + easy to extend and the number of extensions in use is enormous. + </para> - <para>XML_Feed_Parser focusses on core functionality shared between the - various syndication formats. Some of the most common extensions are - handled natively—particularly when they provide one format with - features to bring it into line with others, such as the content - extension for RSS2—but the majority provide specialist content and - providing support for them would quickly result in a bloated package. + <para> + XML_Feed_Parser focusses on core functionality shared between the + various syndication formats. Some of the most common extensions are + handled natively—particularly when they provide one format with + features to bring it into line with others, such as the content + extension for RSS2—but the majority provide specialist content and + providing support for them would quickly result in a bloated package. </para> - <para>It is possible that a proper extensions mechanism may be introduced - in a future version, but as an alternative the DOM models in use within the - classes are publicly accessible, allowing the package to be wrapped with - special handlers.</para> - - <para>For example, to make use of the 'pheed' extension (namespace - http://www.pheed.com/pheed/) we might use: -<programlisting role="php"> + <para> + It is possible that a proper extensions mechanism may be introduced + in a future version, but as an alternative the DOM models in use within the + classes are publicly accessible, allowing the package to be wrapped with + special handlers. + </para> + + <para> + For example, to make use of the 'pheed' extension (namespace + http://www.pheed.com/pheed/) we might use: + <programlisting role="php"> + <![CDATA[ $feed = new XML_Feed_Parser($xml_source); $entry = $feed->getEntryByOffset(0); $eModel = $entry->model; @@ -38,11 +46,13 @@ if ($thumbnails->length) { $thumbnail_url = $thumbnails->item(0)->nodeValue; } -</programlisting> + ]]> + </programlisting> </para> </refsect1> </refentry> + <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -61,4 +71,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> +--> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/xml/xml-feed-parser/intro.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/xml/xml-feed-parser/intro.xml diff -u peardoc/en/package/xml/xml-feed-parser/intro.xml:1.2 peardoc/en/package/xml/xml-feed-parser/intro.xml:1.3 --- peardoc/en/package/xml/xml-feed-parser/intro.xml:1.2 Sun Jan 8 17:53:54 2006 +++ peardoc/en/package/xml/xml-feed-parser/intro.xml Sun Jan 15 19:50:05 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.xml.xml-feed-parser.intro"> <refnamediv> @@ -9,60 +9,80 @@ <refsect1 id="package.xml.xml-feed-parser.intro.desc"> &title.desc; - <para>XML_Feed_Parser provides a generic interface to a number of the - most popular XML-based syndication formats (Atom, RSS1, RSS2, etc). In - order to focus on its core competencies, it does not provide any HTTP or - feed creation features, but instead parses a wide range of formats quickly - and simply.</para> - - <para>Presuming the XML for a feed is stored in the variable - $xml_source, the simplest way to create an instance of the parser is: -<programlisting role="php">try { + <para> + XML_Feed_Parser provides a generic interface to a number of the + most popular XML-based syndication formats (Atom, RSS1, RSS2, etc). In + order to focus on its core competencies, it does not provide any HTTP or + feed creation features, but instead parses a wide range of formats quickly + and simply. + </para> + + <para> + Presuming the XML for a feed is stored in the variable + $xml_source, the simplest way to create an instance of the parser is: + <programlisting role="php"> + <![CDATA[ +try { $feed = new XML_Feed_Parser($xml_source); } catch (XML_Feed_Parser_Exception $e) { die('Feed invalid: ' . $e->getMessage()); -}</programlisting> -</para> +} + ]]> + </programlisting> + </para> + + <para> + The constructor accepts a number of parameters, as follows: + <programlisting role="php"> + <![CDATA[ +/* The file you wish to parse */ +$source = 'my_source.xml'; + +/* Where Relax NG is available, we can force validation of the feed */ +$validate = true; + +/* Whether or not to suppress non-fatal warnings */ +$suppress_warnings = false; + +/* If the feed is not valid XML and the tidy extension is installed we can + * attempt to use it to fix the feed */ +$use_tidy = true; + +$feed = new XML_Feed_Parser($source, $validate, $suppress_warnings, $use_tidy); + ]]> + </programlisting> + </para> - <para>The constructor accepts a number of parameters, as follows: + <para> + Once you have an instance of the parser you can extract + feed-level data by querying it directly. eg. + <programlisting role="php"> + <![CDATA[ +$title = $feed->title; + ]]> + </programlisting> + </para> -<programlisting role="php"> - /* The file you wish to parse */ - $source = 'my_source.xml'; - - /* Where Relax NG is available, we can force validation of the feed */ - $validate = true; - - /* Whether or not to suppress non-fatal warnings */ - $suppress_warnings = false; - - /* If the feed is not valid XML and the tidy extension is installed we can - * attempt to use it to fix the feed */ - $use_tidy = true; - - $feed = new XML_Feed_Parser($source, $validate, $suppress_warnings, $use_tidy);</programlisting> - </para> - - <para>Once you have an instance of the parser you can extract - feed-level data by querying it directly. eg. -<programlisting role="php">$title = $feed->title;</programlisting> - </para> - - <para>You can also access elements by iterating over the feed, or - directly by offset or id. -<programlisting role="php"> - foreach ($feed as $entry) { - print $entry->title . "\n"; - } - - $first_entry = $feed->getEntryByOffset(0); - - $particular_entry = $feed->getEntryById('http://jystewart.net/entry/1'); -</programlisting> + <para> + You can also access elements by iterating over the feed, or + directly by offset or id. + <programlisting role="php"> + <![CDATA[ +foreach ($feed as $entry) { + print $entry->title . "\n"; +} + +$first_entry = $feed->getEntryByOffset(0); + +$particular_entry = $feed->getEntryById('http://jystewart.net/entry/1'); + ]]> + </programlisting> </para> + </refsect1> </refentry> + <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -81,4 +101,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> +-->
http://cvs.php.net/viewcvs.cgi/peardoc/en/package/xml/xml-feed-parser/extensions.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/xml/xml-feed-parser/extensions.xml diff -u peardoc/en/package/xml/xml-feed-parser/extensions.xml:1.2 peardoc/en/package/xml/xml-feed-parser/extensions.xml:1.3 --- peardoc/en/package/xml/xml-feed-parser/extensions.xml:1.2 Sun Jan 8 17:53:54 2006 +++ peardoc/en/package/xml/xml-feed-parser/extensions.xml Sun Jan 15 19:50:05 2006 @@ -1,33 +1,41 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.xml.xml-feed-parser.extensions"> <refnamediv> <refname>XML_Feed_Parser and Extensions</refname> <refpurpose>Handling extensions with XML_Feed_Parser</refpurpose> </refnamediv> - <refsect1 id="package.xml.xml-feed-parser.intro.desc"> + + <refsect1 id="package.xml.xml-feed-parser.extensions.desc"> &title.desc; - <para>Using XML namespaces, the various syndication formats are very - easy to extend and the number of extensions in use is enormous.</para> + <para> + Using XML namespaces, the various syndication formats are very + easy to extend and the number of extensions in use is enormous. + </para> - <para>XML_Feed_Parser focusses on core functionality shared between the - various syndication formats. Some of the most common extensions are - handled natively—particularly when they provide one format with - features to bring it into line with others, such as the content - extension for RSS2—but the majority provide specialist content and - providing support for them would quickly result in a bloated package. + <para> + XML_Feed_Parser focusses on core functionality shared between the + various syndication formats. Some of the most common extensions are + handled natively—particularly when they provide one format with + features to bring it into line with others, such as the content + extension for RSS2—but the majority provide specialist content and + providing support for them would quickly result in a bloated package. </para> - <para>It is possible that a proper extensions mechanism may be introduced - in a future version, but as an alternative the DOM models in use within the - classes are publicly accessible, allowing the package to be wrapped with - special handlers.</para> - - <para>For example, to make use of the 'pheed' extension (namespace - http://www.pheed.com/pheed/) we might use: -<programlisting role="php"> + <para> + It is possible that a proper extensions mechanism may be introduced + in a future version, but as an alternative the DOM models in use within the + classes are publicly accessible, allowing the package to be wrapped with + special handlers. + </para> + + <para> + For example, to make use of the 'pheed' extension (namespace + http://www.pheed.com/pheed/) we might use: + <programlisting role="php"> + <![CDATA[ $feed = new XML_Feed_Parser($xml_source); $entry = $feed->getEntryByOffset(0); $eModel = $entry->model; @@ -38,11 +46,13 @@ if ($thumbnails->length) { $thumbnail_url = $thumbnails->item(0)->nodeValue; } -</programlisting> + ]]> + </programlisting> </para> </refsect1> </refentry> + <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -61,4 +71,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> +--> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/xml/xml-feed-parser/intro.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/xml/xml-feed-parser/intro.xml diff -u peardoc/en/package/xml/xml-feed-parser/intro.xml:1.2 peardoc/en/package/xml/xml-feed-parser/intro.xml:1.3 --- peardoc/en/package/xml/xml-feed-parser/intro.xml:1.2 Sun Jan 8 17:53:54 2006 +++ peardoc/en/package/xml/xml-feed-parser/intro.xml Sun Jan 15 19:50:05 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.xml.xml-feed-parser.intro"> <refnamediv> @@ -9,60 +9,80 @@ <refsect1 id="package.xml.xml-feed-parser.intro.desc"> &title.desc; - <para>XML_Feed_Parser provides a generic interface to a number of the - most popular XML-based syndication formats (Atom, RSS1, RSS2, etc). In - order to focus on its core competencies, it does not provide any HTTP or - feed creation features, but instead parses a wide range of formats quickly - and simply.</para> - - <para>Presuming the XML for a feed is stored in the variable - $xml_source, the simplest way to create an instance of the parser is: -<programlisting role="php">try { + <para> + XML_Feed_Parser provides a generic interface to a number of the + most popular XML-based syndication formats (Atom, RSS1, RSS2, etc). In + order to focus on its core competencies, it does not provide any HTTP or + feed creation features, but instead parses a wide range of formats quickly + and simply. + </para> + + <para> + Presuming the XML for a feed is stored in the variable + $xml_source, the simplest way to create an instance of the parser is: + <programlisting role="php"> + <![CDATA[ +try { $feed = new XML_Feed_Parser($xml_source); } catch (XML_Feed_Parser_Exception $e) { die('Feed invalid: ' . $e->getMessage()); -}</programlisting> -</para> +} + ]]> + </programlisting> + </para> + + <para> + The constructor accepts a number of parameters, as follows: + <programlisting role="php"> + <![CDATA[ +/* The file you wish to parse */ +$source = 'my_source.xml'; + +/* Where Relax NG is available, we can force validation of the feed */ +$validate = true; + +/* Whether or not to suppress non-fatal warnings */ +$suppress_warnings = false; + +/* If the feed is not valid XML and the tidy extension is installed we can + * attempt to use it to fix the feed */ +$use_tidy = true; + +$feed = new XML_Feed_Parser($source, $validate, $suppress_warnings, $use_tidy); + ]]> + </programlisting> + </para> - <para>The constructor accepts a number of parameters, as follows: + <para> + Once you have an instance of the parser you can extract + feed-level data by querying it directly. eg. + <programlisting role="php"> + <![CDATA[ +$title = $feed->title; + ]]> + </programlisting> + </para> -<programlisting role="php"> - /* The file you wish to parse */ - $source = 'my_source.xml'; - - /* Where Relax NG is available, we can force validation of the feed */ - $validate = true; - - /* Whether or not to suppress non-fatal warnings */ - $suppress_warnings = false; - - /* If the feed is not valid XML and the tidy extension is installed we can - * attempt to use it to fix the feed */ - $use_tidy = true; - - $feed = new XML_Feed_Parser($source, $validate, $suppress_warnings, $use_tidy);</programlisting> - </para> - - <para>Once you have an instance of the parser you can extract - feed-level data by querying it directly. eg. -<programlisting role="php">$title = $feed->title;</programlisting> - </para> - - <para>You can also access elements by iterating over the feed, or - directly by offset or id. -<programlisting role="php"> - foreach ($feed as $entry) { - print $entry->title . "\n"; - } - - $first_entry = $feed->getEntryByOffset(0); - - $particular_entry = $feed->getEntryById('http://jystewart.net/entry/1'); -</programlisting> + <para> + You can also access elements by iterating over the feed, or + directly by offset or id. + <programlisting role="php"> + <![CDATA[ +foreach ($feed as $entry) { + print $entry->title . "\n"; +} + +$first_entry = $feed->getEntryByOffset(0); + +$particular_entry = $feed->getEntryById('http://jystewart.net/entry/1'); + ]]> + </programlisting> </para> + </refsect1> </refentry> + <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -81,4 +101,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> +-->