Back to Changelog class

Method startElement

public void
startElement
(mixed $parser, mixed $name, mixed $attrs = array())
XML Start Element callback
Parameters
  • object $parser Parser object
  • string $name Name of the tag found
  • array $attrs Attributes of the tag
Returns
  • void
Since
  • 1.7.0
-
  • This is public because it is called externally
Class: Changelog
Project: Joomla

Method startElement - Source code

/**
 * XML Start Element callback
 *
 * @param   object  $parser  Parser object
 * @param   string  $name    Name of the tag found
 * @param   array   $attrs   Attributes of the tag
 *
 * @return  void
 *
 * @note    This is public because it is called externally
 * @since   1.7.0
 */
public function startElement($parser, $name, $attrs = array())
{
    $this->stack[] = $name;
    $tag = $this->getStackLocation();
    // Reset the data
    if (isset($this->{$tag})) {
        $this->{$tag}->data = '';
    }
    $name = strtolower($name);
    if (!isset($this->currentChangelog->{$name})) {
        $this->currentChangelog->{$name} = new \stdClass();
    }
    $this->currentChangelog->{$name}->data = '';
    foreach ($attrs as $key => $data) {
        $key = strtolower($key);
        $this->currentChangelog->{$name}->{$key} = $data;
    }
}