我有一个 xml 文件,我必须通过它来检索 xml 文档。下面是我拥有的 xml 文档。
-<orcid-message>
-<orcid-profile type="user">
-<orcid-activities>
-<orcid-works>
-<orcid-work put-code="23938140" visibility="public">
-<work-contributors>
-<contributor>
-<credit-name visibility="public">Tania Maes</credit-name>
-<contributor>
-<credit-name visibility="public">Francisco Avila Cobos</credit-name>
-<contributor>
-<credit-name visibility="public">Franco Liala Manus</credit-name>
我想检索贡献者姓名:到目前为止我已经尝试过:
contributors_name = (doc['orcid-message']['orcid-profile']
['orcid-activities']['orcid-works']
['orcid-work']['work-contributors']
['contributor']['credit-name'] )
print(contributors_name)
请告诉我哪里出错了。谢谢你。