20 $definition = $config->getHTMLDefinition();
21 $e =& $context->get(
'ErrorCollector',
true);
24 $ok =& $context->get(
'IDAccumulator',
true);
27 $context->register(
'IDAccumulator', $id_accumulator);
31 $current_token =& $context->get(
'CurrentToken',
true);
32 if (!$current_token) {
33 $context->register(
'CurrentToken', $token);
44 $d_defs = $definition->info_global_attr;
51 foreach ($definition->info_attr_transform_pre as $transform) {
52 $attr = $transform->transform($o = $attr, $config, $context);
55 $e->send(E_NOTICE,
'AttrValidator: Attributes transformed', $o, $attr);
62 foreach ($definition->info[$token->name]->attr_transform_pre as $transform) {
63 $attr = $transform->transform($o = $attr, $config, $context);
66 $e->send(E_NOTICE,
'AttrValidator: Attributes transformed', $o, $attr);
74 $defs = $definition->info[$token->name]->attr;
77 $context->register(
'CurrentAttr', $attr_key);
81 foreach ($attr as $attr_key => $value) {
84 if (isset($defs[$attr_key])) {
86 if ($defs[$attr_key] ===
false) {
95 $result = $defs[$attr_key]->validate(
101 } elseif (isset($d_defs[$attr_key])) {
104 $result = $d_defs[$attr_key]->validate(
119 $e->send(E_ERROR,
'AttrValidator: Attribute removed');
123 unset($attr[$attr_key]);
124 } elseif (is_string(
$result)) {
142 $context->destroy(
'CurrentAttr');
147 foreach ($definition->info_attr_transform_post as $transform) {
148 $attr = $transform->transform($o = $attr, $config, $context);
151 $e->send(E_NOTICE,
'AttrValidator: Attributes transformed', $o, $attr);
157 foreach ($definition->info[$token->name]->attr_transform_post as $transform) {
158 $attr = $transform->transform($o = $attr, $config, $context);
161 $e->send(E_NOTICE,
'AttrValidator: Attributes transformed', $o, $attr);
166 $token->attr = $attr;
169 if (!$current_token) {
170 $context->destroy(
'CurrentToken');