Returns the latest (parent) new id mapped by one pathelement
962964
public function get_new_parentid($itemname) {
        return array_key_exists($itemname, $this->elementsnewid) ? $this->elementsnewid[$itemname] : null;
    }
524496
private void updateParentsFree(int id) {
        int logChild = depth(id) + 1;
        while (id > 1) {
            int parentId = id >>> 1;
            byte val1 = value(id);
            byte val2 = value(id ^ 1);
            logChild -= 1; // in first iteration equals log, subsequently reduce 1 from logChild as we traverse up

            if (val1 == logChild && val2 == logChild) {
                setValue(parentId, (byte) (logChild - 1));
            } else {
                byte val = val1 < val2 ? val1 : val2;
                setValue(parentId, val);
            }

            id = parentId;
        }
    }
199134
public static int findMaxElementId(VoltXMLElement root) {
        int retval = 0;
        if (root != null) {
            String strId = root.attributes.get("id");
            if (strId != null) {
                retval = Integer.parseInt(strId);
            }
            for (VoltXMLElement child : root.children) {
                int childMaxId = findMaxElementId(child);
                if (retval < childMaxId) {
                    retval = childMaxId;
                }
            }
        }
        return retval;
    }
765330
function checkPath(id)
{
  var i;

  for (i = 0; i < this.pathsKeys.length; i++)
  {
    if (id.indexOf(this.pathsKeys[i]) == 0)
    {
      if (this.paths[this.pathsKeys[i]] == 'empty:')
      {
        id = 'empty:';
      }
      else
      {
        id = id.replace(this.pathsKeys[i], this.paths[this.pathsKeys[i]]);
      }
      break;
    }
  }

  return id;
}
1020594
static public void visitElements( XMLNode root, String path, ElementVisitor ev )
    {
        // Get last element in path
        int idx = path.lastIndexOf( '<' );
        String head = path.substring( 0, idx );
        String tag = path.substring( idx + 1, path.length() - 1 );

        XMLNode elem = findElementPath( root, head );
        if ( elem == null )
        {
            return;
        }

        // Iterate through all child nodes
        XMLNode n = elem.getNested();
        while ( n != null )
        {
            if ( n.isElement() && n.getName().equals( tag ) )
            {
                ev.visitElement( n );
            }
            n = n.getNext();
        }
    }
853101
def siblingsId(self):
        
        if self._next_id is False or self._prev_id is False:
            self._prev_id, self._next_id = self.getPrevNextUrn(reference=self.urn.reference)
        return self._prev_id, self._next_id
1075855
public boolean lastChild() {
        if (mNode == null || mNode.getChildCount() < 1) {
            return false;
        }
        for (int i = mNode.getChildCount() - 1; i >= 0; --i) {
            AccessibilityNodeInfoCompat newNode = mNode.getChild(i);
            if (newNode == null) {
                return false;
            }
            if (AccessibilityNodeInfoUtils.isVisibleOrLegacy(newNode)) {
                reset(newNode);
                return true;
            }
            newNode.recycle();
        }
        return false;
    }
950108
function(newnode, oldnode, lastnode, id, ids) {
		var result = true;
		var isSoftUpdate = false;
		var isPluginUpdate = false; // TODO: plugins...
		if ((newnode && !oldnode) || (!newnode && oldnode)) {
			result = false;
		} else if ((result = newnode.nodeType === oldnode.nodeType)) {
			switch (oldnode.nodeType) {
				case Node.TEXT_NODE:
					if (newnode.data !== oldnode.data) {
						result = false;
					}
					break;
				case Node.ELEMENT_NODE:
					if ((result = this._familiar(newnode, oldnode))) {
						if ((result = this._checkatts(newnode, oldnode, ids))) {
							if (this._maybesoft(newnode, oldnode)) {
								if (this._confirmsoft(newnode, oldnode)) {
									this._updatesoft(newnode, oldnode, ids);
									isSoftUpdate = true; // prevents the replace update
								}
								result = false; // crawling continued in _updatesoft
							} else {
								if (oldnode.localName !== "textarea") { // TODO: better forms support!
									result = newnode.childNodes.length === oldnode.childNodes.length;
									if (!result && oldnode.id) {
										lastnode = newnode;
										id = oldnode.id;
									}
								}
							}
						}
					}
					break;
			}
		}
		if (!result && !isSoftUpdate && !isPluginUpdate) {
			this._updates.collect(new edbml.FunctionUpdate(this._doc).setup(id));
			this._updates.collect(new edbml.HardUpdate(this._doc).setup(id, lastnode));
		}
		return result;
	}
