@param NodeElement $oSelect
@param int         $iIndex

@return string
323391
protected function _getSelectOptionByIndex($oSelect, $iIndex)
    {
        $oOptions = $oSelect->findAll('css', "option");
        foreach ($oOptions as $iKey => $oOption) {
            /** @var \Behat\Mink\Element\NodeElement $oOption  */
            if ($iIndex == $iKey) {
                return $oOption->getValue();
            }
        }

        return $oOption ? $oOption->getValue() : "";
    }
646725
private static function _getSelectTreeChildren(&$target,$pId,$source,$idField,$pidField,$titleField,$separator,$prefix,$level,$currentLevel)
    {
        if($level<0){
            $level=9999;
        }
        if($currentLevel>$level){
            return;
        }
        $sep="";
        for($i=0;$i<$currentLevel;$i++){
            $sep.=$separator;
        }
        foreach ($source as $item){
            $_pid=$item[$pidField];
            if($_pid==$pId){
                $id=$item[$idField];
                $title=$sep.$prefix.$item[$titleField];
                $target[$id]=$title;
                self::_getSelectTreeChildren($target,$id,$source,$idField,$pidField,$titleField,$separator,$prefix,$level,$currentLevel+1);

            }
        }
    }
112478
function(nIndex) {
            var ePanelNode = this._panels[nIndex];
            if(!ePanelNode) {return false;} // invalid node
            if(YUD.hasClass(ePanelNode.firstChild, this.CLASSES.ACTIVE)) {return false;} // already open
            this._onClick(ePanelNode.firstChild);
            return true;
        }
727492
public function generateCoreSelectorMenuUsingPageTree(string $uriToRedirectTo = null)
    {
        if ($this->selectedPageUID < 1 || null === $this->selectedSite) {
            return;
        }

        if ($this->view instanceof NotFoundView) {
            $this->initializeSelectedSolrCoreConnection();
            return;
        }

        $this->generateCoreSelectorMenu($this->selectedSite, $uriToRedirectTo);
    }
953590
public function find(int $iId)
    {
        $oSelect = $this->oConnector->prepare('SELECT * FROM sked_events WHERE id = :id');
        if (!$oSelect->execute([':id' => $iId]))
            throw new \Exception(__METHOD__ . ' - ' . $oSelect->errorInfo()[2]);
        return $oSelect->fetch(\PDO::FETCH_ASSOC);
    }
1357806
public function find($selector, $idx=null, $lowercase=false)
	{
		return $this->root->find($selector, $idx, $lowercase);
	}
405685
public static function array2XML($haystack, $rootElementName = '')
    {
        $args   = func_get_args();
        $isRoot = !isset($args[2]);
        $root   = isset($args[3]) ? $args[3] : new \DOMDocument('1.0', 'utf-8');
        $parent = isset($args[2]) ? $args[2] : ($rootElementName !== '' ? $root->createElement($rootElementName)
                    : null);

        foreach ($haystack as $key => $val) {
            if (is_array($val)) {
                $parent = $root->createElement($key);
                self::array2xml($val, $rootElementName, $parent, $root);
            } elseif ($parent === null) {
                $parent = $root->createElement($key, $val);
            } else {
                $parent->appendChild($root->createElement($key, $val));
            }
        }
        if ($isRoot && $parent !== null) {
            $root->appendChild($parent);
        }

        return $root;
    }
