public function add_path($path, $grouped = false)
 {
     if ($grouped) {
         // Check there is no parent in the branch being grouped
         if ($found = $this->grouped_parent_exists($path)) {
             $a = new stdclass();
             $a->path = $path;
             $a->parent = $found;
             throw new progressive_parser_exception('xml_grouped_parent_found', $a);
         }
         // Check there is no child in the branch being grouped
         if ($found = $this->grouped_child_exists($path)) {
             $a = new stdclass();
             $a->path = $path;
             $a->child = $found;
             throw new progressive_parser_exception('xml_grouped_child_found', $a);
         }
         $this->groupedpaths[] = $path;
     }
     parent::add_path($path);
 }
 /**
  * Dispatch grouped chunks safely once their end tag happens.
  * Also notify end of path if selected and not under grouped
  */
 public function after_path($path)
 {
     if ($this->path_is_grouped($path)) {
         // Any accumulated information must be in
         // currentdata, properly built
         $data = $this->currentdata[$path];
         unset($this->currentdata[$path]);
         // TODO: If running under DEBUG_DEVELOPER notice about >1MB grouped chunks
         $this->dispatch_chunk($data);
     }
     // Normal notification of path end
     // Only if path is selected and not child of grouped
     if ($this->path_is_selected($path) && !$this->grouped_parent_exists($path)) {
         parent::after_path($path);
     }
 }
 /**
  * The parser fires this each time one path has been parsed
  *
  * @param string $path xml path which parsing has ended
  */
 public function after_path($path)
 {
     // Have finished one grouped path, dispatch it
     if ($this->path_is_grouped($path)) {
         // Any accumulated information must be in
         // currentdata, properly built
         $data = $this->currentdata[$path];
         unset($this->currentdata[$path]);
         // Always, before dispatching any chunk, send all pending start notifications.
         $this->process_pending_startend_notifications($path, 'start');
         // TODO: If running under DEBUG_DEVELOPER notice about >1MB grouped chunks
         // And, finally, dispatch it.
         $this->dispatch_chunk($data);
     }
     // Normal notification of path end
     // Only if path is selected and not child of grouped
     if (!$this->grouped_parent_exists($path)) {
         parent::after_path($path);
     }
 }