GetNodeName
@param XPath2Context $context
@param XPathNavigator $nav
@return object
428414
public static function GetNodeName( $context, $nav )
	{
		if ( ! is_null( $nav ) )
		{
		    if ( $nav->getNodeType() == XPathNodeType::Element || $nav->getNodeType() == XPathNodeType::Attribute )
		    {
				return QNameValue::fromQName( new \lyquidity\xml\qname( $nav->Prefix, $nav->NamespaceURI, $nav->LocalName ) );
		    }
		    else if ( $nav->getNodeType() == XPathNodeType::ProcessingInstruction || $nav->getNodeType() == XPathNodeType::NamespaceURI )
		    {
			   return QNameValue::fromQName( new \lyquidity\xml\qname( "", "", $nav->Name ) );
		    }
		}
		return Undefined::getValue();
	}
1246253
public function setDataNodeName($dataNodeName)
    {
        $this->dataNodeName = $dataNodeName;
        $this->xmlEncoder->setRootNodeName($this->dataNodeName);

        return $this;
    }
151528
private function buildSectionNavigation(&$nav)
    {
        // Build the section navigation, grouped by their navigation groups
        $sections = SectionManager::fetch(null, 'asc', 'sortorder');

        if (is_array($sections) && !empty($sections)) {
            foreach ($sections as $s) {
                $group_index = self::__navigationFindGroupIndex($nav, $s->get('navigation_group'));

                if ($group_index === false) {
                    $group_index = General::array_find_available_index($nav, 0);

                    $nav[$group_index] = array(
                        'name' => $s->get('navigation_group'),
                        'type' => 'content',
                        'index' => $group_index,
                        'children' => array()
                    );
                }

                $hasAccess = true;
                $url = '/publish/' . $s->get('handle') . '/';
                /**
                 * Immediately after the core access rules allowed access to this page
                 * (i.e. not called if the core rules denied it).
                 * Extension developers must only further restrict access to it.
                 * Extension developers must also take care of checking the current value
                 * of the allowed parameter in order to prevent conflicts with other extensions.
                 * `$context['allowed'] = $context['allowed'] && customLogic();`
                 *
                 * @delegate CanAccessPage
                 * @since Symphony 2.7.0
                 * @see doesAuthorHaveAccess()
                 * @param string $context
                 *  '/backend/'
                 * @param bool $allowed
                 *  A flag to further restrict access to the page, passed by reference
                 * @param string $page_limit
                 *  The computed page limit for the current page
                 * @param string $page_url
                 *  The computed page url for the current page
                 * @param int $section.id
                 *  The id of the section for this url
                 * @param string $section.handle
                 *  The handle of the section for this url
                 */
                Symphony::ExtensionManager()->notifyMembers('CanAccessPage', '/backend/', array(
                    'allowed' => &$hasAccess,
                    'page_limit' => 'author',
                    'page_url' => $url,
                    'section' => array(
                        'id' => $s->get('id'),
                        'handle' => $s->get('handle')
                    ),
                ));

                if ($hasAccess) {
                    $nav[$group_index]['children'][] = array(
                        'link' => $url,
                        'name' => $s->get('name'),
                        'type' => 'section',
                        'section' => array(
                            'id' => $s->get('id'),
                            'handle' => $s->get('handle')
                        ),
                        'visible' => ($s->get('hidden') == 'no' ? 'yes' : 'no')
                    );
                }
            }
        }
    }
982790
public static function DocumentUri( $nav )
	{
		if ( is_null( $nav ) )
		    return Undefined::getValue();

		if ( $nav->getNodeType() != XPathNodeType::Root || $nav->getBaseURI() == "" )
		    return Undefined::getValue();

		return new AnyUriValue( $nav->getBaseURI() );
	}
669963
public static function GetNamespaceUriForPrefix( $context, $prefix, $nav )
	{
		$ns  = "";
		if ( $prefix instanceof  Undefined || $prefix . "" == "" )
		{
			$ns = $nav->getNamespaceURI();
		}
		else
		{
			/**
			 * @var XmlNamespaceManager $nsmgr
			 */
		    $nsmgr = new XmlNamespaceManager();
		    ExtFuncs::ScanLocalNamespaces( $nsmgr, $nav->CloneInstance(), false );
		    $ns = $nsmgr->lookupNamespace( $prefix . "" );
		}
		return is_null( $ns )
			? Undefined::getValue()
			: new AnyUriValue( $ns );
	}
263317
public static function GetBaseUri( $context, $nav )
	{
		if ( is_null( $nav ) )
		    return Undefined::getValue();

		if ( !( $nav->getNodeType() == XPathNodeType::Element ||
			 $nav->getNodeType() == XPathNodeType::Attribute ||
			 $nav->getNodeType() == XPathNodeType::Root ||
			 $nav->getNodeType() == XPathNodeType::NamespaceURI ) )
		    return Undefined::getValue();

		$nav = $nav->CloneInstance();
		$uri = array();
		do
		{
		    $baseUri = $nav->getBaseURI();
		    if ( $baseUri != "" )
			   $uri[] = $baseUri;
		}
		while ( $nav->MoveToParent() );

		$res = is_null( $context->RunningContext->BaseUri )
			? null
			: $context->RunningContext->BaseUri;

		for ( $k = count( $uri ) - 1; $k >= 0; $k-- )
		{
		    $res = is_null( $res )
		    	? uri[k]
		    	: SchemaTypes::resolve_path( $res, $uri[k] );
		}

		return is_null( $res )
			? Undefined::getValue()
			: new AnyUriValue( $res );
	}
