Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
simplified_parser_processor Class Reference

Abstract xml parser processor to to simplify and dispatch parsed chunks. More...

Inheritance diagram for simplified_parser_processor:

Public Member Functions

 __construct (array $paths=array())
 
 add_path ($path)
 
 after_path ($path)
 The parser fires this each time one path has been parsed.
 
 before_path ($path)
 The parser fires this each time one path is going to be parsed.
 
 debug_info ()
 
 process_cdata ($cdata)
 Perform custom transformations in the processed cdata.
 
 process_chunk ($data)
 Get one chunk of parsed data and make it simpler adding attributes as tags and delegating to dispatch_chunk() the procesing of the resulting chunk.
 
 receive_chunk ($data)
 

Protected Member Functions

 dispatch_chunk ($data)
 Get the already simplified chunk and dispatch it.
 
 notify_path_end ($path)
 Get one selected path and notify about end.
 
 notify_path_start ($path)
 Get one selected path and notify about start.
 
 path_is_selected ($path)
 
 path_is_selected_parent ($path)
 
 postprocess_chunk ($data)
 
 process_pending_startend_notifications ($path, $action)
 Adjust start/end til finding one match start/end path (included)
 
 selected_parent_exists ($path)
 Returns the first selected parent if available or false.
 

Protected Attributes

 $chunks
 
 $inittime
 
 $parentpaths
 
 $parentsinfo
 
 $paths
 
 $startendinfo
 

Detailed Description

Abstract xml parser processor to to simplify and dispatch parsed chunks.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

This @progressive_parser_processor handles the requested paths, performing some conversions from the original "propietary array format" used by the @progressive_parser to a simplified structure to be used easily. Found attributes are converted automatically to tags and cdata to simpler values.

Note: final tag attributes are discarded completely!

TODO: Complete phpdocs

Member Function Documentation

◆ after_path()

simplified_parser_processor::after_path ( $path)

The parser fires this each time one path has been parsed.

Parameters
string$pathxml path which parsing has ended

Reimplemented from progressive_parser_processor.

Reimplemented in grouped_parser_processor.

◆ before_path()

simplified_parser_processor::before_path ( $path)

The parser fires this each time one path is going to be parsed.

Parameters
string$pathxml path which parsing has started

Reimplemented from progressive_parser_processor.

Reimplemented in grouped_parser_processor.

◆ dispatch_chunk()

simplified_parser_processor::dispatch_chunk ( $data)
abstractprotected

◆ notify_path_end()

simplified_parser_processor::notify_path_end ( $path)
abstractprotected

◆ notify_path_start()

simplified_parser_processor::notify_path_start ( $path)
abstractprotected

◆ postprocess_chunk()

simplified_parser_processor::postprocess_chunk ( $data)
protected

◆ process_cdata()

progressive_parser_processor::process_cdata ( $cdata)
inherited

◆ process_chunk()

simplified_parser_processor::process_chunk ( $data)

Get one chunk of parsed data and make it simpler adding attributes as tags and delegating to dispatch_chunk() the procesing of the resulting chunk.

Reimplemented from progressive_parser_processor.

◆ process_pending_startend_notifications()

simplified_parser_processor::process_pending_startend_notifications ( $path,
$action )
protected

Adjust start/end til finding one match start/end path (included)

This will trigger all the pending {

See also
notify_path_start} and {
notify_path_end} calls for one given path and action
Parameters
stringpath the path to look for as limit
stringaction the action to look for as limit

The documentation for this class was generated from the following file: