Stringifies the XPath of the current node's parent.
196435
public String getParentXPath() {
        Iterator<Level> levelIterator = path.descendingIterator();
        if (levelIterator.hasNext()) {
            levelIterator.next();
        }
        return getXPath(levelIterator);
    }
605423
function  (node) {
		  	var parent = node.parentNode,
			  	path = [],
			  	index = this.getChildIndex(node);

		  if(parent && (path = this.getNodePath(parent))){
			   if(index > -1){
				   path.push(index);
			   }
		  }
		  return path;
		}
1351843
public @Nonnull Optional<XQuery> parent() {
        synchronized (this) {
            if (parent.get() == null) {
                parent.set(Optional.ofNullable(node.getParentNode()).map(XQuery::new));
            }
        }
        return parent.get();
    }
483308
function _findNearestDOMParent(element, parentNodeName) {
			while (element.nodeName !== parentNodeName) {
				if (element.nodeName === "CONTROL-TREE") {
					break;
				}
				element = element.parentNode;
			}

			return element;
		}
498137
def _grab_xpath(root, xpath, converter=lambda x: x):
    
    elements = root.xpath(xpath)
    if elements:
        return converter(str(elements[0]))
    else:
        return None
953107
def CurrentNode(self):
        
        ret = libxml2mod.xmlTextReaderCurrentNode(self._o)
        if ret is None:raise treeError('xmlTextReaderCurrentNode() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
346743
def xsl_text(self, text, parent):
        
        res = ET.SubElement(parent, "text")
        res.text = text
        return res
551373
function getParentNode(node) {
        var parent = node.parentNode;

        if (parent && parent.nodeType == 11 && parent.host) {
            // If the parent is a shadow root, return the host element.
            return parent.host;
        }
        return parent;
    }
28865
def get_parent_data(tree, node, current):
        
        if not current:
            current = []

        parent = tree.parent(node.identifier)
        if parent.is_root():
            return current

        current.insert(0, (parent.tag, parent.data))
        return PlateManager.get_parent_data(tree, parent, current)
23407
def xsl_withparam(self, name, value, parent):
        
        res = ET.SubElement(parent, "with-param", name=name)
        res.text = value
        return res
116902
def node(self, parent=None, tag='g', attrib=None, **extras):
        """"""
        if parent is None:
            parent = self.root
        attrib = attrib or {}
        attrib.update(extras)

        def in_attrib_and_number(key):
            return key in attrib and isinstance(attrib[key], Number)

        for pos, dim in (('x', 'width'), ('y', 'height')):
            if in_attrib_and_number(dim) and attrib[dim] < 0:
                attrib[dim] = -attrib[dim]
                if in_attrib_and_number(pos):
                    attrib[pos] = attrib[pos] - attrib[dim]

        for key, value in dict(attrib).items():
            if value is None:
                del attrib[key]

            attrib[key] = to_str(value)
            if key.endswith('_'):
                attrib[key.rstrip('_')] = attrib[key]
                del attrib[key]
            elif key == 'href':
                attrib[etree.QName('http://www.w3.org/1999/xlink',
                                   key)] = attrib[key]
                del attrib[key]
        return etree.SubElement(parent, tag, attrib)
13354
def get_parent_tag(mention):
    
    span = _to_span(mention)
    i = _get_node(span.sentence)
    return str(i.getparent().tag) if i.getparent() is not None else None
490889
public function getNode($xpath = null)
    {
        if ($xpath === null) {
            return $this->getXml();
        }

        $result = $this->getXml()->xpath($xpath)->current();
        if ($result === false) {
            $result = null;
        }

        return $result;
    }
1153359
private LayoutElement parseElement(Element node, LayoutElement parent) {
        LayoutElement layoutElement = newLayoutElement(node, parent, null);
        parseChildren(node, layoutElement, Tag.ELEMENT, Tag.TRIGGER);
        return layoutElement;
    }
147589
def getXmlText (parent, tag):
    """"""
    elem = parent.getElementsByTagName(tag)[0]
    # Yes, the DOM standard is awful.
    rc = []
    for node in elem.childNodes:
        if node.nodeType == node.TEXT_NODE:
            rc.append(node.data)
    return ''.join(rc)
1333787
def xpath(self, xpath_str):
        
        return super(BaseOxmlElement, self).xpath(
            xpath_str, namespaces=_nsmap
        )
803469
def get_xpath_tuple(xpath):
    

    xroot = get_xpath_root(xpath)
    xattr = None

    if xroot != xpath:
        xattr = get_xpath_branch(xroot, xpath).strip('@')

    return (xroot, xattr)