\Jonah_FeedParser

Jonah_FeedParser.

Copyright 2000-2017 Horde LLC (http://www.horde.org/)

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Summary

Methods
Properties
Constants
Jonah_FeedParser()
init()
cleanup()
parse()
startElement()
endElement()
characterData()
defaultHandler()
$parser
$parent
$child
$channel
$image
$story
$item
$structure
$format
$error
$charset
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$parser

$parser : resource

XML parser resource.

Type

resource

$parent

$parent : string

The current parent tag - CHANNEL, STORY, etc.

Type

string

$child

$child : string

The current child tag - TITLE, DESCRIPTION, URL, etc.

Type

string

$channel

$channel : array

All the attributes of the channel description.

Type

array

$image

$image : array

All the attributes of the channel image.

Type

array

$story

$story : array

All the attributes of the current story being parsed.

Type

array

$item

$item : array

All the attributes of the current item being parsed.

Type

array

$structure

$structure : array

The array that all the parsed information gets dumped into.

Type

array

$format

$format : string

What kind of feed are we parsing?

Type

string

$error

$error : string

Error string.

Type

string

$charset

$charset : string

Feed charset.

Type

string

Methods

Jonah_FeedParser()

Jonah_FeedParser(  $charset) 

Constructs a new Jonah_FeedParser parser object.

Parameters

$charset

init()

init() 

Initialize the XML parser.

cleanup()

cleanup() 

Clean up any existing data - reset to a state where we can cleanly open a new file.

parse()

parse(  $data) 

Actually do the parsing. Separated from the constructor just in case you want to set any other options on the parser, load initial data, whatever.

Parameters

$data

The XML feed data to parse.

startElement()

startElement(  $parser,   $name,   $attribs) 

Start collecting data about a new element.

Parameters

$parser
$name
$attribs

endElement()

endElement(  $parser,   $name) 

Handle the ends of XML elements - wrap up whatever we've been putting together and store it for safekeeping.

Parameters

$parser
$name

characterData()

characterData(  $parser,   $data) 

The handler for character data encountered in the XML file.

Parameters

$parser
$data

defaultHandler()

defaultHandler(  $parser,   $data) 

Handles things that we don't recognize. A no-op.

Parameters

$parser
$data