886010
public function getRequestXml(&$docRootXpath, &$docIdXpath, &$envelopeParams, $resetDocIds) {
        unset($this->_requestDom);
        $this->_requestDom = new DomDocument('1.0', 'utf-8');
        $root = $this->_requestDom->createElementNS('www.clusterpoint.com', 'cps:request');
        $this->_requestDom->appendChild($root);

        // envelope parameters first
        foreach ($envelopeParams as $name => $value) {
					if($value) {
            $root->appendChild($this->_requestDom->createElement('cps:' . $name , $this->getValidXmlValue($value)));
        	}
				}
        $contentTag = $root->appendChild($this->_requestDom->createElement('cps:content'));

        // content tag text parameters
        foreach ($this->_textParams as $name => $values) {
            if (!is_array($values)) {
                $values[0] = $values;
            }
            foreach ($values as $value) {
                $contentTag->appendChild($this->_requestDom->createElement($name , $this->getValidXmlValue($value)));
            }
        }

        // special fields: query, list, ordering
        foreach ($this->_rawParams as $name => $values) {
            if (!is_array($values)) {
                $values[0] = $values;
            }
            foreach ($values as $value) {
                $fragment = $this->_requestDom->createDocumentFragment();
                $fragment->appendXML('<' . $name . ' xmlns:cps="www.clusterpoint.com">' . $value . '</' . $name . '>');
                $contentTag->appendChild($fragment);
            }
        }

        if (!is_null($this->_changesets)) {
            $xmlContent = '';
            if (count($this->_changesets) > 1) {
                foreach ($this->_changesets as $cs) {
                    $xmlContent .= '<cps:changeset>';
                    $xmlContent .= $cs->renderXML($docRootXpath, $docIdXpath, $this);
                    $xmlContent .= '</cps:changeset>';
                }
            } else if (count($this->_changesets) == 1) {
                $xmlContent .= $this->_changesets[0]->renderXML($docRootXpath, $docIdXpath, $this);
            }
            if (strlen($xmlContent) > 0) {
                $tmpDoc = new DOMDocument();
                $tmpDoc->loadXML('<fakedoc xmlns:cps="www.clusterpoint.com">' . $xmlContent . '</fakedoc>');
                foreach ($tmpDoc->documentElement->childNodes as $child) {
                    $domNode2 = $this->_requestDom->importNode($child, true);
                    $contentTag->appendChild($domNode2);
                }
            }
        }

        // extra XML content
        if (!is_null($this->_extraXmlParam)) {
            $tmpDoc = new DOMDocument();
            if (!@$tmpDoc->loadXML('<fakedoc xmlns:cps="www.clusterpoint.com">' . $this->_extraXmlParam . '</fakedoc>')) {
                throw new CPS_Exception(array(array('long_message' => 'Invalid request parameter - unable to parse XML', 'code' => ERROR_CODE_INVALID_PARAMETER, 'level' => 'REJECTED', 'source' => 'CPS_API')));
            }
            foreach ($tmpDoc->documentElement->childNodes as $child) {
                $domNode2 = $this->_requestDom->importNode($child, true);
                $contentTag->appendChild($domNode2);
            }
        }

        // documents, document IDs
        foreach ($this->_documents as $id => $doc) {
            $subdoc = new DOMDocument();
            $subroot = NULL;
            $loadForEach = false;
            if (is_string($doc)) {
                $res = @$subdoc->loadXML($doc);
                if ($res === FALSE) {
                    throw new CPS_Exception(array(array('long_message' => 'Invalid request parameter - unable to parse XML', 'code' => ERROR_CODE_INVALID_PARAMETER, 'level' => 'REJECTED', 'source' => 'CPS_API')));
                }
            } else if (is_array($doc)) {
                // associative array
                $loadForEach = true;
            } else if (is_object($doc)) {
                if ($doc instanceof SimpleXMLElement) {
                    // SimpleXML
                    $loadForEach = true;
                } else if ($doc instanceof DOMNode) {
                    // DOM
                    $subdoc = $doc;
                } else if ($doc instanceof stdClass) {
                    // stdClass
                    $loadForEach = true;
                } else {
                    throw new CPS_Exception(array(array('long_message' => 'Invalid request parameter', 'code' => ERROR_CODE_INVALID_PARAMETER, 'level' => 'REJECTED', 'source' => 'CPS_API')));
                }
            } else if (is_null($doc)) {
                // just document IDs - no doc integration required
            } else {
                throw new CPS_Exception(array(array('long_message' => 'Invalid request parameter', 'code' => ERROR_CODE_INVALID_PARAMETER, 'level' => 'REJECTED', 'source' => 'CPS_API')));
            }

            if (!($subroot = $subdoc->documentElement)) {
                $subroot = $subdoc->createElement($docRootXpath);
                $subdoc->appendChild($subroot);
            }

            if ($loadForEach) {
                CPS_Request::_loadIntoDom($subdoc, $subroot, $doc);
            }

            if ($resetDocIds) {
                // integrating ID into the document
                CPS_Request::_setDocId($subdoc, $subroot, $id, $docIdXpath);
            }

            //importing subdoc
            $reqNode = $this->_requestDom->importNode($subdoc->documentElement, true);
            $contentTag->appendChild($reqNode);
        }
        $xml = $this->_requestDom->saveXML();
        unset($this->_requestDom);
        return $xml;
    }
1060010
protected function _getElementByIdOrName($sSelector)
    {
        $sSelector = str_replace(array('name=', 'id='), array('', ''), $sSelector);

        if (strpos($sSelector, '.') || strpos($sSelector, '[')) {
            $oElement = $this->_getElementByIdOrNameXpath($sSelector);
        } else {
            $oElement = $this->_getElementByIdOrNameCSS($sSelector);
        }

        return $oElement;
    }
