Clean the value of the attribute
@param DOMAttr $domAttr
327877
private function cleanAttrValue(DOMAttr $domAttr)
    {
        $attrName = strtolower($domAttr->name);
        if ($attrName === 'style' && !empty($this->config->WhiteListStyle)) {
            $styles = explode(';', $domAttr->value);
            foreach ($styles as $key => &$subStyle) {
                $subStyle = array_map("trim", explode(':', strtolower($subStyle), 2));
                if (empty($subStyle[0]) || !in_array($subStyle[0], $this->config->WhiteListStyle)) {
                    unset($styles[$key]);
                }
            }
            $implodeFunc = function ($styleSheet) {
                return implode(':', $styleSheet);
            };
            $domAttr->ownerElement->setAttribute($attrName, implode(';', array_map($implodeFunc, $styles)) . ';');
        }
        if ($attrName === 'class' && !empty($this->config->WhiteListCssClass)) {
            $domAttr->ownerElement->setAttribute($attrName, implode(' ', array_intersect(preg_split('/\s+/', $domAttr->value), $this->config->WhiteListCssClass)));
        }
        if ($attrName === 'src' || $attrName === 'href') {
            if (strtolower(parse_url($domAttr->value, PHP_URL_SCHEME)) === 'javascript') {
                $domAttr->ownerElement->removeAttribute($attrName);
            } else {
                $domAttr->ownerElement->setAttribute($attrName, filter_var($domAttr->value, FILTER_SANITIZE_URL));
            }
        }
    }
877664
public function set_attr( $attribute, $value = null ) {
		if ( is_null( $value ) || $value === false ) {
			if ( array_key_exists( $attribute, $this->attr ) ) {
				unset( $this->attr[$attribute] );
			}
		} else {
			if ( $value === true ) {
				$value = $attribute;
			}
			$this->attr[ $attribute ] = $value;
		}
		
		return $this;
	}
1175958
public function dirtyAttributes()
	{
		if (!$this->_dirty)
			return null;

		$dirty = array_intersect_key($this->_attributes, $this->_dirty);
		return !empty($dirty) ? $dirty : null;
	}
949263
protected function uninlineAttribute(DOMAttr $attribute)
	{
		$xslAttribute = (strpos($attribute->value, '{') === false)
		              ? $this->uninlineStaticAttribute($attribute)
		              : $this->uninlineDynamicAttribute($attribute);

		// Set the xsl:attribute element's name
		$xslAttribute->setAttribute('name', $attribute->nodeName);

		// Remove the attribute from its parent element
		$attribute->parentNode->removeAttributeNode($attribute);

		return $xslAttribute;
	}
391986
def removeAttribute(self, attrName):
        '''
            

        '''
        attrName = attrName.lower()

        # Delete provided attribute name ( #attrName ) from attributes map
        try:
            del self._attributes[attrName]
        except KeyError:
            pass
896358
public function removeAttribute($attributeName)
	{
		if(array_key_exists($attributeName, $this->attributes) === false || in_array($attributeName, $this->lockedAttributes) === true)
			return;
		
		unset($this->attributes[$attributeName]);
	}
987636
def removeAttributeNode(self, attr: Attr) -> Optional[Attr]:
        """"""
        return self.attributes.removeNamedItem(attr)
520590
protected function uninlineDynamicAttribute(DOMAttr $attribute)
	{
		$xslAttribute = $this->createElement('xsl:attribute');

		// Build the content of the xsl:attribute element
		foreach (AVTHelper::parse($attribute->value) as list($type, $content))
		{
			if ($type === 'expression')
			{
				$childNode = $this->createElement('xsl:value-of');
				$childNode->setAttribute('select', $content);
			}
			else
			{
				$childNode = $this->createText($content);
			}

			$xslAttribute->appendChild($childNode);
		}

		return $xslAttribute;
	}
813901
public function attribute( $attribute, $value )
    {
        if ( null === $value )
        {
            unset( $this->attributes[ $attribute ] );
        } else {
            $this->attributes[ $attribute ] = $value;
        }

        return $this;
    }
