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
评论列表
文章目录