607580
@Override
    public INodeDesc getNodeDesc() {
        if (null==nodedesc) {
            nodedesc = NodeEntryImpl.create(getFrameworkNodeHostname(), getFrameworkNodeName());
        }
        return nodedesc;
    }
301889
protected static function getName( ElementInterface $element )
    {
        $name = $element->getName();

        if ( $name === null || $name === '' )
        {
            throw new Exception\DomainException( sprintf(
                '%s requires that the element has an assigned name; none discovered',
                __METHOD__
            ) );
        }

        return $name . '[]';
    }
781513
private void addInstSelect(final Select _select, final AbstractDataElement<?> _element, final Object _attrOrClass,
                               final Type _currentType)
        throws CacheReloadException
    {
        if (StringUtils.isNotEmpty(_element.getPath()) && !this.instSelects.containsKey(_element.getPath())) {
            final Select instSelect = Select.get();
            for (final AbstractElement<?> selectTmp : _select.getElements()) {
                if (!selectTmp.equals(_element)) {
                    if (selectTmp instanceof LinktoElement) {
                        instSelect.addElement(new LinktoElement().setAttribute(((LinktoElement) selectTmp)
                                        .getAttribute()));
                    } else if (selectTmp instanceof LinkfromElement) {
                        instSelect.addElement(new LinkfromElement().setAttribute(((LinkfromElement) selectTmp)
                                        .getAttribute()).setStartType(((LinkfromElement) selectTmp).getStartType()));
                    } else if (selectTmp instanceof ClassElement) {
                        instSelect.addElement(new ClassElement()
                                        .setClassification(((ClassElement) selectTmp).getClassification())
                                        .setType(((ClassElement) selectTmp).getType()));
                    } else if (selectTmp instanceof AttributeSetElement) {
                        instSelect.addElement(new AttributeSetElement()
                                        .setAttributeSet(((AttributeSetElement) selectTmp).getAttributeSet())
                                        .setType(((ClassElement) selectTmp).getType()));
                    }
                }
            }
            if (_element instanceof LinkfromElement) {
                instSelect.addElement(new LinkfromElement().setAttribute((Attribute) _attrOrClass).setStartType(
                                _currentType));
                instSelect.addElement(new InstanceElement(((Attribute) _attrOrClass).getParent()));
            } else if (_element instanceof LinktoElement) {
                instSelect.addElement(new LinktoElement().setAttribute((Attribute) _attrOrClass));
                instSelect.addElement(new InstanceElement(_currentType));
            } else if (_element instanceof ClassElement) {
                instSelect.addElement(new ClassElement().setClassification((Classification) _attrOrClass)
                                .setType(_currentType));
                instSelect.addElement(new InstanceElement((Type) _attrOrClass));
            } else if (_element instanceof AttributeSetElement) {
                instSelect.addElement(new AttributeSetElement().setAttributeSet((AttributeSet) _attrOrClass)
                                .setType(_currentType));
                instSelect.addElement(new InstanceElement((Type) _attrOrClass));
            }
            this.instSelects.put(_element.getPath(), instSelect);
        }
    }
1140959
private void generateElement(final INodeReadTrx paramRtx) throws TTIOException {
        final AttributesImpl atts = new AttributesImpl();
        final long key = paramRtx.getNode().getDataKey();

        try {
            // Process namespace nodes.
            for (int i = 0, namesCount = ((ElementNode)paramRtx.getNode()).getNamespaceCount(); i < namesCount; i++) {
                paramRtx.moveToNamespace(i);
                final QName qName = paramRtx.getQNameOfCurrentNode();
                mContHandler.startPrefixMapping(qName.getPrefix(), qName.getNamespaceURI());
                final String mURI = qName.getNamespaceURI();
                if (qName.getLocalPart().length() == 0) {
                    atts.addAttribute(mURI, "xmlns", "xmlns", "CDATA", mURI);
                } else {
                    atts.addAttribute(mURI, "xmlns", "xmlns:"
                        + paramRtx.getQNameOfCurrentNode().getLocalPart(), "CDATA", mURI);
                }
                paramRtx.moveTo(key);
            }

            // Process attributes.
            for (int i = 0, attCount = ((ElementNode)paramRtx.getNode()).getAttributeCount(); i < attCount; i++) {
                paramRtx.moveToAttribute(i);
                final QName qName = paramRtx.getQNameOfCurrentNode();
                final String mURI = qName.getNamespaceURI();
                atts.addAttribute(mURI, qName.getLocalPart(), NodeWriteTrx.buildName(qName), paramRtx
                    .getTypeOfCurrentNode(), paramRtx.getValueOfCurrentNode());
                paramRtx.moveTo(key);
            }

            // Create SAX events.
            final QName qName = paramRtx.getQNameOfCurrentNode();
            mContHandler.startElement(qName.getNamespaceURI(), qName.getLocalPart(), NodeWriteTrx
                .buildName(qName), atts);

            // Empty elements.
            if (!((ElementNode)paramRtx.getNode()).hasFirstChild()) {
                mContHandler.endElement(qName.getNamespaceURI(), qName.getLocalPart(), NodeWriteTrx
                    .buildName(qName));
            }
        } catch (final SAXException exc) {
            exc.printStackTrace();
        }
    }
1066785
protected function byIndex($index, $select = true)
    {
        $elements = $this->getRelatedElements();
        if (!isset($elements[$index])) {
            throw new NoSuchElementException(sprintf('Cannot locate %s with index: %d', $this->type, $index));
        }

        $select ? $this->selectOption($elements[$index]) : $this->deselectOption($elements[$index]);
    }
1121024
public static function getFieldSetByIndexSelector($formName, $fieldSetIndex)
    {
        $formSelector = static::getFormByNameSelector($formName);

        if (empty($formSelector) || 0 > $fieldSetIndex) {
            return '';
        }

        return sprintf('%s fieldset:nth-of-type(%d)', $formSelector, $fieldSetIndex);
    }
155408
public function convert(DOMDocument $xmlDoc)
    {
        $xpath = new DOMXPath($xmlDoc);

        $elements = $xpath->query('//link|//embed|//embed-inline');

        /** @var \DOMElement $element */
        foreach ($elements as $element) {
            $location = null;

            if ($this->elementHasAttribute($element, 'object_id')) {
                try {
                    $contentInfo = $this->contentService->loadContentInfo(
                        $this->getElementAttribute($element, 'object_id')
                    );
                    $location = $this->locationService->loadLocation($contentInfo->mainLocationId);
                } catch (APINotFoundException $e) {
                    if ($this->logger) {
                        $this->logger->warning(
                            'While generating links for xmltext, could not locate ' .
                            'Content object with ID ' . $this->getElementAttribute($element, 'object_id')
                        );
                    }
                } catch (APIUnauthorizedException $e) {
                    if ($this->logger) {
                        $this->logger->notice(
                            'While generating links for xmltext, unauthorized to load ' .
                            'Content object with ID ' . $this->getElementAttribute($element, 'object_id')
                        );
                    }
                }
            }

            if ($this->elementHasAttribute($element, 'node_id')) {
                try {
                    $location = $this->locationService->loadLocation(
                        $this->getElementAttribute($element, 'node_id')
                    );
                } catch (APINotFoundException $e) {
                    if ($this->logger) {
                        $this->logger->warning(
                            'While generating links for xmltext, could not locate ' .
                            'Location with ID ' . $this->getElementAttribute($element, 'node_id')
                        );
                    }
                } catch (APIUnauthorizedException $e) {
                    if ($this->logger) {
                        $this->logger->notice(
                            'While generating links for xmltext, unauthorized to load ' .
                            'Location with ID ' . $this->getElementAttribute($element, 'node_id')
                        );
                    }
                }
            }

            if ($location !== null) {
                $element->setAttribute('url', $this->urlAliasRouter->generate($location));
            }

            // Copy temporary URL if it exists and is not set at this point
            if (!$element->hasAttribute('url') && $element->hasAttribute(EmbedLinking::TEMP_PREFIX . 'url')) {
                $element->setAttribute('url', $element->getAttribute(EmbedLinking::TEMP_PREFIX . 'url'));
            }

            if ($this->elementHasAttribute($element, 'anchor_name')) {
                $anchor = '#' . $this->getElementAttribute($element, 'anchor_name');
                if (strpos($element->getAttribute('url'), $anchor) === false) {
                    $element->setAttribute(
                        'url',
                        $element->getAttribute('url') . '#' .
                        $this->getElementAttribute($element, 'anchor_name')
                    );
                }
            }
        }
    }
389366
public BaseSession getSessionObjectAt(int iIndex)
    {
        if (m_vSessionObjectList == null)
            return null;
        return (BaseSession)m_vSessionObjectList.elementAt(iIndex);
    }