MicroFormatParser Class Reference


Public Member Functions

 MicroFormatParser ()
 parserSetup ($args)
 parseSource ($str)
 parseCard ($child)
 parseCalendar ($child)
 parseReview ($child)
 parseRel ($child)

Public Attributes

 $_dom = false
 Dom object.
 $_parseHCard = true
 Parser switch.
 $_parseHCalendar = true
 Parser switch.
 $_parseHReview = true
 Parser switch.
 $_parseRelTags = true
 Parser switch.

Detailed Description

You NEED xArray library for this to work. You can get it here: http://www.phpclasses.org/browse/package/3565.html.

After you download it, extract the xarray.php file into the lib/ folder of this distribution.


Member Function Documentation

MicroFormatParser::MicroFormatParser (  ) 

Constructor. Will die if no DOM XML extension found.

MicroFormatParser::parserSetup ( args  ) 

Sets up parser switches. Accepts a hash of values to set up. Returns true on success, false on failure.

Parameters:
$args Array of setup values.
Returns:
True on success, false on failure.

MicroFormatParser::parseSource ( str  ) 

Main parser dispatcher method. This is where the first-level parsing gets dispatched to specific parser methods. Accepts (requires) a single string, containing HTML to be parsed for uFormats. Returns an xArray of parsed uFormats' objects.

Parameters:
$str HTML to be parsed.
Returns:
xArray of uFormat objects.

MicroFormatParser::parseCard ( child  ) 

HCard-specific first level parser. This is where all the hcard container elements are detected. Accepts a DOM XML node, and returns an xArray of found hcards.

Normaly, there should be no need to call this yourself. Use parseSource method with appropriate parser setup instead.

MicroFormatParser::parseCalendar ( child  ) 

HCalendar-specific first level parser. This is where all the hcalendar container elements are detected. Accepts a DOM XML node, and returns an xArray of found hcalendars.

Normaly, there should be no need to call this yourself. Use parseSource method with appropriate parser setup instead.

MicroFormatParser::parseReview ( child  ) 

HReview-specific first level parser. This is where all the hreview container elements are detected. Accepts a DOM XML node, and returns an xArray of found hreviews.

Normaly, there should be no need to call this yourself. Use parseSource method with appropriate parser setup instead.

MicroFormatParser::parseRel ( child  ) 

RelTag-specific first level parser. This is where all the relTags container elements are detected. Accepts a DOM XML node, and returns an xArray of found relTags.

Normaly, there should be no need to call this yourself. Use parseSource method with appropriate parser setup instead.


Member Data Documentation

MicroFormatParser::$_dom = false

Dom object.

MicroFormatParser::$_parseHCard = true

Parser switch.

MicroFormatParser::$_parseHCalendar = true

Parser switch.

MicroFormatParser::$_parseHReview = true

Parser switch.

MicroFormatParser::$_parseRelTags = true

Parser switch.