94112
function removeAttrsValues(attrs, ignoreAttributes) {
    _.forEach(ignoreAttributes, function (attr) {
        var attrIndexes = _getIndexesInArray(attrs, attr);

        _.forEach(attrIndexes, function (index) {
            attrs[index].value = '';
        });
    });

    return attrs;
}
92877
protected function cleanAttributesOnWhitelist(\DOMElement $element)
    {
        for ($x = $element->attributes->length - 1; $x >= 0; $x--) {
            // get attribute name
            $attrName = $element->attributes->item($x)->name;

            // Remove attribute if not in whitelist
            if (!in_array(strtolower($attrName), $this->allowedAttrs) && !$this->isAriaAttribute(strtolower($attrName)) && !$this->isDataAttribute(strtolower($attrName))) {

                $element->removeAttribute($attrName);
                $this->xmlIssues[] = array(
                    'message' => 'Suspicious attribute \'' . $attrName . '\'',
                    'line' => $element->getLineNo(),
		);
            }

            // Do we want to strip remote references?
            if($this->removeRemoteReferences) {
                // Remove attribute if it has a remote reference
                if (isset($element->attributes->item($x)->value) && $this->hasRemoteReference($element->attributes->item($x)->value)) {
                    $element->removeAttribute($attrName);
                    $this->xmlIssues[] = array(
                        'message' => 'Suspicious attribute \'' . $attrName . '\'',
                        'line' => $element->getLineNo(),
		    );
                }
            }
        }
    }
321952
private function prepareTextValue(DOMElement $xml, array $attributes = null)
    {
        $text = static::getElementText($xml, true);

        return (isset($attributes['type']) && 'text' === $attributes['type']) ?
            static::clearValue($text) :
            static::getPhpValue($text, null, $this);
    }
469846
protected function clean($str)
    {
        if ($this->options->get('cleanupInput') != true) {
            // skip entire cleanup step
            return $str;
        }

        // remove white space before closing tags
        $str = mb_eregi_replace("'\s+>", "'>", $str);
        $str = mb_eregi_replace('"\s+>', '">', $str);

        // clean out the \n\r
        $replace = ' ';
        if ($this->options->get('preserveLineBreaks')) {
            $replace = '&#10;';
        }
        $str = str_replace(["\r\n", "\r", "\n"], $replace, $str);

        // strip the doctype
        $str = mb_eregi_replace("<!doctype(.*?)>", '', $str);

        // strip out comments
        $str = mb_eregi_replace("<!--(.*?)-->", '', $str);

        // strip out cdata
        $str = mb_eregi_replace("<!\[CDATA\[(.*?)\]\]>", '', $str);

        // strip out <script> tags
        if ($this->options->get('removeScripts') == true) {
            $str = mb_eregi_replace("<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>", '', $str);
            $str = mb_eregi_replace("<\s*script\s*>(.*?)<\s*/\s*script\s*>", '', $str);
        }

        // strip out <style> tags
        if ($this->options->get('removeStyles') == true) {
            $str = mb_eregi_replace("<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>", '', $str);
            $str = mb_eregi_replace("<\s*style\s*>(.*?)<\s*/\s*style\s*>", '', $str);
        }

        // strip out server side scripts
        $str = mb_eregi_replace("(<\?)(.*?)(\?>)", '', $str);

        // strip smarty scripts
        $str = mb_eregi_replace("(\{\w)(.*?)(\})", '', $str);

        return $str;
    }
1348689
public function removeAttribute() {
    $args = func_get_args();
    foreach ($args as $arg) {
      // Support arrays or multiple arguments.
      if (is_array($arg)) {
        foreach ($arg as $value) {
          unset($this->storage[$value]);
        }
      }
      else {
        unset($this->storage[$arg]);
      }
    }

    return $this;
  }
260125
function removeAllAttributes( DOMElement $element )
    {
        $attribs = $element->attributes;
        for ( $i = $attribs->length - 1; $i >= 0; $i-- )
        {
            $element->removeAttributeNode( $attribs->item( $i ) );
        }
    }
1018228
protected function takeAttributeFromDOM($attribute)
    {
        switch ($attribute->localName) {
        case 'errorCode':
            $this->_errorCode = $attribute->nodeValue;
            break;
        case 'reason':
            $this->_reason = $attribute->nodeValue;
            break;
        case 'invalidInput':
            $this->_invalidInput = $attribute->nodeValue;
            break;
        default:
            parent::takeAttributeFromDOM($attribute);
        }
    }
1342722
private function removeInvalidAttributes()
    {
        foreach ($this->getAttributes() as $attribute => $data)
        {
            if ( ! is_null($data) && ! is_scalar($data)) unset($this->{$attribute});
        }
    }