Finds the first element with given tag name.

@param string $tagName The tag name
@return \DOMElement|false
764563
public function findFirstTag($tagName)
    {
        $nodes = $this->findTags($tagName);

        return $nodes->length > 0 ? $nodes->item(0) : false;
    }
804515
protected function getNodePropertyByTagName(\DOMElement $node, $tagName, $propertyName)
    {
        $values = array();
        $results = $node->getElementsByTagName($tagName);
        if ($results->length) {
            foreach ($results as $result) {
                if ($result->getAttribute($propertyName)) {
                    $values[] = $result->getAttribute($propertyName);
                }
            }
        }

        return $values;
    }
281228
def getFirstChildElementByTagName(self, tagName):
    
    for child in self.childNodes:
        if isinstance(child, Element):
            if child.tagName == tagName:
                return child
    return None
503109
public function getPropertyByTagName($tagName, $highest = true)
    {
        $properties = $this->getPropertiesByTagName($tagName);

        if (!$properties) {
            throw new \InvalidArgumentException(
                sprintf(
                    'No property with tag "%s" exists. In structure "%s" loaded from "%s"',
                    $tagName,
                    $this->name,
                    $this->resource
                )
            );
        }

        return reset($properties);
    }
105286
public function getElementByTagName($tagName)
    {
        if (null === $this->treeRoot){
            return array();
        }
        $children = $this->treeRoot->getChildren();

        return $this->getElementByTagInChildren($children, $tagName);
    }
1062
public function tagsByName($name)
    {
        $tags = array();
        foreach ($this->tags() as $tag) {
            if ($name === $tag->name()) {
                $tags[] = $tag;
            }
        }

        return $tags;
    }
1203707
public static function get($node, $tagName, $count = 1) {
        $node = $node->{$tagName};
        if ($node->count() !== $count)
            throw new XmlParserException("xml does not have exactly $count $tagName's");
        return $node[0];
    }
1056103
public function getTag($tag)
    {
        return isset($this->tags[$tag]) ? $this->tags[$tag] : null;
    }
334798
public function getTagValues($tagName)
    {
        if (!$this->isTaggedWith($tagName)) {
            throw new \RuntimeException('Tag "' . $tagName . '" does not exist.', 1169128255);
        }
        return $this->tags[$tagName];
    }
878397
@SuppressWarnings("unchecked")
    private <T extends DomElement> List<T> allByTagName(String tagName) {
        return (List<T>) htmlPage.getElementsByTagName(tagName);
    }
635545
static function fetchByTag( $tagName, $cacheInfoList = false )
    {
        if ( !$cacheInfoList )
            $cacheInfoList = eZCache::fetchList();

        $cacheEntries = array();
        $tagList = explode( ',', $tagName );
        foreach ( $cacheInfoList as $cacheInfo )
        {
            if ( !is_array( $cacheInfo['tag'] ) )
                continue;

            $matchingTags = array_intersect( $tagList, $cacheInfo['tag'] );
            if ( !empty( $matchingTags ) )
                $cacheEntries[] = $cacheInfo;
        }

        return $cacheEntries;
    }
637572
protected function &findButton($elementname) {
        $form = $this->_form;
        $buttonar =& $form->getElement('buttonar');
        $elements =& $buttonar->getElements();
        foreach ($elements as $el) {
            if ($el->getName() == $elementname) {
                return $el;
            }
        }
        return null;
    }
817137
protected function _findFirst(int $tag)
    {
        foreach ($this->_names as $name) {
            if ($name->tag() == $tag) {
                return $name;
            }
        }
        return null;
    }
1319735
public function getElementType($elementName)
	{
		if( $this->settingExists($elementName) ? $type = $this->getSetting($elementName, 'type') : false )
		{
			return (string)$type;
		}
		return 'string';
	}
1280535
private function getTagDate($tagName)
    {
        /** @var \Platformsh\Cli\Service\Git $git */
        $git = $this->getService('git');
        $date = $git->execute(['log', '-1', '--format=%aI', 'refs/tags/' . $tagName]);

        return is_string($date) ? strtotime(trim($date)) : false;
    }
63922
public function findLastIndex(string $tagName) : int
    {
        $tags = $this->asArray();
        return ArrayUtils::lastIndexOf($tags, function (Tag $tag) use ($tagName) {
            return $tag->getTagName() === $tagName;
        });
    }
226908
public function findElementByName( $name ) {
		$elt = $this->tail;
		while ( $elt && !( $elt instanceof Marker ) ) {
			if ( $elt->htmlName === $name ) {
				return $elt;
			}
			$elt = $elt->prevAFE;
		}
		return null;
	}