Scan Attributes for the id attribute and maybe add a reference to
project.

@param object $target the element's object
@param array $attr the element's attributes
193249
public function configureId($target, $attr)
    {
        if (isset($attr['id']) && $attr['id'] !== null) {
            $this->project->addReference($attr['id'], $target);
        }
    }
495468
protected function copyElement(DOMElement $source, DOMElement $target)
	{
		if ($source->hasAttributes())
		{
			$attributes = $source->attributes;
			if (!is_null($attributes))
			{
				foreach ($attributes as $attr)
				{
					$target->setAttribute($attr->name, $attr->value);
				}
			}
		}

		foreach ($source->childNodes as $child)
		{
			$target->appendChild($child->cloneNode(true));
		}
	}
1364796
public function attribute($attr, $value = '')
    {
        if (is_array($attr)) {
            foreach ($attr as $key => $value) {
                $this->attribute($key, $value);
            }
        } else {
            $this->attributes[$attr] = $value;
        }

        return $this;
    }
157620
public function addOrReplaceTarget($targetName, &$target)
    {
        $this->log("  +Target: $targetName", Project::MSG_DEBUG);
        $target->setProject($this);
        $this->targets[$targetName] = $target;

        $ctx = $this->getReference(ProjectConfigurator::PARSING_CONTEXT_REFERENCE);
        $current = $ctx->getCurrentTargets();
        $current[$targetName] = $target;
    }
102607
public function set_attribute($attr, $value = null)
	{
		$attr = is_array($attr) ? $attr : array($attr => $value);
		foreach ($attr as $key => $value)
		{
			if ($value === null)
			{
				unset($this->attributes[$key]);
			}
			else
			{
				$this->attributes[$key] = $value;
			}
		}

		return $this;
	}
782299
protected function setLinkAttributes(Tag $tag, $linkInfo, $attrName)
	{
		$url   = trim($linkInfo);
		$title = '';
		$pos   = strpos($url, ' ');
		if ($pos !== false)
		{
			$title = substr(trim(substr($url, $pos)), 1, -1);
			$url   = substr($url, 0, $pos);
		}

		$tag->setAttribute($attrName, $this->text->decode($url));
		if ($title > '')
		{
			$tag->setAttribute('title', $this->text->decode($title));
		}
	}
874460
public function setAttribute($attr, $value)
    {
        switch($attr)
        {
        case \PDO::ATTR_AUTOCOMMIT:
            $this->_autocommit = (is_bool($value) && $value) || in_array(strtolower($value), array("on", "true"));
            return;
        case \PDO::ATTR_CASE:
            $this->_case = $value;
            return;
        }
    }
1107092
public function getAttributeValue($attr, &$request = null) {
        $url = "entities/{$this->_id}/attrs/$attr/value";

        if ($this->_type) {
            $url .= "?type={$this->_type}";
        }

        return $this->_orion->get($url, $request, "text/plain","text/plain");
    }
606189
function applyAttributesToTarget( source, target ) {
    var attName, attValue;
    for ( attName in source ) {
        if ( module.exports.isLinkable( target, attName ) ) {
            attValue = source[ attName ];
            target[ attName ] = attValue;
        }
    }
}
1057249
public function asLink($href=NULL,$target=NULL) {
		if (isset($href)) {
			$_target="";
			if(isset($target))
				$_target="target='{$target}'";
			$this->wrap("<a href='" . $href . "' {$_target}>", "</a>");
		}
		return $this->addToProperty("class", "link");
	}
1341630
protected static Accessor findGetter(Object target, String attr_name) {
        final String name=Util.attributeNameToMethodName(attr_name);
        Class<?> clazz=target.getClass();
        Method   method=Util.findMethod(target, Arrays.asList("get" + name, "is" + name, toLowerCase(name)));

        if(method != null && (isGetMethod(method) || isIsMethod(method)))
            return new MethodAccessor(method, target);


         // 4. Find a field last_name
        Field field=Util.getField(clazz, attr_name);
        if(field != null)
            return new FieldAccessor(field, target);

        return new NoopAccessor();
    }
425020
private static function getAttributes($attr)
    {
        $html = "";
        foreach ($attr as $key => $value) {
            $html .= $key . '="' . $value . '" ';
        }

        return $html;
    }
