Retrieve attribute visibility

@param \DOMElement $element
@return type
183512
public function retriveAttributeVisibility(\DOMElement $element)
    {
        $name = $this->engine->query($element->getNodePath() . '/dia:attribute[@name="visibility"]/dia:enum');
        $propertyVisibility = $name->item(0)->attributes->getNamedItem('val')->nodeValue;

        return self::$propertyVisibilityTypes[$propertyVisibility];
    }
346204
protected function cleanHrefs(\DOMElement $element)
    {
        $href = $element->getAttribute('href');
        if (preg_match(self::SCRIPT_REGEX, $href) === 1) {
            $element->removeAttribute('href');
            $this->xmlIssues[] = array(
                'message' => 'Suspicious attribute \'href\'',
                'line' => $element->getLineNo(),
            );
        }
    }
1170332
private function getValue(\DOMElement $node)
    {
        $value = $node->nodeValue;

        if ('boolean' === $type = $node->getAttribute('type')) {
            return 'true' === $value;
        }

        settype($value, $type);

        return $value;
    }
290334
public function parseElement(Node $parent, \DOMElement $element)
    {
        if (Atom::NS !== $element->namespaceURI) {
            return null;
        }

        $name = 'atom:' . $element->localName;
        if (array_key_exists($name, $this->elementMap)) {
            $class = $this->elementMap[$name];

            return new $class($parent, $element);
        }

        return null;
    }
449145
public function getSpecification($element = '')
    {
        if (isset($element) && $element !== '') {
            $spec = $this->pattern->specification[$this->getOption('doctype')][$element];
        } else {
            $spec = $this->pattern->specification[$this->getOption('doctype')];
        }
        return $spec;
    }
223302
public static function innerXML(DOMElement $element)
	{
		// Serialize the XML then remove the outer element
		$xml = $element->ownerDocument->saveXML($element);
		$pos = 1 + strpos($xml, '>');
		$len = strrpos($xml, '<') - $pos;

		// If the template is empty, return an empty string
		return ($len < 1) ? '' : substr($xml, $pos, $len);
	}
1366555
public function formTextarea(IElement $element)
    {
        $attributes = $this->buildAttributes($element->getAttributes());

        return '<textarea ' . $attributes . '>' . $element->getValue() . '</textarea>';
    }
1062538
protected function unmarshall(DOMElement $element)
    {
        $mapEntriesElts = $this->getChildElementsByTagName($element, 'mapEntry');
        $mapEntries = new MapEntryCollection();

        foreach ($mapEntriesElts as $mapEntryElt) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($mapEntryElt, array($this->getBaseType()));
            $mapEntries[] = $marshaller->unmarshall($mapEntryElt);
        }

        try {
            $object = new Mapping($mapEntries);

            if (($defaultValue = $this->getDOMElementAttributeAs($element, 'defaultValue', 'float')) !== null) {
                $object->setDefaultValue($defaultValue);
            }

            if (($lowerBound = $this->getDOMElementAttributeAs($element, 'lowerBound', 'float')) !== null) {
                $object->setLowerBound($lowerBound);
            }

            if (($upperBound = $this->getDOMElementAttributeAs($element, 'upperBound', 'float')) !== null) {
                $object->setUpperBound($upperBound);
            }

            return $object;
        } catch (InvalidArgumentException $e) {
            $msg = "A 'mapping' element must contain at least one 'mapEntry' element. None found";
            throw new UnmarshallingException($msg, $element, $e);
        }
    }
470661
public function getType()
    {
        $type = null;
        if (($parent = $this->getParent()) instanceof ElementHandler && $parent->hasAttribute(self::ATTRIBUTE_TYPE)) {
            $type = $parent->getAttribute(self::ATTRIBUTE_TYPE)->getValue(false, false);
        }
        return $type;
    }
1317622
protected function getPropertyHtmlValue(\DOMElement $element)
    {
        $tagName = strtoupper($element->tagName);

        // Map to an attribute (if applicable)
        if (array_key_exists($tagName, self::$tagNameAttributes)) {
            $value = strval($element->getAttribute(self::$tagNameAttributes[$tagName]));
            return (($tagName != 'TIME') || strlen($value)) ? $value : null;
        }

        return null;
    }
968417
public static function setDOMElementAttribute(DOMElement $element, $attribute, $value)
    {
        switch (gettype($value)) {
            case 'boolean':
                $element->setAttribute($attribute, ($value === true) ? 'true' : 'false');
                break;
            
            default:
                $element->setAttribute($attribute, '' . $value);
                break;
        }
    }
446169
protected function unmarshall(DOMElement $element)
    {
        if (($identifiers = $this->getDOMElementAttributeAs($element, 'identifiers')) !== null) {
            $identifiers = explode("\x20", $identifiers);
            $component = new ShufflingGroup(new IdentifierCollection($identifiers));
            
            if (($fixedIdentifiers = $this->getDOMElementAttributeAs($element, 'fixedIdentifiers')) !== null) {
                $fixedIdentifiers = explode("\x20", $fixedIdentifiers);
                $component->setFixedIdentifiers(new IdentifierCollection($fixedIdentifiers));
            }

            return $component;
        } else {
            $msg = "The mandatory attribute 'identifiers' is missing from element '" . $element->localName . "'.";
            throw new UnmarshallingException($msg, $element);
        }
    }
257994
protected function getElementAttribute(DomElement $element, $attributeName)
    {
        // First try to return for link
        if ($element->localName === 'link') {
            return $element->getAttribute($attributeName);
        }

        // Second return for embed
        return $element->getAttribute(EmbedLinking::TEMP_PREFIX . $attributeName);
    }
215423
protected function prepareElement($element)
    {
        $options    = $this->getOptions();
        $currClass  = $element->getAttribute('class');
        $class      = $currClass . (null !== $currClass ? ' ' : '') . $options['class'];

        $element->setAttributes(array(
            'class'             => $class,
            'data-color'        => $options['color'],
            'data-color-format' => $options['format'],
        ));

        return $element;
    }
8857
protected function weightAttribute(\DOMElement $element, $attribute)
    {
        if (!$element->hasAttribute($attribute)) {
            return 0;
        }
        $weight = 0;

        // $attributeValue = trim($element->getAttribute('class')." ".$element->getAttribute('id'));
        $attributeValue = trim($element->getAttribute($attribute));

        if ('' !== $attributeValue) {
            if (preg_match($this->regexps['negative'], $attributeValue)) {
                $weight -= 25;
            }
            if (preg_match($this->regexps['positive'], $attributeValue)) {
                $weight += 25;
            }
            if (preg_match($this->regexps['unlikelyCandidates'], $attributeValue)) {
                $weight -= 5;
            }
            if (preg_match($this->regexps['okMaybeItsACandidate'], $attributeValue)) {
                $weight += 5;
            }
        }

        return $weight;
    }
1150676
function getElementType($element)
     {
         if (isset($this->_elementIndex[$element])) {
             return $this->_elements[$this->_elementIndex[$element]]->getType();
         }
         return false;
     }
263336
protected function addRelAttribute(DOMElement $element)
	{
		$rel = $element->getAttribute('rel');
		if (preg_match('(\\S$)', $rel))
		{
			$rel .= ' ';
		}
		$rel .= 'noreferrer';

		$element->setAttribute('rel', $rel);
	}