Attempts to get the next sibling.

@return AbstractNode
@throws ParentNotFoundException
352567
public function nextSibling()
    {
        if (is_null($this->parent)) {
            throw new ParentNotFoundException('Parent is not set for this node.');
        }

        return $this->parent->nextChild($this->id);
    }
248964
public function getFirst()
    {
        $element = null;

        if (
            $this->hasParent() and
            $this->parent->hasElements()
        ) {
            $element = $this->parent->elements[0];
        }

        return $element;
    }
374747
public function nextSibling()
    {
        $node = $this->node->nextSibling;

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

        return new Element($node);
    }
1296320
public function getNextSiblingOf( AbstractElement $element ) {
		$index = $this->indexOf($element);

		return $this->childAtIndex($index + 1);
	}
914107
protected function NextItem()
	{
		// return null;
		$nodeTest = XmlQualifiedNameTest::Create();

		while ( true )
		{
			if ( ! $this->iterator->MoveNext() )
			{
				return null;
			}

			$node = $this->iterator->getCurrent();

			// An element with children cannot be an ID
			if ( $node->getHasChildren() ) continue;

			// Is this element a type?
			// $info = $node->getSchemaInfo();
			$type = $this->types->getElement( $node->LocalName, $node->Prefix == "" ? null : $node->Prefix );
			if ( $type )
			{
				return CoreFuncs::CloneInstance( $node );
			}
			else
			{
				// Look at the attributes
				if ( ! $node->getHasAttributes() ) continue;
				$attribs = AttributeNodeIterator::fromNodeTest( $this->context, $nodeTest, XPath2NodeIterator::Create( $node ) );
				foreach ( $attribs as $attribute )
				{
					$info = $attribute->getSchemaInfo();
					$type = $this->types->getAttribute( $attribute->LocalName, $info->Prefix == "" ? SCHEMA_PREFIX : $info->Prefix );
					if ( ! $type ) continue;
					foreach ( $type['types'] as $type )
					{
						if ( $type['prefix'] != SCHEMA_PREFIX ||
							 $type['name'] != ( $this->type ? "IDREF" : "ID" ) ||
							 ! in_array( $attribute->getValue(), $this->IDRef )
						) continue;
						return CoreFuncs::CloneInstance( $this->type ? $attribute : $node );
					}
					// if ( $attribute->LocalName == "anId" && in_array( $attribute->getValue(), $this->IDRef ) )
					// {
					// 	return CoreFuncs::CloneInstance( $node );
					// }
				}
			}
		}
	}
54924
def next_sibling()
      if siblings = parent.children
        siblings.each_with_index do |node, i|
          return siblings[i + 1] if node.equal?(self)
        end
      end
      nil
    end
699471
public function getParent()
    {
        if ($this->path === '/') {
            return null;
        }

        return $this->nodeDataRepository->findOneByPath($this->parentPath, $this->workspace);
    }
181113
public function get_siblings() {
        // Returns a list of the siblings of the current node for display in a flat navigation element. Either
        // the in-page links or the breadcrumb links.
        $siblings = false;

        if ($this->has_siblings()) {
            $siblings = [];
            foreach ($this->parent->children as $child) {
                if ($child->display) {
                    $siblings[] = $child;
                }
            }
        }
        return $siblings;
    }
664874
protected function NextItem()
	{
		while ( true )
		{
			if ( is_null( $this->iter ) )
			{
				if ( ! $this->baseIter->MoveNext() )
					return null;
				$this->sequentialPosition = 0;
				$this->iter = XPath2NodeIterator::Create( $this->node->Execute( new NodeProvider( $this->baseIter->getCurrent() ), $this->dataPool ) );
			}
			if ( $this->iter->MoveNext() )
			{
				$this->sequentialPosition++;
				return $this->iter->getCurrent();
			}
			$this->iter = null;
		}
	}
581078
public function getRoot()
    {
        $next_parent = $this->getParent();
        $parent = null;
        while ($next_parent) {
            $parent = $next_parent;
            $next_parent = $parent->getParent();
        }

        return $parent ? $parent : $this;
    }
231847
def get_next_sibling(self):
        
        siblings = self.get_siblings()
        ids = [obj.pk for obj in siblings]
        if self.pk in ids:
            idx = ids.index(self.pk)
            if idx < len(siblings) - 1:
                return siblings[idx + 1]
568223
public function previousChild(int $id): AbstractNode
    {
        $child = $this->getchild($id);
        $next  = $this->children[$child->id()]['prev'];
        if (is_null($next)) {
            throw new ChildNotFoundException("Child '$id' previous not found in this node.");
        }

        return $this->getChild($next);
    }
1217401
public function next() {
    $next = next($this->currentAttributes);
    if ($next !== false) {
      $this->currentAttribute = $next;
    }
    else {
      if ($this->recursive) {
        $this->nodeIterator->next();
        if (!$this->nodeIterator->valid()) {
          $this->end = true;
        }
        else {
          $nextNode = $this->nodeIterator->current();
          $this->currentAttributes = $nextNode->getValueNames(false);
          $this->currentAttribute = current($this->currentAttributes);
        }
      }
      else {
        $this->end = true;
      }
    }
    return $this;
  }
234237
public function getFirst()
    {
        if (count($this->children)) {
            reset($this->children);
            return current($this->children);
        } else {
            return null;
        }
    }
1357894
public function getLevel()
    {
        if ($this->_level !== null) {
            return $this->_level;
        }

        if ($this->isRoot()) {
            $this->_level = -1;
            return $this->_level;
        }

        $parents = array($this);
        $node = $this;

        while ($parent = $node->getParent()){
            if (!$parent->isRoot()) {
                $parents[] = $parent;
            }
            $node = $parent;
        }

        $this->_level = count($parents);

        return $this->_level;
    }
349028
public function getParent()
	{
		$master = $this->getMaster();

		if (empty($master)) {
			return null;
		}

		$parent = $master->getParent();

		if (empty($parent)) {
			return null;
		}

		/* @var $parent AbstractPage */
		$parentData = $parent->getLocalization($this->locale);

		return $parentData;
	}
508155
protected function NextItem()
	{
		while (true)
		{
			if ( ! is_null( $this->childIter ) )
			{
				if ( $this->childIter instanceof ExprIterator )
				{
					$result = $this->childIter;
					$this->childIter = null;
					return $result;
				}
				else
				{
					if ( $this->childIter->MoveNext() )
						return $this->childIter->getCurrent();
					else
						$this->childIter = null;
				}
			}
			if ( ! $this->iter->MoveNext() )
				return null;

			if ( $this->owner->MoveNext( $this->provider, $this->dataPool, $this->iter->getCurrent(), $res ) )
			{
				if ( $res instanceof XPath2NodeIterator )
				{
					$this->childIter = $res;
				}
				else
				{
					$this->childIter = null;
					return $res instanceof XPathItem
						? $res
						: XPath2Item::fromValue( $res );
				}
			}
		}
	}