198108
private function setVarStartHandler(array $attrs): void
    {
        if (empty($attrs['name'])) {
            throw new DomainException('REPORT ERROR var: The attribute "name" is missing or not set in the XML file');
        }

        $name  = $attrs['name'];
        $value = $attrs['value'];
        $match = [];
        // Current GEDCOM record strings
        if ($value === '@ID') {
            if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
                $value = $match[1];
            }
        } elseif ($value === '@fact') {
            $value = $this->fact;
        } elseif ($value === '@desc') {
            $value = $this->desc;
        } elseif ($value === '@generation') {
            $value = (string) $this->generation;
        } elseif (preg_match("/@(\w+)/", $value, $match)) {
            $gmatch = [];
            if (preg_match("/\d $match[1] (.+)/", $this->gedrec, $gmatch)) {
                $value = str_replace('@', '', trim($gmatch[1]));
            }
        }
        if (preg_match("/\\$(\w+)/", $name, $match)) {
            $name = $this->vars["'" . $match[1] . "'"]['id'];
        }
        $count = preg_match_all("/\\$(\w+)/", $value, $match, PREG_SET_ORDER);
        $i     = 0;
        while ($i < $count) {
            $t     = $this->vars[$match[$i][1]]['id'];
            $value = preg_replace('/\$' . $match[$i][1] . '/', $t, $value, 1);
            $i++;
        }
        if (preg_match('/^I18N::number\((.+)\)$/', $value, $match)) {
            $value = I18N::number((int) $match[1]);
        } elseif (preg_match('/^I18N::translate\(\'(.+)\'\)$/', $value, $match)) {
            $value = I18N::translate($match[1]);
        } elseif (preg_match('/^I18N::translateContext\(\'(.+)\', *\'(.+)\'\)$/', $value, $match)) {
            $value = I18N::translateContext($match[1], $match[2]);
        }

        // Arithmetic functions
        if (preg_match("/(\d+)\s*([\-\+\*\/])\s*(\d+)/", $value, $match)) {
            // Create an expression language with the functions used by our reports.
            $expression_provider  = new ReportExpressionLanguageProvider();
            $expression_cache     = new NullAdapter();
            $expression_language  = new ExpressionLanguage($expression_cache, [$expression_provider]);

            $value = (string) $expression_language->evaluate($value);
        }

        if (strpos($value, '@') !== false) {
            $value = '';
        }
        $this->vars[$name]['id'] = $value;
    }
1030619
public function addAttributes(array $attr)
    {
        foreach ($attr as $name => $value) {
            $this->setAttribute($name, $value);
        }

        return $this;
    }
1304864
private void parseAttribute(final Attributes atts) {
        final URI attrValue = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
        if (attrValue == null) {
            return;
        }

        final String attrScope = atts.getValue(ATTRIBUTE_NAME_SCOPE);
        if (isExternal(attrValue, attrScope)) {
            return;
        }

        String attrFormat = atts.getValue(ATTRIBUTE_NAME_FORMAT);
        if (attrFormat == null || ATTR_FORMAT_VALUE_DITA.equals(attrFormat)) {
            final File target = toFile(attrValue);
            topicHref = target.isAbsolute() ? attrValue : currentDir.resolve(attrValue);

            if (attrValue.getFragment() != null) {
                topicId = attrValue.getFragment();
            } else {
                if (attrFormat == null || attrFormat.equals(ATTR_FORMAT_VALUE_DITA) || attrFormat.equals(ATTR_FORMAT_VALUE_DITAMAP)) {
                    topicId = topicHref + QUESTION;
                }
            }
        } else {
            topicHref = null;
            topicId = null;
        }
    }
1177233
public void addAttribute(Attribute attr) {
        if (attr instanceof SourceFileAttr) {
            if (mSource != null) {
                mAttributes.remove(mSource);
            }
            mSource = (SourceFileAttr)attr;
        }
        else if (attr instanceof InnerClassesAttr) {
            if (mInnerClassesAttr != null) {
                mAttributes.remove(mInnerClassesAttr);
            }
            mInnerClassesAttr = (InnerClassesAttr)attr;
        }

        mAttributes.add(attr);
    }
52813
private function _changedAttribute($attr) 
    {
        preg_match('/(\w+)_(change|changed|was)$/', $attr, $matches);
        if (sizeof($matches) < 1) {
            return null;
        }

        $attr = $matches[1];
        $meth = $matches[2];
        $cur  = $this->get($attr);
        $old  = $this->get($attr, false);

        if ($meth == "was") {
            return $old;
        }
        if ($meth == "changed") {
            return $cur!=$old;
        }
        if ($meth == "change") {
            return array($old, $cur);
        }
        return null;
    }