【发布时间】:2020-06-06 13:42:44
【问题描述】:
我正在寻找一种从一个非常大的 xml 文档中获取特定标签的方法。
带有内置模块的python dom
例如:
<AssetType longname="characters" shortname="chr" shortnames="chrs">
<type>
pub
</type>
<type>
geo
</type>
<type>
rig
</type>
</AssetType>
<AssetType longname="camera" shortname="cam" shortnames="cams">
<type>
cam1
</type>
<type>
cam2
</type>
<type>
cam4
</type>
</AssetType>
我想检索获得属性的 AssetType 节点的子节点的值 (longname="characters" )
得到'pub','geo','rig'的结果
请记住,我有超过 1000 个 节点
提前谢谢
【问题讨论】: