private function printElement(Element $node) { $out = '<' . $node->getName(); foreach ($node->getAttributes() as $attribute) { $out .= ' ' . $attribute->getName(); if ($attribute->getValue() !== null) { $quotes = $this->printQuotes($attribute->getQuoting()); $out .= '=' . $quotes . $attribute->getValue() . $quotes; } } if (!$node->getChildren()->isEmpty() || $node->hasClosingTag()) { return $out . '>' . $this->printNodes($node->getChildren()) . '</' . $node->getName() . '>'; } else { return $out . '/>'; } }
private function copyChildren(Element $copy) { foreach ($this->children as $child) { if ($child instanceof Element) { $copy->getChildren()->append($child->copy()); } else { if ($child instanceof Text) { $copy->getChildren()->append(new Text($child->getText())); } } } }
public function animateChildren(Element $element) { foreach ($element->getChildren() as $child) { if (!$child instanceof Element) { continue; } if ($child->getParent()) { $this->animate($child); } } }
public function pushText() { $this->element->getChildren()->append(new Text($this->nextText)); $this->reset(); }