XML Tutorials

  Home arrow XML Tutorials arrow Page 2 - Creating RSS 2.0 Feeds
XML TUTORIALS

Creating RSS 2.0 Feeds
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-04-17

    Table of Contents:
  • Creating RSS 2.0 Feeds
  • guid, Permalink or not
  • Creating RSS 2.0 with PHP
  • Caching and saving

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Creating RSS 2.0 Feeds - guid, Permalink or not


    (Page 2 of 4 )

    XML::RSS does support the two guid isPermalink options but in a slightly less predictable way than the other element functions. To set guid isPermalink="true", you should do this:

      $rss->add_item(
          title       => "Example Entry 1",
          link        => http://www.oreilly.com/example/entry1,
          description => 'blah blah',
          permaLink   => http://www.oreilly.com/example/entry1,
      );

    However, to set guid isPermalink="false", you should do this:

      $rss->add_item(
          title       => "Example Entry 1",
          link        => http://www.oreilly.com/example/entry1,
          description => 'blah blah',
          guid        => http://www.example.com/guidsRus/348324327,
      );

    Module support under XML::RSS

    As you can see, XML::RSS always includes the namespace declaration for the blogChannel module. You can also use it to include other modules within your feed.

    In Example 4-4, we passed known strings to the module. It's really not of much use as a script; you need to add a more dynamic form of data, or the feed will be very boring indeed. We do an awful lot of this sort of thing in Chapter 10, so let's leave Perl until then, and move on to another language.

    More XML Tutorials Articles
    More By O'Reilly Media

    blog comments powered by Disqus

    XML TUTORIALS ARTICLES

    - Validation with Document Type Definitions (D...
    - Creating a Well-Formed XML Document
    - Getting to Know XML
    - A Friendly Approach to XML
    - Creating RSS 2.0 Feeds
    - Using Modules in Your RSS Feed
    - RSS 2.0
    - Querying XML: Use Cases
    - Joins and Query Use with XML
    - Solving Problems by Querying XML
    - Performing Set Operations When Querying XML
    - Querying XML
    - Handling Data for Ajax with JSON
    - Handling XML Data for Ajax
    - XML and JSON for Ajax


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap