Get the XML attribute with name from source. If path is not Mone, it will instead get the
  XML attribute with name from the child indicated by path.
343441
def get_xml_attr(source, name, path=None):
  
  if path is None:
    return source.attrib[name]
  else:
    return get_xml_attr(get_xml_child(source, path), name)
984238
private static Map<String, String> getAttributeMap(
      Node parent, String nodeName, String keyAttributeName, String valueAttributeName)
      throws AppEngineException {

    Map<String, String> nameValueAttributeMap = new HashMap<>();
    if (parent.hasChildNodes()) {
      for (int i = 0; i < parent.getChildNodes().getLength(); i++) {
        Node child = parent.getChildNodes().item(i);
        NamedNodeMap attributeMap = child.getAttributes();

        if (nodeName.equals(child.getNodeName()) && attributeMap != null) {
          Node keyNode = attributeMap.getNamedItem(keyAttributeName);

          if (keyNode != null) {
            Node valueNode = attributeMap.getNamedItem(valueAttributeName);
            try {
              nameValueAttributeMap.put(keyNode.getTextContent(), valueNode.getTextContent());
            } catch (DOMException ex) {
              throw new AppEngineException(
                  "Failed to parse value from attribute node " + keyNode.getNodeName(), ex);
            }
          }
        }
      }
    }

    return nameValueAttributeMap;
  }
45696
public Attribute getAttribute(String name)
  {
    ArrayList<Attribute> attributeList = getAttributeList();
    
    for (int i = attributeList.size() - 1; i >= 0; i--) {
      Attribute attr = attributeList.get(i);

      if (attr.getName().equals(name))
        return attr;
    }

    return null;
  }
830370
private String getNodeStringDefault(String defaultValue, String attribute, String... path)
    {
        final Xml node = getNodeDefault(path);
        if (node != null && node.hasAttribute(attribute))
        {
            return node.readString(attribute);
        }
        return defaultValue;
    }
875516
public static String getNodesPathName(Node node) {
        final StringBuffer buffer = new StringBuffer();

        if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
            buildNodeName(((Attr) node).getOwnerElement(), buffer);
            buffer.append(".");
            buffer.append(node.getLocalName());
        } else {
            buildNodeName(node, buffer);
        }

        return buffer.toString();
    }
1224462
def get_elements_attributes(parent_to_parse, element_path=None, attrib_name=None):
    

    attrs = _get_elements_property(parent_to_parse, element_path, 'attrib')

    if not attrib_name:
        return attrs

    return [attr[attrib_name] for attr in attrs if attrib_name in attr]
215902
def _get_attribute(self, attribute, name):
        """"""
        try:
            if attribute is None:
                attribute = self._attribute_file_open( name )
            else:
                attribute.seek(0)
            return attribute, attribute.read().strip().decode()
        except Exception as ex:
            self._raise_friendly_access_error(ex, name)
440956
private Xml getNode(String... path)
    {
        Xml node = root;
        for (final String element : path)
        {
            try
            {
                node = node.getChild(element);
            }
            catch (final LionEngineException exception)
            {
                throw new LionEngineException(exception, media);
            }
        }
        return node;
    }
1043750
def getchild(self, name, parent):
        
        #log.debug('searching parent (%s) for (%s)', Repr(parent), name)
        if name.startswith('@'):
            return parent.get_attribute(name[1:])
        else:
            return parent.get_child(name)
504510
@Override
    public Attribute getAttributeByName(QName name)
    {
        if (mAttrs == null) {
            return null;
        }
        return mAttrs.get(name);
    }
107493
private Xml getNodeDefault(String... path)
    {
        Xml node = root;
        for (final String element : path)
        {
            if (!node.hasChild(element))
            {
                return null;
            }
            node = node.getChild(element);
        }
        return node;
    }
929828
public XMLElementList getChildrenByName(String name) {
		XMLElementList selected = new XMLElementList();
		XMLElementList children = getChildren();
		
		for (int i=0;i<children.size();i++) {
			if (children.get(i).getName().equals(name)) {
				selected.add(children.get(i));
			}
		}
		
		return selected;
	}
895897
def GetAttribute(self, name):
        
        ret = libxml2mod.xmlTextReaderGetAttribute(self._o, name)
        return ret
334763
def get_element_attributes(parent_to_parse, element_path=None):
    

    element = get_element(parent_to_parse, element_path)

    return {} if element is None else element.attrib
584
XmlNode.QName toNodeQName(Context cx, Object nameValue, boolean attribute) {
        if (nameValue instanceof XMLName) {
            return ((XMLName)nameValue).toQname();
        } else if (nameValue instanceof QName) {
            QName qname = (QName)nameValue;
            return qname.getDelegate();
        } else if (
            nameValue instanceof Boolean
            || nameValue instanceof Number
            || nameValue == Undefined.instance
            || nameValue == null
        ) {
            throw badXMLName(nameValue);
        } else {
            String local = null;
            if (nameValue instanceof String) {
                local = (String)nameValue;
            } else {
                local = ScriptRuntime.toString(nameValue);
            }
            return toNodeQName(cx, local, attribute);
        }
    }
302998
private String getNodeString(String attribute, String... path)
    {
        final Xml node = getNode(path);
        return node.readString(attribute);
    }
492006
def get_name(path_name, *, ext=True, override=None, identity=None):
    
    if identity is None:
        identity = identify(path_name, override=override)

    if identity == ISFILE:
        if ext:
            r = os.path.basename(path_name)
        else:
            r = os.path.splitext(os.path.basename(path_name))[NAME]
    else:
        r = ''
    return r