analyse_xml.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:py4design 作者: chenkianwee 项目源码 文件源码
def get_childnode_attributes(node_name, parent_node, attribute_name):
    """
    This function gets the node attributes.

    Parameters
    ----------
    node_name : str
        The name of the node to be retrieved.

    parent_node : xml minidom Node
        The parent node.

    attribute_name : str
        The name of the attributes to retrieve.

    Returns
    -------
    values : list of str
        The values of the attributes of the node.
    """
    attributes = []
    for node in parent_node.getElementsByTagName(node_name):
        attributes.append(str(node.attributes[attribute_name].value))

    return attributes
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号