97 public function prepare($config, $context)
99 $this->htmlDefinition = $config->getHTMLDefinition();
107 $this->currentNesting =& $context->get(
'CurrentNesting');
108 $this->currentToken =& $context->get(
'CurrentToken');
109 $this->inputZipper =& $context->get(
'InputZipper');
122 $def = $config->getHTMLDefinition();
123 foreach ($this->needed as $element => $attributes) {
124 if (is_int($element)) {
125 $element = $attributes;
127 if (!isset($def->info[$element])) {
130 if (!is_array($attributes)) {
133 foreach ($attributes as
$name) {
134 if (!isset($def->info[$element]->attr[$name])) {
135 return "$element.$name";
149 if (!empty($this->currentNesting)) {
150 $parent_token = array_pop($this->currentNesting);
151 $this->currentNesting[] = $parent_token;
152 $parent = $this->htmlDefinition->info[$parent_token->name];
154 $parent = $this->htmlDefinition->info_parent_def;
156 if (!isset($parent->child->elements[
$name]) || isset($parent->excludes[
$name])) {
160 for ($i = count($this->currentNesting) - 2; $i >= 0; $i--) {
161 $node = $this->currentNesting[$i];
162 $def = $this->htmlDefinition->info[$node->name];
163 if (isset($def->excludes[
$name])) {
183 $i = count($this->inputZipper->back) - 1;
190 $current = $this->inputZipper->back[$i];
210 if ($nesting === null) {
237 $i = count($this->inputZipper->front) - 1;
244 $current = $this->inputZipper->front[$i];