public function getElementValue($element_name, $reference_element = null)
    {
        $element_name = trim($element_name);
        if (empty($element_name)) {
            throw new \InvalidArgumentException('Element name must not be empty.');
        }

        if (null === $reference_element) {
            $reference_element = $this->documentElement;
        }

        if ($this->isEnvironautDocument()) {
            foreach ($reference_element->childNodes as $node) {
                if ($node->nodeType == XML_ELEMENT_NODE &&
                    $node->localName == $element_name &&
                    $node->namespaceURI == $this->documentElement->namespaceURI
                ) {
                    return $node->nodeValue;
                }
            }
        }

        return null;
    }
public function getElementValue($element_name, $reference_element = null)
    {
        $element_name = trim($element_name);
        if (empty($element_name)) {
            throw new \InvalidArgumentException('Element name must not be empty.');
        }

        if (null === $reference_element) {
            $reference_element = $this->documentElement;
        }

        if ($this->isEnvironautDocument()) {
            foreach ($reference_element->childNodes as $node) {
                if ($node->nodeType == XML_ELEMENT_NODE &&
                    $node->localName == $element_name &&
                    $node->namespaceURI == $this->documentElement->namespaceURI
                ) {
                    return $node->nodeValue;
                }
            }
        }

        return null;
    }
public function getElementValue ( $ element_name , $ reference_element = null ) { $ element_name = trim ( $ element_name ) ; if ( empty ( $ element_name ) ) { throw new \ InvalidArgumentException ( 'Element name must not be empty.' ) ; } if ( null === $ reference_element ) { $ reference_element = $ this -> documentElement ; } if ( $ this -> isEnvironautDocument ( ) ) { foreach ( $ reference_element -> childNodes as $ node ) { if ( $ node -> nodeType == XML_ELEMENT_NODE && $ node -> localName == $ element_name && $ node -> namespaceURI == $ this -> documentElement -> namespaceURI ) { return $ node -> nodeValue ; } } } return null ; }
Returns the nodeValue of the child element with the given name.

@param string $element_name name of child element
@param \DomElement $reference_element reference element for child node iteration, default to documentElement

@return mixed nodeValue or null if Environaut element with that name does not exist

@throws \InvalidArgumentException if name is empty
Returns the nodeValue of the child element with the given name .