Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
simplified_parser_processor Class Reference

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

Inheritance diagram for simplified_parser_processor:
progressive_parser_processor grouped_parser_processor moodle1_parser_processor restore_inforef_parser_processor restore_moodlexml_parser_processor restore_questions_parser_processor restore_roles_parser_processor restore_structure_parser_processor restore_users_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. More...
 
 before_path ($path)
 The parser fires this each time one path is going to be parsed. More...
 
 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) More...
 
 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.

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.

◆ 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: