Sitellite Application Framework
Class Tree         Index         All Elements

Class: RSS

Source Location: Program_Root/XML/RSS.php

Class Overview


RSS uses XSLT and Cache to generate content syndicated from other web


Author(s)

Version

  • 1.6, 2003-05-23, $Id: RSS.php,v 1.2 2005/07/06 15:30:56 lux Exp $

Copyright

  • Copyright (C) 2001-2003, Simian Systems Inc.

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 74]
RSS uses XSLT and Cache to generate content syndicated from other web

sites and to cache it so as not to put unnecessarily load on those sites. RSS also exposes an EasyText method, which adds support for the EasyText =RSS tag. Please note: this class depends on the Cache and XSLT classes.

New in 1.2:

  • Added the ability to create RSS documents instead of simply processing them. This is compatible with RSS version 0.91, but I don't know about 1.0.
New in 1.4:
  • Fixed a bug in the EasyText method (stupid spelling mistake!). Thanks Oleg for the report!
New in 1.6:
  • Removed the EasyText() and EasyTextInit() methods.

1 <?php
2
3 $rss = new RSS;
4
5 $url = 'http://somesite.com/content.rss';
6 $rss_content = $rss->getUrl ($url);
7 $stylesheet = $rss->getXsl ('inc/xsl/somesite.xsl');
8
9 $data = $rss->process ($stylesheet, $rss_content, 'cache', 900, $url);
10 if ($data) {
11 echo $data;
12 } else {
13 echo $rss->xslt->error;
14 }
15
16 ?>




Tags:

access:  public
version:  1.6, 2003-05-23, $Id: RSS.php,v 1.2 2005/07/06 15:30:56 lux Exp $
license:  http://www.sitellite.org/index/license
copyright:  Copyright (C) 2001-2003, Simian Systems Inc.
author:  John Luxford <mailto:lux@simian.ca>


[ Top ]


Class Variables

$channel =

[line 113]

If an RSS document is being created, this will contain a reference to the current channel.



Tags:

access:  public

Type:   mixed


[ Top ]

$doc =

[line 95]

If an RSS document is being created, this will contain the XMLDoc object.



Tags:

access:  public

Type:   mixed


[ Top ]

$docroot =

[line 104]

If an RSS document is being created, this will contain a reference to the root node.



Tags:

access:  public

Type:   mixed


[ Top ]

$xslt =

[line 86]

This is an XSLT processor resource returned by the

xslt_create () function. Please note: the XSLT processor is not created until the process method of this class is called, so as to maintain compatibility with systems that do not have Sablotron support installed, but are using EasyText.




Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


method addChannel [line 223]

void addChannel( string $title, string $link, [string $description = ''], [string $language = 'en-us'])

Creates a new channel XMLNode.



Tags:

access:  public


Parameters:

string   $title  
string   $link  
string   $description  
string   $language  

[ Top ]

method addItem [line 245]

void addItem( string $title, string $link, [string $description = ''])

Creates a new item XMLNode and adds it to the currently active channel.



Tags:

access:  public


Parameters:

string   $title  
string   $link  
string   $description  

[ Top ]

method getUrl [line 123]

string getUrl( string $url)

Returns the contents of the specified url.



Tags:

access:  public


Parameters:

string   $url  

[ Top ]

method getXsl [line 135]

string getXsl( string $file)

Returns the contents of the specified xsl file.



Tags:

access:  public


Parameters:

string   $file  

[ Top ]

method makeDoc [line 192]

void makeDoc( [string $version = '0.91'])

Creates a new XMLDoc object, sets the root node to 'rss', and also defines its doctype. Note: $version is the RSS version, not the XML version.



Tags:

access:  public


Parameters:

string   $version  

[ Top ]

method process [line 153]

string process( string $xsldata, string $xmldata, string $cache_dir, string $cache_duration, string $cache_file)

Returns the contents of the transformed data, or its cached equivalent. Returning 0 means there was an XSL transformation error.



Tags:

access:  public


Parameters:

string   $xsldata  
string   $xmldata  
string   $cache_dir  
string   $cache_duration  
string   $cache_file  

[ Top ]

method setDoctype [line 209]

void setDoctype( string $doctype)

Allows you to easily modify the doctype of the current RSS document being created.



Tags:

access:  public


Parameters:

string   $doctype  

[ Top ]

method write [line 262]

string write( )

Calls the write() method on the current RSS document, and returns the result.



Tags:

access:  public


[ Top ]


Copyright © 2007, SIMIAN systems Inc.
All rights reserved. Privacy policy
Documentation generated on Tue, 13 Feb 2007 17:18:56 -0600 by Sitellite AppDoc and phpDocumentor 1.2.2