649656
public function actionGetNavItemPath($navId)
    {
        $data = "";
        $node = NavItem::find()->where(['nav_id' => $navId])->one();
        if ($node) {
            $data .= $node->title;
            $parentNavId = $navId;
            while ($parentNavId != 0) {
                $parentNavIdModel = Nav::findOne($parentNavId);
                if ($parentNavIdModel) {
                    $parentNavId = $parentNavIdModel->parent_nav_id;
                    if ($parentNavId != 0) {
                        $node = NavItem::find()->where(['nav_id' => $parentNavId])->one();
                        if ($parentNavId) {
                            $data = $node->title . '/' . $data;
                        }
                    }
                }
            }
        }
        
        return $data;
    }
819678
protected function getRoutingNodeName()
    {
        $name = strtolower($this->getPackage()->getName());
        // package with the bundle can contain the word a 'bundle' in the name
        $name = preg_replace('/(\/.+)[^a-z]bundle$/', '$1', $name);
        $name = preg_replace('/[^a-z_]+/', '_', $name);

        return $name;
    }
441803
public static function getBooleanValueFromXPath($path, \DOMXPath $xpath, \DomNode $context = null, $default = null)
    {
        $value = self::getValueFromXPath($path, $xpath, $context, $default);

        if (null === $value) {
            return;
        }

        return 'true' === $value || true === $value;
    }
794661
public function getSiblingNode()
    {
        if ($this->siblingDomAddress === null) {
            return null;
        }

        if ($this->cachedSiblingNode === null) {
            $this->cachedSiblingNode = $this->nodeService->getNodeFromContextPath(
                $this->siblingDomAddress->getContextPath()
            );
        }

        return $this->cachedSiblingNode;
    }
1279034
public function getMiddleNode(): ?IUnaryNode {
        $head = $this->getHead();

        if (null === $head) return null;

        $p = $head;
        $q = $head;

        while (null !== $p &&
            null !== $q && //actually not really necessary since $p and $q point to the same object
            null !== $q->getNext()
        ) {
            $p = $p->getNext();
            $q = $q->getNext()->getNext();
        }
        return $p;
    }
284969
public static function WriteTraceWithLabel( $context, $iter, $label )
	{
		$sb = array();

		/**
		 * @var XPathItem $item
		 */
		foreach ( $iter as $item )
		{
			if ( $item instanceof XPath2NodeIterator )
			{
				$sb[] = ExtFuncs::StringJoin( $item, " " );
			}
		    else if ( $item->getIsNode() )
		    {
				/**
				 * @var XPathNavigator $nav
				 */
		    	$nav = $item;
				$sb[] = $nav->OuterXml;
		    }
		    else
		    {
		    	$sb[] = $item->getValue();
		    }

		}

		error_log( ( empty( $label ) ? "" : "$label " ) . implode( ", ", $sb ) );

		// if ( $item instanceof ExprIterator )
		// {
		// 	return $item;
		// }

		$iter->Reset();
		return $iter;

		$mapped = array_map( function( $item ) { return new ValueNode( null, $item ); }, $sb );
		return ExprIterator::fromNodes( $mapped, null, null );
	}
421139
public function inNamespace($ns) {
    if (is_string($ns)) {
      $namespace_node = $this->name->getNamespace();
      $namespace = $namespace_node === NULL ? '' : $namespace_node->getName()->getAbsolutePath();
      return $ns === $namespace;
    }
    elseif ($ns instanceof NamespaceNode) {
      return $this->name->getNamespace() === $ns;
    }
    else {
      throw new \InvalidArgumentException();
    }
  }
640936
public function getNodeType()
	{
		if ( is_null( $this->domNode ) ) return null;
		return isset(  DOMXPathNavigator::$nodeTypeMap[ $this->domNode->nodeType ] )
			? DOMXPathNavigator::$nodeTypeMap[ $this->domNode->nodeType ]
			: XPathNodeType::Element;
	}
902435
public function getIsNode()
	{
		return ! is_null( $this->domNode ) && isset( DOMXPathNavigator::$nodeTypeMap[ $this->domNode->nodeType ] );
	}
386608
@SuppressWarnings("unchecked")
    public static NamingService<Node> getNodeNames(Model mo) {
        return (NamingService<Node>) mo.getView(ID + Node.TYPE);
    }
1026077
@Override
    public String getFrameworkNodeName() {
        String name = getLookup().getProperty("framework.server.name");
        if (null!=name) {
            return name.trim();
        } else {
            return name;
        }
    }