SelectValues
@param string $xpath
@param IXmlNamespaceResolver $resolver
@param object $arg
@return IEnumerable<Object>
437801
public static function SelectValuesWithArgAndResolver( $xpath, $resolver, $arg )
	{
		/**
		 * @var XPath2NodeIterator $iter
		 */
		$iter = XPath2NodeIterator::Create( Compile( $xpath, $resolver )->EvaluateWithProperties( null, $arg ) );
		while ( $iter->MoveNext() )
			yield $iter->getCurrent()->GetTypedValue();
	}
1152032
public static String selectSingleNodeValue(Node node, String xpathQuery) {
        Node resultNode = node.selectSingleNode(xpathQuery);
        if (resultNode != null) {
            return resultNode.getText();
        } else {
            return null;
        }
    }
883177
public function select($field, $value = null)
    {
        $element = $this->resolver->resolveForSelection($field);

        $options = $element->findElements(WebDriverBy::cssSelector('option:not([disabled])'));

        if (is_null($value)) {
            $options[array_rand($options)]->click();
        } else {
            foreach ($options as $option) {
                if ((string) $option->getAttribute('value') === (string) $value) {
                    $option->click();

                    break;
                }
            }
        }

        return $this;
    }
841620
private function selectRadioOption($xpath, $value)
    {
        $name = $this->getAttribute($xpath, 'name');

        if (null !== $name) {
            $name = json_encode($name);
            $function = <<<JS
(function(){
    for (var i = 0; i < document.forms.length; i++) {
        if (document.forms[i].elements[{$name}]) {
            var form  = document.forms[i];
            var elements = form.elements[{$name}];
            for (var f = 0; f < elements.length; f++) {
                var item = elements[f];
                if ("{$value}" == item.value) {
                    item.checked = true;

                    var event;
                    if (document.createEvent) {
                        event = document.createEvent("HTMLEvents");
                        event.initEvent("change", true, true);
                    } else {
                        event = document.createEventObject();
                        event.eventType = "change";
                    }

                    event.eventName = "change";

                    if (document.createEvent) {
                        item.dispatchEvent(event);
                    } else {
                        item.fireEvent("on" + event.eventType, event);
                    }
                }
            }
        }
    }
})()
JS;

            $this->executeScript($function);
        }
    }
1334739
public function select( array $args = [], $implode = false )
	{
		$attributes = $this->parseAttributes( self::SELECT_ATTRIBUTES, $args );

		return $this->maybeImplode( $attributes, $implode );
	}
605791
public @Nonnull Stream<String> value(String xpath) {
        return select(xpath).map(XQuery::text);
    }
1049501
@SuppressWarnings("deprecation")
    static final void xalanExtensionAware(XPath xpath) {

        // Load xalan extensions thread-safely for all of jOOX
        if (!xalanExtensionLoaded) {
            synchronized (Util.class) {
                if (!xalanExtensionLoaded) {
                    xalanExtensionLoaded = true;

                    try {
                        xalanNamespaceContext = (NamespaceContext)
                            Class.forName("org.apache.xalan.extensions.ExtensionNamespaceContext").newInstance();

                        xalanFunctionResolver = (XPathFunctionResolver)
                            Class.forName("org.apache.xalan.extensions.XPathFunctionResolverImpl").newInstance();
                    }
                    catch (Exception ignore) {
                    }
                }
            }
        }

        if (xalanNamespaceContext != null && xalanFunctionResolver != null) {
            xpath.setNamespaceContext(xalanNamespaceContext);
            xpath.setXPathFunctionResolver(xalanFunctionResolver);
        }
    }
1108007
private function loadValues(\DOMXPath $xpath, \DOMNode $node, $keys, $prefix = '@')
    {
        $result = [];

        foreach ($keys as $key) {
            $result[$key] = $this->getValueFromXPath($prefix . $key, $xpath, $node);
        }

        return $result;
    }
688572
public static function argValue(ArgumentNode $arg, $default = null)
    {
        $valueNode = $arg->value;

        if (! $valueNode) {
            return $default;
        }

        return AST::valueFromASTUntyped($valueNode);
    }
1333254
public void setXPathVariableResolver(XPathVariableResolver resolver) {
        if ( resolver == null ) {
            String fmsg = XSLMessages.createXPATHMessage( 
                    XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
                    new Object[] {"XPathVariableResolver"} );
            throw new NullPointerException( fmsg );
        }
        this.variableResolver = resolver;
    }
983961
public static function Compile( $xpath, $resolver, $enableLogging = false )
	{
		if ( is_null( $xpath ) )
		{
			throw new \lyquidity\xml\exceptions\ArgumentNullException("$xpath");
		}

		if ( $xpath == "" )
		{
			throw XPath2Exception::withErrorCodeAndParam( "XPST0003", Resources::XPST0003, "Empty $xpath expression" );
		}

		/**
		 * @var XPath2Context $content
		 */
		$context = new XPath2Context( $resolver );

		/**
		 * @var Tokenizer $tokenizer
		 */
		$tokenizer = new Tokenizer( $xpath );

		/**
		 * @var XPath2Parser $parser
		 */
		$parser = new XPath2Parser( $context );
		if ( $enableLogging ) $parser->enableLogging();

		/**
		 * @var AbstractNode $exprTree
		 */
		$exprTree = $parser->yyparseSafe( $tokenizer );
		return new XPath2Expression( $xpath, $exprTree, $context );
	}
762408
public function handle(ArgumentValue $argumentValue): array
    {
        $definition = $argumentValue->getAstNode();

        $argumentType = $argumentValue->getType();

        $fieldArgument = [
            'name' => $argumentValue->getName(),
            'description' => data_get($definition->description, 'value'),
            'type' => $argumentType,
            'astNode' => $definition,
        ];

        if ($defaultValue = $definition->defaultValue) {
            $fieldArgument += [
                // webonyx/graphql-php expects the internal value here, whereas the
                // SDL uses the ENUM's name, so we run the conversion here
                'defaultValue' => $argumentType instanceof EnumType
                    ? $argumentType->getValue($defaultValue->value)->value
                    : AST::valueFromASTUntyped($defaultValue),
            ];
        }

        // Add any dynamically declared public properties of the FieldArgument
        $fieldArgument += get_object_vars($argumentValue);

        // Used to construct a FieldArgument class
        return $fieldArgument;
    }
374548
public function value($selector, $value = null)
    {
        if (is_null($value)) {
            return $this->resolver->findOrFail($selector)->getAttribute('value');
        }

        $selector = $this->resolver->format($selector);

        $this->driver->executeScript(
            "document.querySelector('{$selector}').value = '{$value}';"
        );

        return $this;
    }
994537
private function parseAggregationsProviders(\DOMXPath $xpath, \DOMNode $rootNode)
    {
        $providers = [];

        foreach ($xpath->query(self::AGGREGATIONS_PROVIDERS_PATH, $rootNode) as $providerNode) {
            $providers[$providerNode->getAttribute('name')] = $providerNode->nodeValue;
        }

        return $providers;
    }
1126120
@NotNull
    public static XPath createXPath(@Nullable final String... values) {
        final NamespaceContext context = new NamespaceContextMap(values);
        final XPath xPath = XPathFactory.newInstance().newXPath();
        xPath.setNamespaceContext(context);
        return xPath;
    }
425675
final public static function getEverythingFromArgs(\Enlight_Event_EventArgs $args, $element = null)
    {
        /**
         * @var \Enlight_Controller_Action $controller
         */
        $controller = $args->get('subject');

        /**
         * @var \Enlight_Controller_Request_Request $request
         */
        $request = $controller->Request();

        /**
         * @var \Enlight_View_Default $view
         */
        $view = $controller->View();

        $result = [
            'controller' => $controller,
            'request' => $request,
            'view' => $view
        ];

        if ($element !== null) {
            if (array_key_exists($element, $result)) {
                $result = $result[$element];
            } else {
                $result = null;
            }
        }

        return $result;
    }
1148764
public function findXPath(string $xpath): NodeList {
        $results = $this->newNodeList();

        if ($this->isRemoved()) {
            return $results;
        }

        $domxpath = new \DOMXPath($this->document());

        foreach ($this->collection() as $node) {
            $results = $results->merge(
                $node->newNodeList($domxpath->query($xpath, $node))
            );
        }

        return $results;
    }