feed:fetch

Purpose

Retrieves various types of feeds and converts the input markup to RSS 2.0. It is the page author's responsibility to provide an XSL transformation that extracts the relevant information and converts the output into an XDIME fragment. Refer to the topic entitled Fetching feeds for more information.

Contained by

Attributes

Attribute Description Type Default Options Use
max-item-count The number of items returned in the response. xs:int [1,∞] 10    optional 
timeout The sent to the server and back timeout; in seconds. The timeout value is represented as a double value with up to three fractional digits, i.e. the timeout can be specified with millisecond precision. Overrides any timeout settings in the mcs-config.xml file. xs:double     optional 
url The URI of a feed to retrieve. xs:anyURI     required 
xml:id It is used by the pipeline:errorSourceID function to identify the feed:fetch element. Refer to Handling pipeline errors for further information. xs:ID     optional 

Example

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:mcs="http://www.volantis.com/xmlns/2006/01/xdime/mcs"
  xmlns:pipeline="http://www.volantis.com/xmlns/marlin-pipeline"
  xmlns:feed="http://www.volantis.com/xmlns/2010/11/feed">
  <head>
    <title>feed:fetch</title>
  </head>
  <body>
    <pipeline:try>
      <pipeline:preferred>
        <pipeline:transform href="rss2xdime.xsl">
          <feed:fetch xml:id="feed1" url="http://feeds.nytimes.com/nyt/rss/HomePage"/>
        </pipeline:transform>
      </pipeline:preferred>
      <pipeline:alternative>
        <pipeline:content>
          <p>There was a problem retrieving the information requested.</p>
          <p>Message: <pipeline:value-of expr="pipeline:errorMessage()"/></p>
          <p>Source Id: <pipeline:value-of expr="pipeline:errorSourceID()"/></p>
          <p>Code Name: <pipeline:value-of expr="pipeline:errorCodeName()"/></p>
          <p>Code URI: <pipeline:value-of expr="pipeline:errorCodeURI()"/></p>
        </pipeline:content>
      </pipeline:alternative>
    </pipeline:try>
  </body>
</html>

An example of an XSL transformation that converts RSS 2.0 to XDIME 2 can be found in the ${MCS_HOME}/webapps/mcs.war/projects/connectors/feed/ directory.

Related topics