Replace constant expressions in given AVT

@param  DOMAttr $attribute
@return void
435884
protected function normalizeAttribute(DOMAttr $attribute)
	{
		AVTHelper::replace(
			$attribute,
			function ($token)
			{
				if ($token[0] === 'expression')
				{
					$token[1] = $this->evaluateExpression($token[1]);
				}

				return $token;
			}
		);
	}
1360634
public function escapeHtmlAttribute($attribute)
    {
        if (!$this->escapeHtmlAttrHelper) {
            $this->escapeHtmlAttrHelper = $this->getView()->plugin('escapehtmlattr');
            if (!$this->escapeHtmlAttrHelper instanceof EscapeHtmlAttr) {
                throw new Exception\RuntimeException('Helper not loaded: escapeHtmlAttr');
            }
        }
        return $this->escapeHtmlAttrHelper->__invoke($attribute);
    }
387932
public function allowAttribute($attribute)
    {
        if (is_array($attribute))
        {
            foreach ($attribute as $attrib)
                $this->allowed_attributes[$attrib] = true;
        }
        else
            $this->allowed_attributes[$attribute] = true;
        return $this;
    }
1227421
public function normalizeTags($attribute,$params)
	{
		$this->tags=Tag::array2string(array_unique(Tag::string2array($this->tags)));
	}
1204090
protected function takeAttributeFromDOM($attribute)
    {
        switch ($attribute->localName) {
        case 'limit':
            $this->_limit = $attribute->nodeValue;
            break;
        default:
            parent::takeAttributeFromDOM($attribute);
        }
    }
284432
public function addAttribute($attribute, $value)
    {
        $this->attributes[$attribute] = (string) $value;
        $this->eventHandler->attributeAdded($this, $attribute, $value);
    }
239461
protected function extendedAttrPassword(DOMNode $node, DOMAttr $attr)
	{
		$id = $node->getAttribute('id');
		$passwordId = $attr->value;
		$this->js []= "addValidator('password', '#$id', '$passwordId');";
	}
488517
public function set($attribute, $value = null)
    {
        parent::set($this->getRealKey($attribute), $value);
    }
278207
protected function validateAttribute($object, $attribute)
    {
        $method = $this->method;
        $object->{$method}($attribute, $this->params);
    }
1326157
private function makeAbsoluteAttr($base, \DOMNode $e, $attr)
    {
        if (!$e->attributes->getNamedItem($attr)) {
            return;
        }

        // Trim leading and trailing white space. I don't really like this but
        // unfortunately it does appear on some sites. e.g.  <img src=" /path/to/image.jpg" />
        $url = trim(str_replace('%20', ' ', $e->getAttribute($attr)));
        $url = str_replace(' ', '%20', $url);

        if (!preg_match('!^(https?://|#)!i', $url)) {
            if ($absolute = \SimplePie_IRI::absolutize($base, $url)) {
                $e->setAttribute($attr, $absolute);
            }
        }
    }
203394
public function setTranslatedAttribute($attribute, $alias = null)
    {
        if ($alias) {
            $this->translatedAliasAttribute[$alias] = $attribute;
        } else {
            $this->translatedAttribute = $attribute;
        }
    }
149013
protected function takeAttributeFromDOM($attribute)
    {
        $absoluteAttrName = $attribute->namespaceURI . ':' . $attribute->localName;
        if ($absoluteAttrName == $this->lookupNamespace('yt') . ':' . 'format') {
            $this->_format = $attribute->nodeValue;
        } else {
            parent::takeAttributeFromDOM($attribute);
        }
    }
1157066
protected function setDefaultLastValue($attribute, $default)
    {
        if (empty($this->getLastValue()) && $this->getLastValue() !== '0' && $this->getOperationType() == AttributeConverterInterface::TYPE_MODIFY) {
            $original = $this->getCurrentLdapAttributeValue($attribute);
            $this->setLastValue(is_null($original) ? $default : $original);
        } elseif (empty($this->getLastValue()) && $this->getLastValue() !== '0' && $this->getOperationType() == AttributeConverterInterface::TYPE_CREATE) {
            $this->setLastValue($default);
        }
    }
45493
protected static function executeAttributePreprocessor(Tag $tag, $attrName, $regexp, $map)
	{
		$attrValue = $tag->getAttribute($attrName);
		$captures  = self::getNamedCaptures($attrValue, $regexp, $map);
		foreach ($captures as $k => $v)
		{
			// Attribute preprocessors cannot overwrite other attributes but they can
			// overwrite themselves
			if ($k === $attrName || !$tag->hasAttribute($k))
			{
				$tag->setAttribute($k, $v);
			}
		}
	}
1140086
protected static function replaceTokensInAttribute(DOMAttr $attribute, $regexp, $fn)
	{
		$attrValue = preg_replace_callback(
			$regexp,
			function ($m) use ($fn, $attribute)
			{
				$replacement = $fn($m, $attribute);
				if ($replacement[0] === 'expression' || $replacement[0] === 'passthrough')
				{
					// Use the node's text content as the default expression
					$replacement[] = '.';

					return '{' . $replacement[1] . '}';
				}
				else
				{
					return $replacement[1];
				}
			},
			$attribute->value
		);
		$attribute->value = htmlspecialchars($attrValue, ENT_COMPAT, 'UTF-8');
	}
1255555
function addAttribute(Attribute $attribute)
    {
        $attribute->setRelation($this);
        $this->attributes[$attribute->getName()] = $attribute;
        return $this;
    }
206747
function _removeAttr($attr, &$attributes)
    {
        $attr = strtolower($attr);
        if (isset($attributes[$attr])) {
            unset($attributes[$attr]);
        }
    }