1177033
def get_id_by_impath(path):
        '''
        
        '''
        logger.info('Get Entiry, Path: {0}'.format(path))

        entity_list = TabEntity.select().where(TabEntity.path == path)
        out_val = None
        if entity_list.count() == 1:
            out_val = entity_list.get()
        elif entity_list.count() > 1:
            for rec in entity_list:
                MEntity.delete(rec.uid)
            out_val = None
        else:
            pass
        return out_val
750346
def lastElementChild(self) -> Optional[AbstractNode]:
        
        for child in reversed(self.childNodes):  # type: ignore
            if child.nodeType == Node.ELEMENT_NODE:
                return child
        return None
758899
private ElementUI parentFromPath(String path) throws Exception {
        if (TOOLBAR_PATH.equalsIgnoreCase(path)) {
            return getDesktop().getToolbar();
        }
        
        String[] pieces = path.split(delim, 2);
        ElementTabPane tabPane = pieces.length == 0 ? null : findTabPane(pieces[0]);
        ElementUI parent = pieces.length < 2 ? null : getPathResolver().resolvePath(tabPane, pieces[1]);
        return parent == null ? tabPane : parent;
    }
717689
function getLevelDepth(e, id, waypoint, cnt) {
    cnt = cnt || 0;
    if (e.id.indexOf(id) >= 0) {
        return cnt;
    }
    if ($(e).hasClass(waypoint)) {
        ++cnt;
    }
    return e.parentNode && getLevelDepth(e.parentNode, id, waypoint, cnt);
}
1325515
function (rootNode) {
        if (!this._parent) {
            return '/';
        }

        var current = this._parent;
        var path = this.name;
        while (current._parent) {
            path = current.name + '/' + path;
            if (current._parent == rootNode) {
                break;
            }
            current = current._parent;
        }
        if (!current._parent && rootNode) {
            return null;
        }
        return path;
    }
1132554
public function updatePathString()
    {
        $parentTag = $this->getParent( true );
        $pathStringPrefix = $parentTag instanceof self ? $parentTag->attribute( 'path_string' ) : '/';

        $this->setAttribute( 'path_string', $pathStringPrefix . $this->attribute( 'id' ) . '/' );
        $this->store();

        foreach ( $this->getSynonyms( true ) as $s )
        {
            $s->setAttribute( 'path_string', $pathStringPrefix . $s->attribute( 'id' ) . '/' );
            $s->store();
        }

        foreach ( $this->getChildren( 0, null, true ) as $c )
        {
            $c->updatePathString();
        }
    }
1195455
function next(prev, current, isPre) {
    if (prev && prev.parentNode === current || isPre(current)) {
        return current.nextSibling || current.parentNode;
    }

    return current.firstChild || current.nextSibling || current.parentNode;
}
439361
def select_entry(self, core_element_id, by_cursor=True):
        """"""
        path = self.get_path_for_core_element(core_element_id)
        if path:
            if by_cursor:
                self.tree_view.set_cursor(path)
            else:
                self.tree_view.get_selection().select_path(path)
        else:
            self._logger.warning("Path not valid: {0} (by_cursor {1})".format(str(core_element_id), str(by_cursor)))
489363
def get_parent_id(element):
        """"""
        if 'parent' in element.attrib:
            return element.attrib['parent']
        else:
            return element.getparent().attrib[add_ns('id')]